Reset default password of an user in UserUpdateCtrl. (Fixes #412)
This commit is contained in:
parent
07bd763a63
commit
e9cf2fb591
@ -388,10 +388,11 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
.controller('UserUpdateCtrl', [
|
.controller('UserUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
'$state',
|
||||||
|
'$http',
|
||||||
'User',
|
'User',
|
||||||
'user',
|
'user',
|
||||||
'Group',
|
'Group',
|
||||||
function($scope, $state, User, user, Group) {
|
function($scope, $state, $http, User, user, Group) {
|
||||||
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
||||||
$scope.user = user; // autoupdate is not activated
|
$scope.user = user; // autoupdate is not activated
|
||||||
$scope.save = function (user) {
|
$scope.save = function (user) {
|
||||||
@ -404,6 +405,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="form-group row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="inputDefaultPassword" translate>Default password</label>
|
<label for="inputDefaultPassword" translate>Default password</label>
|
||||||
<input type="text" ng-model="user.default_password" class="form-control" name="inputDefaultPassword">
|
<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>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
Loading…
Reference in New Issue
Block a user