fixes #4026
This commit is contained in:
parent
88e1ccbce3
commit
17c36b5074
|
@ -593,7 +593,6 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// Update the share information
|
// Update the share information
|
||||||
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions, function(data) {
|
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions, function(data) {
|
||||||
return;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -609,13 +608,26 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('focusout keyup', '#dropdown #linkPassText', function(event) {
|
$(document).on('focusout keyup', '#dropdown #linkPassText', function(event) {
|
||||||
if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) {
|
var linkPassText = $('#linkPassText');
|
||||||
var itemType = $('#dropdown').data('item-type');
|
if ( linkPassText.val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) {
|
||||||
var itemSource = $('#dropdown').data('item-source');
|
|
||||||
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $('#linkPassText').val(), OC.PERMISSION_READ, function() {
|
var allowPublicUpload = $('#sharingDialogAllowPublicUpload').is(':checked');
|
||||||
console.log("password set to: '" + $('#linkPassText').val() +"' by event: " + event.type);
|
var dropDown = $('#dropdown');
|
||||||
$('#linkPassText').val('');
|
var itemType = dropDown.data('item-type');
|
||||||
$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
|
var itemSource = dropDown.data('item-source');
|
||||||
|
var permissions = 0;
|
||||||
|
|
||||||
|
// Calculate permissions
|
||||||
|
if (allowPublicUpload) {
|
||||||
|
permissions = OC.PERMISSION_UPDATE + OC.PERMISSION_CREATE + OC.PERMISSION_READ;
|
||||||
|
} else {
|
||||||
|
permissions = OC.PERMISSION_READ;
|
||||||
|
}
|
||||||
|
|
||||||
|
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $('#linkPassText').val(), permissions, function() {
|
||||||
|
console.log("password set to: '" + linkPassText.val() +"' by event: " + event.type);
|
||||||
|
linkPassText.val('');
|
||||||
|
linkPassText.attr('placeholder', t('core', 'Password protected'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -454,6 +454,9 @@ class Share {
|
||||||
$forcePortable = (CRYPT_BLOWFISH != 1);
|
$forcePortable = (CRYPT_BLOWFISH != 1);
|
||||||
$hasher = new \PasswordHash(8, $forcePortable);
|
$hasher = new \PasswordHash(8, $forcePortable);
|
||||||
$shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', ''));
|
$shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', ''));
|
||||||
|
} else {
|
||||||
|
// reuse the already set password
|
||||||
|
$shareWith = $checkExists['share_with'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate token
|
// Generate token
|
||||||
|
|
Loading…
Reference in New Issue