From 274bf3c6bdb4dc1ccf4f88d485b5bffe85d8a8ea Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <mtgap@owncloud.com>
Date: Wed, 1 May 2013 20:39:02 -0400
Subject: [PATCH] Don't display shared links if disabled

---
 apps/files_sharing/public.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index c8aca498f8..2b283375a6 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -3,6 +3,13 @@ $RUNTIME_NOSETUPFS = true;
 // Load other apps for file previews
 OC_App::loadApps();
 
+if (\OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
+	header('HTTP/1.0 404 Not Found');
+	$tmpl = new OCP\Template('', '404', 'guest');
+	$tmpl->printPage();
+	exit();
+}
+
 function fileCmp($a, $b) {
 	if ($a['type'] == 'dir' and $b['type'] != 'dir') {
 		return -1;
-- 
GitLab