summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-09 16:33:26 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-06-10 15:00:30 +0200
commit7ca01a65dd353a06533af7bf0e8fabaa7cdbd960 (patch)
tree27bc02fa34561785455b58e4a61effb51efac12d
parent429fb8738641bd090bcc49923c5391e8bc3dcb45 (diff)
downloadnextcloud-server-7ca01a65dd353a06533af7bf0e8fabaa7cdbd960.tar.gz
nextcloud-server-7ca01a65dd353a06533af7bf0e8fabaa7cdbd960.zip
Disable video preview if previews are disabled
-rw-r--r--apps/files_sharing/public.php1
-rw-r--r--apps/files_sharing/templates/public.php2
2 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 1145b2ce2a9..9f4efa6d54b 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -136,6 +136,7 @@ if (isset($path)) {
$tmpl->assign('sharingToken', $token);
$tmpl->assign('server2serversharing', Helper::isOutgoingServer2serverShareEnabled());
$tmpl->assign('protected', isset($linkItem['share_with']) ? 'true' : 'false');
+ $tmpl->assign('previewEnabled', \OC::$server->getConfig()->getSystemValue('enable_previews', true));
$urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
.(isset($_GET['dir'])?'&dir='.$_GET['dir']:'')
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 46bf90b1b41..d4bb255f24e 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -54,7 +54,7 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
<?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']); ?>" />