return $result;\r
}\r
\r
+ /**\r
+ * remove keys from session during logout\r
+ */\r
+ public static function logout() {\r
+ $session = new \OCA\Encryption\Session(new \OC\Files\View());\r
+ $session->removeKeys();\r
+ }\r
+\r
/**\r
* setup encryption backend upon user created\r
* @note This method should never be called for users using client side encryption\r
* @param array $params keys: uid, password\r
*/\r
public static function setPassphrase($params) {\r
-\r
if (\OCP\App::isEnabled('files_encryption') === false) {\r
return true;\r
}\r
public static function registerUserHooks() {
\OCP\Util::connectHook('OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login');
+ \OCP\Util::connectHook('OC_User', 'logout', 'OCA\Encryption\Hooks', 'logout');
\OCP\Util::connectHook('OC_User', 'post_setPassword', 'OCA\Encryption\Hooks', 'setPassphrase');
\OCP\Util::connectHook('OC_User', 'pre_setPassword', 'OCA\Encryption\Hooks', 'preSetPassphrase');
\OCP\Util::connectHook('OC_User', 'post_createUser', 'OCA\Encryption\Hooks', 'postCreateUser');
}
+ /**
+ * remove keys from session
+ */
+ public function removeKeys() {
+ \OC::$session->remove('publicSharePrivateKey');
+ \OC::$session->remove('privateKey');
+ }
+
/**
* Sets status of encryption app
* @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED
<p>\r
<a name="changePKPasswd" />\r
<label for="changePrivateKeyPasswd">\r
- <?php p( $l->t( "Your private key password no longer match your log-in password:" ) ); ?>\r
+ <em><?php p( $l->t( "Your private key password no longer match your log-in password." ) ); ?></em>\r
</label>\r
<br />\r
- <em><?php p( $l->t( "Set your old private key password to your current log-in password." ) ); ?>\r
+ <?php p( $l->t( "Set your old private key password to your current log-in password:" ) ); ?>\r
<?php if ( $_["recoveryEnabledForUser"] ):\r
p( $l->t( " If you don't remember your old password you can ask your administrator to recover your files." ) );\r
endif; ?>\r
- </em>\r
<br />\r
<input\r
type="password"\r