diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-07-30 12:19:01 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-07-30 12:19:01 +0200 |
commit | 22b89670310b5cfc01d72cea960e310e9a52b727 (patch) | |
tree | 1a6f5c16f701568ea2b1af52e7766af900e1bc59 /apps/files_versions | |
parent | ba18452edac08485e9cf7aceba7daab750d4628a (diff) | |
download | nextcloud-server-22b89670310b5cfc01d72cea960e310e9a52b727.tar.gz nextcloud-server-22b89670310b5cfc01d72cea960e310e9a52b727.zip |
check if app is enabled
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/hooks.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index f0082b301a3..81ee3c8b3c6 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -19,7 +19,7 @@ class Hooks { */ public static function write_hook( $params ) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; if($path<>'') { Storage::store($path); @@ -36,12 +36,12 @@ class Hooks { * cleanup the versions directory if the actual file gets deleted */ public static function remove_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; if($path<>'') { Storage::delete($path); } - } } @@ -53,13 +53,13 @@ class Hooks { * of the stored versions along the actual file */ public static function rename_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; if($oldpath<>'' && $newpath<>'') { Storage::rename( $oldpath, $newpath ); } - } } @@ -71,10 +71,11 @@ class Hooks { * to remove the used space for versions stored in the database */ public static function deleteUser_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $uid = $params['uid']; Storage::deleteUser($uid); - } + } } } |