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-22 17:32:40 +0200
commit4f5ff9c105360335d525ac2bf887bdd7ba4fe03a (patch)
tree7f54572f79ce47079ccb2bd8856b3ef9976c582b /core/js
parentdc32bf459446bdbce327dcf7bb9e07ca0a7a2bf4 (diff)
downloadnextcloud-server-4f5ff9c105360335d525ac2bf887bdd7ba4fe03a.tar.gz
nextcloud-server-4f5ff9c105360335d525ac2bf887bdd7ba4fe03a.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) {