mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 07:07:57 +01:00
Closes #164: admin can send a password reset email to users
This commit is contained in:
parent
b2d9684738
commit
7fc50f2629
@ -64,7 +64,7 @@ angular.module('docs').controller('SettingsUserEdit', function($scope, $dialog,
|
||||
];
|
||||
|
||||
$dialog.messageBox(title, msg, btns, function (result) {
|
||||
if (result == 'ok') {
|
||||
if (result === 'ok') {
|
||||
Restangular.one('user', $stateParams.username).remove().then(function () {
|
||||
$scope.loadUsers();
|
||||
$state.go('settings.user');
|
||||
@ -75,4 +75,14 @@ angular.module('docs').controller('SettingsUserEdit', function($scope, $dialog,
|
||||
});
|
||||
};
|
||||
|
||||
$scope.passwordReset = function () {
|
||||
Restangular.one('user').post('password_lost', {
|
||||
username: $stateParams.username
|
||||
}).then(function () {
|
||||
var title = $translate.instant('settings.user.edit.password_lost_sent_title');
|
||||
var msg = $translate.instant('settings.user.edit.password_lost_sent_message', { username: $stateParams.username });
|
||||
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
|
||||
$dialog.messageBox(title, msg, btns);
|
||||
});
|
||||
};
|
||||
});
|
@ -249,7 +249,10 @@
|
||||
"storage_quota_placeholder": "Storage quota (in MB)",
|
||||
"password": "Password",
|
||||
"password_confirm": "Password (confirm)",
|
||||
"disabled": "Disabled user"
|
||||
"disabled": "Disabled user",
|
||||
"password_reset_btn": "Send a password reset email to this user",
|
||||
"password_lost_sent_title": "Password reset email sent",
|
||||
"password_lost_sent_message": "A password reset email has been sent to <strong>{{ username }}</strong> for a password reset"
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
|
@ -109,5 +109,13 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="button" class="btn btn-warning" ng-click="passwordReset()" ng-show="user.username != 'guest'">
|
||||
<span class="glyphicon glyphicon-repeat"></span> {{ 'settings.user.edit.password_reset_btn' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user