From a2c80bbc687af788d8a5a3c520a24ac223ddc714 Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <mtgap@owncloud.com>
Date: Thu, 2 May 2013 11:45:12 -0400
Subject: [PATCH] Don't show links option in dropdown if disabled

---
 core/js/share.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/js/share.js b/core/js/share.js
index 270eab356e..734bbbfe0b 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -203,7 +203,12 @@ OC.Share={
 			html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';
 			html += '<ul id="shareWithList">';
 			html += '</ul>';
-			if (link) {
+			var linksAllowed = false;
+			$.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'appconfig.php'), data: { action:'getValue', app:'core', key:'shareapi_allow_links', defaultValue:'yes' }, async: false, success: function(result) {
+				if (result && result.status === 'success' && result.data === 'yes') {
+					linksAllowed = true;
+				}
+			}});
 				html += '<div id="link">';
 				html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share with link')+'</label>';
 				html += '<br />';
-- 
GitLab