branch develop updated (c489e6a -> 7c43e75)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from c489e6a fixes #6308 : Merge branch 'feature/6308-supervisor-can-create-client' into develop new d97bdc2 fix user edit permission in service to be get own profile as supervisor new 568dce2 add second new password input to avoid bad write in password new 7c43e75 fixes #6440 Merge branch 'feature/6440-add-second-input-for-password-change' into develop The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 7c43e757dacc6707bb35b81790e6fe8e66d8ed39 Merge: c489e6a 568dce2 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:52:44 2015 +0100 fixes #6440 Merge branch 'feature/6440-add-second-input-for-password-change' into develop commit 568dce29ae463f486bfb439670b71d04e8ec751d Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:52:34 2015 +0100 add second new password input to avoid bad write in password commit d97bdc2faf6c2436c973846d9817d014e1c04010 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:50:58 2015 +0100 fix user edit permission in service to be get own profile as supervisor Summary of changes: .../coselmar/services/v1/UsersWebService.java | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 27 +++++++++++++++-- .../src/main/webapp/views/users/edituser.html | 35 ++++++++++++++++++---- 3 files changed, 55 insertions(+), 9 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit d97bdc2faf6c2436c973846d9817d014e1c04010 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:50:58 2015 +0100 fix user edit permission in service to be get own profile as supervisor --- .../src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java index 77c55b1..2038d3d 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java @@ -93,7 +93,7 @@ public class UsersWebService extends CoselmarWebServiceSupport { CoselmarUser user = getCoselmarUserDao().forTopiaIdEquals(fullId).findUnique(); - if (isSupervisor && user.getRole() != CoselmarUserRole.CLIENT) { + if (isSupervisor && user.getRole() != CoselmarUserRole.CLIENT && !isHimself) { if (log.isDebugEnabled()) { String message = String.format("A supervisor user try to see non client account details with shortId '%s'", userId); log.debug(message); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 568dce29ae463f486bfb439670b71d04e8ec751d Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:52:34 2015 +0100 add second new password input to avoid bad write in password --- .../src/main/webapp/js/coselmar-controllers.js | 27 +++++++++++++++-- .../src/main/webapp/views/users/edituser.html | 35 ++++++++++++++++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 5d40401..e1eadae 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -310,13 +310,14 @@ coselmarControllers.controller("NewUserCtrl", ['$scope', '$route', '$location', }; }]); -// Controller for single document View +// Controller for single User View & Edit coselmarControllers.controller("UserViewCtrl", ['$scope', '$route', '$location', 'userService', '$routeParams', function($scope, $route, $location, userService, $routeParams) { $scope.editMode = $routeParams.edit; if ($scope.editMode) { $scope.editPassword = true; + $scope.messages = []; } userService.getUser($routeParams.userId, $scope); @@ -362,8 +363,12 @@ coselmarControllers.controller("UserViewCtrl", if(isValidForm) { userService.saveUser($scope.user, function() { - // On success, back on users list - $location.path("/users"); + // On success, back on users list for admin or supervisor + if ($scope.currentUser.role == 'ADMIN' || $scope.currentUser.role == 'SUPERVISOR') { + $location.path("/users"); + } else { + $location.search(""); + } },function(error) { //TODO ymartel 20141118 : deal with error.status or statusText @@ -375,6 +380,22 @@ coselmarControllers.controller("UserViewCtrl", } ]); +// This directive checks two inputs have identical values. +// This is used for new password check +coselmarControllers.directive('identicalCheck', [function () { + return { + require: 'ngModel', + link: function (scope, elem, attrs, ctrl) { + var firstWord = '#' + attrs.identicalCheck; + elem.add(firstWord).on('keyup', function () { + scope.$apply(function () { + var areMatching = elem.val()===$(firstWord).val(); + ctrl.$setValidity('identicalmatch', areMatching); + }); + }); + } + } +}]); ///////////////////////////////////////////////// //////////// Questions Part /////////////////// diff --git a/coselmar-ui/src/main/webapp/views/users/edituser.html b/coselmar-ui/src/main/webapp/views/users/edituser.html index 0c9f91e..b58bb40 100644 --- a/coselmar-ui/src/main/webapp/views/users/edituser.html +++ b/coselmar-ui/src/main/webapp/views/users/edituser.html @@ -21,7 +21,13 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> - <div class="" ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR'"> + <div class="" ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR' || currentUser.userId == user.id"> + + <div ng-if="messages"> + <p ng-repeat="message in messages" class="block"> + {{message}} + </p> + </div> <form name="userForm" class="form-horizontal" role="form" ng-submit="saveUser(userForm.$valid)"> @@ -62,7 +68,7 @@ </div> - <div class="form-group" ng-if="currentUser.role == 'SUPERVISOR'"> + <div class="form-group" ng-if="currentUser.role == 'SUPERVISOR' && currentUser.id != user.userId"> <label class="col-md-4 control-label">Role *</label> <div class="col-md-5"> @@ -133,16 +139,35 @@ </div> - <div class="form-group" ng-if="editPassword"> + <div class="form-group" ng-if="editPassword" + ng-class="{'has-error' : (userForm.newPassword.$invalid + && !userForm.newPassword.$pristine ) + || userForm.confirmNewPassword.$error.identicalmatch }"> + <label class="col-md-4 control-label">New Password</label> <div class="col-md-5"> <input type="password" class="form-control" name="newPassword" - ng-model="user.newPassword" ng-minlength="6" placeholder="new password"/> + id="newPassword" placeholder="new password" + ng-model="user.newPassword" ng-minlength="6" /> + + <input type="password" class="form-control" name="confirmNewPassword" + id="confirmPassword" placeholder="confirm password" + ng-model="confirmNewPassword" ng-minlength="6" + identical-check="newPassword" + ng-class="{'has-error' : userForm.confirmNewPassword.$error.identicalmatch }"/> + + <p ng-show="userForm.newPassword.$invalid && !userForm.newPassword.$pristine" class="help-block"> + New password should contain at least 6 characters. + {{userForm.newPassword.$error}} + </p> + <p ng-show="userForm.confirmNewPassword.$error.identicalmatch" class="help-block"> + The two new passwords don't match. + </p> </div> - </div> + <div class="form-group" ng-if="userForm.$valid || currentUser.role == 'ADMIN'"> <div class="float-right col-md-4"> <input type="submit" value="Validate" class="btn btn-primary"/> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 7c43e757dacc6707bb35b81790e6fe8e66d8ed39 Merge: c489e6a 568dce2 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jan 20 17:52:44 2015 +0100 fixes #6440 Merge branch 'feature/6440-add-second-input-for-password-change' into develop .../coselmar/services/v1/UsersWebService.java | 2 +- .../src/main/webapp/js/coselmar-controllers.js | 27 +++++++++++++++-- .../src/main/webapp/views/users/edituser.html | 35 ++++++++++++++++++---- 3 files changed, 55 insertions(+), 9 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm