set the init status to "NOT_INITIALIZED" if the encryption app gets enabled

remotes/origin/stable6
Bjoern Schiessle 12 years ago
parent bd450d6f6b
commit eb348b776c
  1. 12
      apps/files_encryption/hooks/hooks.php
  2. 1
      apps/files_encryption/lib/helper.php
  3. 2
      apps/files_encryption/lib/util.php

@ -555,4 +555,16 @@ class Hooks {
}
}
/**
* set the init status to 'NOT_INITIALIZED' (0) if the app gets enabled
* @param array $params contains the app ID
*/
public static function postEnable($params) {
error_log("app was enabled!");
if ($params['app'] === 'files_encryption') {
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
}
}
}

@ -69,6 +69,7 @@ class Helper {
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');
}
/**

@ -1278,7 +1278,7 @@ class Util {
// 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];

Loading…
Cancel
Save