summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-22 17:32:40 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-26 11:54:48 +0100
commit2a0460d88538854aad1d77a7b15007a53dfc0a30 (patch)
treeaa38149fc07812704ed2c07020b253c238a8fcdd /core/js
parent7d2bb6c0288ca3e0fbb0f021f48c758f383249c0 (diff)
downloadnextcloud-server-2a0460d88538854aad1d77a7b15007a53dfc0a30.tar.gz
nextcloud-server-2a0460d88538854aad1d77a7b15007a53dfc0a30.zip
Ensure the password is only hashed in case it's changed on the client - fixes #19950
Diffstat (limited to 'core/js')
-rw-r--r--core/js/shareitemmodel.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 1cf116f08f9..ae3cb0ce2e3 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -116,7 +116,8 @@
// TODO: use backbone's default value mechanism once this is a separate model
var requiredAttributes = [
- { name: 'password', defaultValue: '' },
+ { name: 'password', defaultValue: '' },
+ { name: 'passwordChanged', defaultValue: false },
{ name: 'permissions', defaultValue: OC.PERMISSION_READ },
{ name: 'expiration', defaultValue: this.configModel.getDefaultExpirationDateString() }
];
@@ -136,11 +137,16 @@
}
});
+ var password = {
+ password: attributes.password,
+ passwordChanged: attributes.passwordChanged
+ };
+
OC.Share.share(
itemType,
itemSource,
OC.Share.SHARE_TYPE_LINK,
- attributes.password,
+ password,
attributes.permissions,
this.fileInfoModel.get('name'),
attributes.expiration,
@@ -208,6 +214,7 @@
*/
setPassword: function(password) {
this.get('linkShare').password = password;
+ this.get('linkShare').passwordChanged = true;
},
addShare: function(attributes, options) {