diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-12-02 21:02:21 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-12-02 21:02:21 +0200 |
commit | fcf7c02c699ed0d55de63b00ae6968eefa3364f4 (patch) | |
tree | e320b2a79a1cfddb310b2c526302d81bddf171bc /client/components/settings/peopleBody.js | |
parent | 54036fd7a3ac9bf25b6c601890491af66571d5ff (diff) | |
parent | 3a391d5539aff500e4f6a438fd4c9bc4d19a1ec4 (diff) | |
download | wekan-fcf7c02c699ed0d55de63b00ae6968eefa3364f4.tar.gz wekan-fcf7c02c699ed0d55de63b00ae6968eefa3364f4.tar.bz2 wekan-fcf7c02c699ed0d55de63b00ae6968eefa3364f4.zip |
Merge branch 'thuanpq-allow-changing-user-password-in-admin-panel' into devel
Change password of any user in Standalone Wekan Admin Panel. Thanks to thuanpq !
Diffstat (limited to 'client/components/settings/peopleBody.js')
-rw-r--r-- | client/components/settings/peopleBody.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index d0da60d0..7cc992f2 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -87,24 +87,26 @@ Template.editUserPopup.events({ const user = Users.findOne(this.userId); const fullname = tpl.find('.js-profile-fullname').value.trim(); const username = tpl.find('.js-profile-username').value.trim(); - const initials = tpl.find('.js-profile-initials').value.trim(); + const password = tpl.find('.js-profile-password').value; const isAdmin = tpl.find('.js-profile-isadmin').value.trim(); const isActive = tpl.find('.js-profile-isactive').value.trim(); const email = tpl.find('.js-profile-email').value.trim(); - let isChangeUserName = false; - let isChangeEmail = false; + + const isChangePassword = password.length > 0; + const isChangeUserName = username !== user.username; + const isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); Users.update(this.userId, { $set: { 'profile.fullname': fullname, - 'profile.initials': initials, 'isAdmin': isAdmin === 'true', 'loginDisabled': isActive === 'true', }, }); - isChangeUserName = username !== user.username; - isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); + if(isChangePassword){ + Meteor.call('setPassword', password, this.userId); + } if (isChangeUserName && isChangeEmail) { Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), this.userId, function (error) { |