Merge pull request #5441 from owncloud/files-sharewithlinkasnormaluserfix

Fixed share with link checkbox missing as regular user
This commit is contained in:
Vincent Petry 2013-10-21 11:46:01 -07:00
commit bd7cf436c6
3 changed files with 4 additions and 12 deletions

View File

@ -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);

View File

@ -114,3 +114,5 @@
<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />

View File

@ -203,18 +203,7 @@ OC.Share={
html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';
html += '<ul id="shareWithList">';
html += '</ul>';
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 += '<div id="link">';
html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share with link')+'</label>';