summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2017-10-24 15:59:13 +0200
committerGitHub <noreply@github.com>2017-10-24 15:59:13 +0200
commit306d4e1d40ce076b715a5f0a87e743189da775e6 (patch)
tree4d4737ea9c757e7e9018b9d5a74534bf41b4196b /apps
parentf8e4d0d564a71856dcb0e223f0dd279209383fd1 (diff)
parent5987099d2a7801d89310dc9e829927a67c1af9d2 (diff)
downloadnextcloud-server-306d4e1d40ce076b715a5f0a87e743189da775e6.tar.gz
nextcloud-server-306d4e1d40ce076b715a5f0a87e743189da775e6.zip
Merge pull request #6922 from nextcloud/unneeded-isEnabled-check
Remove unneeded check if app is enabled
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/lib/Hooks/UserHooks.php21
-rw-r--r--apps/files_trashbin/lib/Hooks.php6
-rw-r--r--apps/files_versions/lib/Hooks.php72
3 files changed, 34 insertions, 65 deletions
diff --git a/apps/encryption/lib/Hooks/UserHooks.php b/apps/encryption/lib/Hooks/UserHooks.php
index e0826e2c7e3..a08796aee54 100644
--- a/apps/encryption/lib/Hooks/UserHooks.php
+++ b/apps/encryption/lib/Hooks/UserHooks.php
@@ -170,11 +170,6 @@ class UserHooks implements IHook {
* @return boolean|null
*/
public function login($params) {
-
- if (!App::isEnabled('encryption')) {
- return true;
- }
-
// ensure filesystem is loaded
if (!\OC\Files\Filesystem::$loaded) {
$this->setupFS($params['uid']);
@@ -200,10 +195,7 @@ class UserHooks implements IHook {
* @param array $params
*/
public function postCreateUser($params) {
-
- if (App::isEnabled('encryption')) {
- $this->userSetup->setupUser($params['uid'], $params['password']);
- }
+ $this->userSetup->setupUser($params['uid'], $params['password']);
}
/**
@@ -213,17 +205,12 @@ class UserHooks implements IHook {
* @note This method should never be called for users using client side encryption
*/
public function postDeleteUser($params) {
-
- if (App::isEnabled('encryption')) {
- $this->keyManager->deletePublicKey($params['uid']);
- }
+ $this->keyManager->deletePublicKey($params['uid']);
}
public function prePasswordReset($params) {
- if (App::isEnabled('encryption')) {
- $user = $params['uid'];
- self::$passwordResetUsers[$user] = true;
- }
+ $user = $params['uid'];
+ self::$passwordResetUsers[$user] = true;
}
public function postPasswordReset($params) {
diff --git a/apps/files_trashbin/lib/Hooks.php b/apps/files_trashbin/lib/Hooks.php
index eb585aa051c..036294cc144 100644
--- a/apps/files_trashbin/lib/Hooks.php
+++ b/apps/files_trashbin/lib/Hooks.php
@@ -39,10 +39,8 @@ class Hooks {
* to remove the used space for the trash bin stored in the database
*/
public static function deleteUser_hook($params) {
- if( \OCP\App::isEnabled('files_trashbin') ) {
- $uid = $params['uid'];
- Trashbin::deleteUser($uid);
- }
+ $uid = $params['uid'];
+ Trashbin::deleteUser($uid);
}
public static function post_write_hook($params) {
diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php
index a9ebb153eff..1fdf1afef90 100644
--- a/apps/files_versions/lib/Hooks.php
+++ b/apps/files_versions/lib/Hooks.php
@@ -54,12 +54,9 @@ class Hooks {
* listen to write event.
*/
public static function write_hook( $params ) {
-
- if (\OCP\App::isEnabled('files_versions')) {
- $path = $params[\OC\Files\Filesystem::signal_param_path];
- if($path !== '') {
- Storage::store($path);
- }
+ $path = $params[\OC\Files\Filesystem::signal_param_path];
+ if($path !== '') {
+ Storage::store($path);
}
}
@@ -72,12 +69,9 @@ class Hooks {
* cleanup the versions directory if the actual file gets deleted
*/
public static function remove_hook($params) {
-
- if (\OCP\App::isEnabled('files_versions')) {
- $path = $params[\OC\Files\Filesystem::signal_param_path];
- if($path !== '') {
- Storage::delete($path);
- }
+ $path = $params[\OC\Files\Filesystem::signal_param_path];
+ if($path !== '') {
+ Storage::delete($path);
}
}
@@ -100,13 +94,10 @@ class Hooks {
* of the stored versions along the actual file
*/
public static function rename_hook($params) {
-
- if (\OCP\App::isEnabled('files_versions')) {
- $oldpath = $params['oldpath'];
- $newpath = $params['newpath'];
- if($oldpath !== '' && $newpath !== '') {
- Storage::renameOrCopy($oldpath, $newpath, 'rename');
- }
+ $oldpath = $params['oldpath'];
+ $newpath = $params['newpath'];
+ if($oldpath !== '' && $newpath !== '') {
+ Storage::renameOrCopy($oldpath, $newpath, 'rename');
}
}
@@ -118,13 +109,10 @@ class Hooks {
* the stored versions to the new location
*/
public static function copy_hook($params) {
-
- if (\OCP\App::isEnabled('files_versions')) {
- $oldpath = $params['oldpath'];
- $newpath = $params['newpath'];
- if($oldpath !== '' && $newpath !== '') {
- Storage::renameOrCopy($oldpath, $newpath, 'copy');
- }
+ $oldpath = $params['oldpath'];
+ $newpath = $params['newpath'];
+ if($oldpath !== '' && $newpath !== '') {
+ Storage::renameOrCopy($oldpath, $newpath, 'copy');
}
}
@@ -137,25 +125,21 @@ class Hooks {
*
*/
public static function pre_renameOrCopy_hook($params) {
- if (\OCP\App::isEnabled('files_versions')) {
-
- // if we rename a movable mount point, then the versions don't have
- // to be renamed
- $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files' . $params['oldpath']);
- $manager = \OC\Files\Filesystem::getMountManager();
- $mount = $manager->find($absOldPath);
- $internalPath = $mount->getInternalPath($absOldPath);
- if ($internalPath === '' and $mount instanceof \OC\Files\Mount\MoveableMount) {
- return;
- }
-
- $view = new \OC\Files\View(\OCP\User::getUser() . '/files');
- if ($view->file_exists($params['newpath'])) {
- Storage::store($params['newpath']);
- } else {
- Storage::setSourcePathAndUser($params['oldpath']);
- }
+ // if we rename a movable mount point, then the versions don't have
+ // to be renamed
+ $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files' . $params['oldpath']);
+ $manager = \OC\Files\Filesystem::getMountManager();
+ $mount = $manager->find($absOldPath);
+ $internalPath = $mount->getInternalPath($absOldPath);
+ if ($internalPath === '' and $mount instanceof \OC\Files\Mount\MoveableMount) {
+ return;
+ }
+ $view = new \OC\Files\View(\OCP\User::getUser() . '/files');
+ if ($view->file_exists($params['newpath'])) {
+ Storage::store($params['newpath']);
+ } else {
+ Storage::setSourcePathAndUser($params['oldpath']);
}
}