Merge pull request #1690 from emanuelschuetze/rest-password
Reset default password of an user in UserUpdateCtrl. (Fixes #412)
This commit is contained in:
commit
02a67097e4
@ -390,10 +390,11 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
||||
.controller('UserUpdateCtrl', [
|
||||
'$scope',
|
||||
'$state',
|
||||
'$http',
|
||||
'User',
|
||||
'user',
|
||||
'Group',
|
||||
function($scope, $state, User, user, Group) {
|
||||
function($scope, $state, $http, User, user, Group) {
|
||||
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
||||
$scope.user = user; // autoupdate is not activated
|
||||
$scope.save = function (user) {
|
||||
@ -406,6 +407,17 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
||||
}
|
||||
);
|
||||
};
|
||||
$scope.reset_password = function (user) {
|
||||
$http.post('/rest/users/user/2/reset_password/', {})
|
||||
.then(
|
||||
function(data) {
|
||||
// TODO: Success message
|
||||
},
|
||||
function(data) {
|
||||
// TODO: error message
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
|
@ -44,7 +44,15 @@
|
||||
<div class="form-group row">
|
||||
<div class="col-xs-6">
|
||||
<label for="inputDefaultPassword" translate>Default password</label>
|
||||
<div class="input-group">
|
||||
<input type="text" ng-model="user.default_password" class="form-control" name="inputDefaultPassword">
|
||||
<span class="input-group-btn">
|
||||
<button ng-click="reset_password(user)" class="btn btn-default">
|
||||
<i class="fa fa-undo"></i>
|
||||
<translate>Reset</translate>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
Loading…
Reference in New Issue
Block a user