aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks/hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/hooks/hooks.php')
-rw-r--r--apps/files_encryption/hooks/hooks.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index e39e068cc5d..09153918940 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -543,4 +543,17 @@ class Hooks {
\OC_FileProxy::$enabled = $proxyStatus;
}
+
+ /**
+ * set migration status back to '0' so that all new files get encrypted
+ * if the app gets enabled again
+ * @param array $params contains the app ID
+ */
+ public static function preDisable($params) {
+ if ($params['app'] === 'files_encryption') {
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*encryption` SET `migration_status`=0');
+ $query->execute();
+ }
+ }
+
}