From e9cf2fb591843fe0d50ba3af84d9bd47f7b9594d Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 18 Nov 2015 09:50:49 +0100 Subject: [PATCH] Reset default password of an user in UserUpdateCtrl. (Fixes #412) --- openslides/users/static/js/users/site.js | 14 +++++++++++++- .../users/static/templates/users/user-form.html | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index c0839e078..138af7742 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -388,10 +388,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) { @@ -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 + } + ); + } } ]) diff --git a/openslides/users/static/templates/users/user-form.html b/openslides/users/static/templates/users/user-form.html index c7133a86f..040663187 100644 --- a/openslides/users/static/templates/users/user-form.html +++ b/openslides/users/static/templates/users/user-form.html @@ -44,7 +44,15 @@
- +
+ + + + +