This is an automated email from the git hooks/post-receive script. New commit to branch feature/adminUser in repository pollen. See http://git.chorem.org/pollen.git commit d3d8c4b3c151d6a5b1439037734b7aa16ed03dad Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Jul 23 17:55:41 2014 +0200 admin can reset an user password --- pollen-ui-angular/src/main/webapp/i18n/en.js | 7 +++++-- pollen-ui-angular/src/main/webapp/i18n/fr.js | 3 +++ pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js | 10 ++++++++-- .../src/main/webapp/partials/user-admin-list.html | 7 ++++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 96817f0..75b5c53 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -39,6 +39,9 @@ var translateEN = { 'user.forgotPassword.success' : 'Password send by email', 'user.favoriteList' : 'Favorite list', 'user.disableMe' : 'Disable me', +'user.disableUser' : 'Disable user', +'user.generatePassword' : 'Generate new password', +'user.generatePassword.success' : 'E-mail send with new password', 'user.error.password.diff' : 'Passwords not equal', 'user.error.mail.notFound' : 'E-mail not found', 'user.error.mail.empty' : 'E-mail can not be empty', @@ -79,8 +82,8 @@ var translateEN = { 'poll.result.choice' : 'Choice', 'poll.result.score' : 'Score', 'poll.result.title.zero' : 'No result', -'poll.result.title.one' : 'Result : One voter', -'poll.result.title.other' : 'Result : {{nbVoter}} Voters', +'poll.result.title.one' : 'Result : One voter', +'poll.result.title.other' : 'Result : {{nbVoter}} Voters', 'poll.config.title.poll' : 'Global config', 'poll.config.title.choice' : 'Choice config', 'poll.config.title.vote' : 'Vote config', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index ad63d5e..d516eaa 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -39,6 +39,9 @@ var translateFR = { 'user.forgotPassword.success' : 'Un mail de changement de mot de passe vient d\'être envoyé..', 'user.favoriteList' : 'Liste de Diffusion Favorite', 'user.disableMe' : 'Désactiver mon compte', +'user.disableUser' : 'Désactiver l\'utilisateur', +'user.generatePassword' : 'Générer un nouveau mot de passe', +'user.generatePassword.success' : 'Un mail avec le nouveau mot de passe vient d\'être envoyé..', 'user.error.password.diff' : 'Mot de passe différent', 'user.error.mail.notFound' : 'Courriel n\'a pas été trouvé', 'user.error.mail.empty' : 'Courriel ne peux pas être vide', diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js index 56abe83..9f35596 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js @@ -133,8 +133,8 @@ angular.module('userControllers', []) } }]) -.controller('UserListCtrl', ['$scope', '$rootScope', '$routeParams', 'User', 'Page', - function ($scope, $rootScope, $routeParams, User, Page) { +.controller('UserListCtrl', ['$scope', '$rootScope', '$routeParams', 'User', 'UserLostPassword', 'Page', + function ($scope, $rootScope, $routeParams, User, UserLostPassword, Page) { Page.setTitle('title.user.list'); @@ -168,6 +168,12 @@ angular.module('userControllers', []) User.admin(user); }; + $scope.generatePassword = function (user) { + UserLostPassword.send({login: user.email}, function (data) { + $scope.$broadcast('newSuccess', 'user.generatePassword.success'); + }); + } + $scope.deleteUser = function (user) { User.remove({userId:user.id, anonymize:true}, function (data) { $rootScope.$broadcast('newSuccess', 'user.delete.success'); diff --git a/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html b/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html index e8014b3..dea16b2 100644 --- a/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html +++ b/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html @@ -43,9 +43,10 @@ <input type="checkbox" ng-model="user.administrator" /> </td> <td class="action"> - <button class="btn btn-primary" ng-click="saveUser(user)"> <span class="glyphicon glyphicon-save"></span> </button> - <button class="btn btn-warning" ng-click="banUser(user)" ng-disabled="user.isDisabled"> <span class="glyphicon glyphicon-ban-circle"></span> </button> - <button class="btn btn-danger" ng-click="deleteUser(user)"> <span class="glyphicon glyphicon-trash"></span> </button> + <button class="btn btn-primary" ng-click="saveUser(user)" title="{{ 'action.save' | translate}}"> <span class="glyphicon glyphicon-save"></span> </button> + <button class="btn btn-warning" ng-click="generatePassword(user)" title="{{ 'user.generatePassword' | translate}}"> <span class="glyphicon glyphicon-refresh"></span> </button> + <button class="btn btn-warning" ng-click="banUser(user)" ng-disabled="user.isDisabled" title="{{ 'user.disableUser' | translate}}"> <span class="glyphicon glyphicon-ban-circle"></span> </button> + <button class="btn btn-danger" ng-click="deleteUser(user)" title="{{ 'action.delete' | translate}}"> <span class="glyphicon glyphicon-trash"></span> </button> </td> </tr> <tr> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.