[Pkg-owncloud-commits] [owncloud] 355/457: Disable video preview if previews are disabled

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:42 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 7550bf09171a451584a628188db98057c0b30cad
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Tue Jun 9 16:33:26 2015 +0200

    Disable video preview if previews are disabled
---
 apps/files_sharing/lib/controllers/sharecontroller.php  | 1 +
 apps/files_sharing/templates/public.php                 | 2 +-
 apps/files_sharing/tests/controller/sharecontroller.php | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index da6667e..ecf3ee8 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -214,6 +214,7 @@ class ShareController extends Controller {
 
 		$shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', array('token' => $token));
 		$shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10);
+		$shareTmpl['previewEnabled'] = $this->config->getSystemValue('enable_previews', true);
 
 		$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
 		$csp->addAllowedFrameDomain('\'self\'');
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 5a01197..dd0b2ee 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -89,7 +89,7 @@ $thumbSize = 1024;
 		<?php if (isset($_['folder'])): ?>
 			<?php print_unescaped($_['folder']); ?>
 		<?php else: ?>
-			<?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
+			<?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
 				<div id="imgframe">
 					<video tabindex="0" controls="" preload="none">
 						<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php
index eaa7ce7..8a075ee 100644
--- a/apps/files_sharing/tests/controller/sharecontroller.php
+++ b/apps/files_sharing/tests/controller/sharecontroller.php
@@ -178,6 +178,7 @@ class ShareControllerTest extends \Test\TestCase {
 			'nonHumanFileSize' => 33,
 			'maxSizeAnimateGif' => 10,
 			'previewSupported' => true,
+			'previewEnabled' => true,
 		);
 
 		$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();

-- 
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