summaryrefslogtreecommitdiffstats
path: root/apps/encryption/hooks
diff options
context:
space:
mode:
authorClark Tomlinson <fallen013@gmail.com>2015-03-26 20:35:36 -0400
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:27 +0200
commitd15c2e52b0576e7846a09fd84e0e10f3054623c6 (patch)
treef027d9cb18160353fe440e4eef48be8aa7cdea99 /apps/encryption/hooks
parent2e00acda079644ce4eb61b8a3812b095df8d05e3 (diff)
downloadnextcloud-server-d15c2e52b0576e7846a09fd84e0e10f3054623c6.tar.gz
nextcloud-server-d15c2e52b0576e7846a09fd84e0e10f3054623c6.zip
cleanup and removing cachefactory
Diffstat (limited to 'apps/encryption/hooks')
-rw-r--r--apps/encryption/hooks/apphooks.php37
-rw-r--r--apps/encryption/hooks/filesystemhooks.php46
-rw-r--r--apps/encryption/hooks/sharehooks.php40
-rw-r--r--apps/encryption/hooks/userhooks.php18
4 files changed, 15 insertions, 126 deletions
diff --git a/apps/encryption/hooks/apphooks.php b/apps/encryption/hooks/apphooks.php
deleted file mode 100644
index 713e9cadef6..00000000000
--- a/apps/encryption/hooks/apphooks.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * @author Clark Tomlinson <clark@owncloud.com>
- * @since 2/19/15, 10:02 AM
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Encryption\Hooks;
-
-use OCA\Encryption\Hooks\Contracts\IHook;
-use OCP\Util;
-
-class AppHooks implements IHook {
- /**
- * Connects Hooks
- *
- * @return null
- */
- public function addHooks() {
- Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
- Util::connectHook('OC_App', 'post_disable', 'OCA\Encryption\Hooks', 'postEnable');
- }
-}
diff --git a/apps/encryption/hooks/filesystemhooks.php b/apps/encryption/hooks/filesystemhooks.php
deleted file mode 100644
index fda6b75b299..00000000000
--- a/apps/encryption/hooks/filesystemhooks.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @author Clark Tomlinson <clark@owncloud.com>
- * @since 2/19/15, 10:02 AM
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Encryption\Hooks;
-
-
-use OCA\Encryption\Hooks\Contracts\IHook;
-use OCP\Util;
-
-class FileSystemHooks implements IHook {
-
- /**
- * Connects Hooks
- *
- * @return null
- */
- public function addHooks() {
- Util::connectHook('OC_Filesystem', 'rename', 'OCA\Encryption\Hooks', 'preRename');
- Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Encryption\Hooks', 'postRenameOrCopy');
- Util::connectHook('OC_Filesystem', 'copy', 'OCA\Encryption\Hooks', 'preCopy');
- Util::connectHook('OC_Filesystem', 'post_copy', 'OCA\Encryption\Hooks', 'postRenameOrCopy');
- Util::connectHook('OC_Filesystem', 'post_delete', 'OCA\Encryption\Hooks', 'postDelete');
- Util::connectHook('OC_Filesystem', 'delete', 'OCA\Encryption\Hooks', 'preDelete');
- Util::connectHook('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', 'OCA\Encryption\Hooks', 'postPasswordReset');
- Util::connectHook('OC_Filesystem', 'post_umount', 'OCA\Encryption\Hooks', 'postUnmount');
- Util::connectHook('OC_Filesystem', 'umount', 'OCA\Encryption\Hooks', 'preUnmount');
- }
-}
diff --git a/apps/encryption/hooks/sharehooks.php b/apps/encryption/hooks/sharehooks.php
deleted file mode 100644
index fc50712b821..00000000000
--- a/apps/encryption/hooks/sharehooks.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * @author Clark Tomlinson <clark@owncloud.com>
- * @since 2/19/15, 10:02 AM
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Encryption\Hooks;
-
-
-use OCA\Encryption\Hooks\Contracts\IHook;
-use OCP\Util;
-
-class ShareHooks implements IHook {
-
- /**
- * Connects Hooks
- *
- * @return null
- */
- public function addHooks() {
- Util::connectHook('OCP\Share', 'pre_shared', 'OCA\Encryption\Hooks', 'preShared');
- Util::connectHook('OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared');
- Util::connectHook('OCP\Share', 'post_unshare', 'OCA\Encryption\Hooks', 'postUnshare');
- }
-}
diff --git a/apps/encryption/hooks/userhooks.php b/apps/encryption/hooks/userhooks.php
index e8c5fb8bfb7..1629aca0f55 100644
--- a/apps/encryption/hooks/userhooks.php
+++ b/apps/encryption/hooks/userhooks.php
@@ -22,6 +22,7 @@
namespace OCA\Encryption\Hooks;
+use OCP\ISession;
use OCP\Util as OCUtil;
use OCA\Encryption\Hooks\Contracts\IHook;
use OCA\Encryption\KeyManager;
@@ -53,6 +54,10 @@ class UserHooks implements IHook {
* @var Util
*/
private $util;
+ /**
+ * @var ISession
+ */
+ private $session;
/**
* UserHooks constructor.
@@ -63,15 +68,22 @@ class UserHooks implements IHook {
* @param IUserSession $user
* @param OCUtil $ocUtil
* @param Util $util
+ * @param ISession $session
*/
- public function __construct(
- KeyManager $keyManager, ILogger $logger, Setup $userSetup, IUserSession $user, OCUtil $ocUtil, Util $util) {
+ public function __construct(KeyManager $keyManager,
+ ILogger $logger,
+ Setup $userSetup,
+ IUserSession $user,
+ OCUtil $ocUtil,
+ Util $util,
+ ISession $session) {
$this->keyManager = $keyManager;
$this->logger = $logger;
$this->userSetup = $userSetup;
$this->user = $user;
$this->util = $util;
+ $this->session = $session;
}
/**
@@ -132,7 +144,7 @@ class UserHooks implements IHook {
* remove keys from session during logout
*/
public function logout() {
- KeyManager::$cacheFactory->clear();
+ KeyManager::$session->clear();
}
/**