[Pkg-owncloud-commits] [owncloud] 89/122: Do not trigger preview hooks if enable_previews is false
David Prévot
taffit at moszumanska.debian.org
Sat May 9 00:00:21 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 3a3a58f24839cc14b726cb8a272847d0b4f4153e
Author: Hugo Gonzalez Labrador <hglavra at gmail.com>
Date: Wed May 6 10:03:18 2015 +0200
Do not trigger preview hooks if enable_previews is false
---
lib/base.php | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lib/base.php b/lib/base.php
index 86620ff..ae87b34 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -766,13 +766,15 @@ class OC {
* register hooks for previews
*/
public static function registerPreviewHooks() {
- OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write');
- OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files');
- OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete');
- OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete');
- OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files');
- OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete');
- OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete');
+ if (\OC::$server->getSystemConfig()->getValue('enable_previews', false)) {
+ OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write');
+ OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files');
+ OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete');
+ OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete');
+ OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files');
+ OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete');
+ OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete');
+ }
}
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list