summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-08-07 15:26:09 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-08-07 15:29:35 +0200
commit0b3ddbed686f345e80dee1fbc8b3567da5d7b85a (patch)
treeb42d7981d23331fe74f2f174f5afa70548aca27a /apps/files_encryption/lib
parentd2365afad6c10a2b365b13296065e99bf13d704f (diff)
downloadnextcloud-server-0b3ddbed686f345e80dee1fbc8b3567da5d7b85a.tar.gz
nextcloud-server-0b3ddbed686f345e80dee1fbc8b3567da5d7b85a.zip
add logout hook to remove keys from session
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-xapps/files_encryption/lib/helper.php1
-rw-r--r--apps/files_encryption/lib/session.php8
2 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index ed42cec326a..214e212b675 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -49,6 +49,7 @@ class Helper {
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');
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 4b28f0ce676..84599181ba2 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -122,6 +122,14 @@ class Session {
}
/**
+ * 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
* @return bool