}\r
}\r
\r
+ /**\r
+ * set the init status to 'NOT_INITIALIZED' (0) if the app gets enabled\r
+ * @param array $params contains the app ID\r
+ */\r
+ public static function postEnable($params) {\r
+ error_log("app was enabled!");\r
+ if ($params['app'] === 'files_encryption') {\r
+ $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));\r
+ $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);\r
+ }\r
+ }\r
+\r
}\r
public static function registerAppHooks() {
\OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
+ \OCP\Util::connectHook('OC_App', 'post_disable', 'OCA\Encryption\Hooks', 'postEnable');
}
/**
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
- return false;
+ return self::MIGRATION_OPEN;
// If a record is found
} else {
return (int)$migrationStatus[0];