diff --git a/apps/files/index.php b/apps/files/index.php index 8d877be8ac..2f1e084560 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -138,6 +138,7 @@ if ($needUpgrade) { $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); $tmpl->assign("mailNotificationEnabled", \OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'yes')); + $tmpl->assign("allowShareWithLink", \OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes')); $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); $tmpl->assign('disableSharing', false); $tmpl->assign('ajaxLoad', $ajaxLoad); diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 32a59f1e1a..001adb77ab 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -114,3 +114,5 @@ + + diff --git a/core/js/share.js b/core/js/share.js index 6ec15f01c1..9c606b9de6 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -203,18 +203,7 @@ OC.Share={ html += ''; html += ''; - 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; - } - } - }); + var linksAllowed = $('#allowShareWithLink').val() === 'yes'; if (link && linksAllowed) { html += '