Browse Source

UI-2332: admins can now send reset password messages to their users

4.3
Jean-Roch Maitre 9 years ago
parent
commit
70408a6632
3 changed files with 44 additions and 2 deletions
  1. +9
    -2
      i18n/en-US.json
  2. +32
    -0
      submodules/users/users.js
  3. +3
    -0
      views/users-changePassword.html

+ 9
- 2
i18n/en-US.json View File

@ -421,7 +421,11 @@
"password": "Password",
"passwordPlaceholder": "Password (Min. 6 characters)",
"title": "Update Email and password",
"username": "User's Email address"
"username": "User's Email address",
"resetPassword": {
"linkTitle": "here",
"text": "If you want the system to send an e-mail to this user with instructions on how to reset his password, click "
}
},
"dialogChangePin": {
"help": "You can use this popup to set a temporary PIN for a user that lost his PIN for example.",
@ -519,7 +523,10 @@
"pinUpdated": "You successfully updated the PIN of {{ name }}.",
"__comment": "UI-1033: Now properly remove the Caller-ID Feature if we remove a number that was set as that Caller-ID Number",
"__version": "3.20",
"callerIDDeleted": "The Caller-ID Number of this user was set to a number that was no longer assigned to him, so we disabled the Caller-ID Feature."
"callerIDDeleted": "The Caller-ID Number of this user was set to a number that was no longer assigned to him, so we disabled the Caller-ID Feature.",
"__comment": ": Now offer admin the option to send an email to reset the password of a user",
"__version": "4.0",
"successResetPassword": "Success! {{ name }} will be receiving an e-mail with instructions on how to reset his password shortly."
},
"uploadPicture": "Upload a Picture",
"user": "User",


+ 32
- 0
submodules/users/users.js View File

@ -908,6 +908,19 @@ define(function(require){
}
});
passwordTemplate.find('.reset-password').on('click', function() {
var dataReset = {
username: currentUser.username,
account_name: monster.apps.auth.currentAccount.name
};
self.usersResetPassword(dataReset, function() {
popup.dialog('close').remove();
toastr.success(monster.template(self, '!' + toastrMessages.successResetPassword, { name: dataReset.username }));
});
});
passwordTemplate.find('.save-new-username').on('click', function() {
var formData = monster.ui.getFormData('form_new_username'),
userToSave = $.extend(true, {}, currentUser, formData);
@ -4468,6 +4481,25 @@ define(function(require){
usersRemoveOverlay: function() {
$('body').find('#users_container_overlay').remove();
},
usersResetPassword: function(data, callback) {
var self = this,
dataPassword = {
username: data.username,
account_name: data.account_name,
ui_url: window.location.href.split('#')[0]
};
self.callApi({
resource: 'auth.recovery',
data: {
data: dataPassword
},
success: function(data) {
callback && callback(data.data);
}
});
}
};


+ 3
- 0
views/users-changePassword.html View File

@ -16,6 +16,9 @@
</form>
{{#monsterText}}
{{i18n.users.dialogChangePassword.help}}
<br/><br/>
{{i18n.users.dialogChangePassword.resetPassword.text}}
<a class="monster-link blue reset-password" href="javascript:void(0)">{{i18n.users.dialogChangePassword.resetPassword.linkTitle}}</a>.
{{/monsterText}}
</div>


Loading…
Cancel
Save