[pollen] branch develop updated (aa8e297 -> ec745a5)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See http://git.chorem.org/pollen.git from aa8e297 change cursor for input have selectOnClick and improve transition for comments page new ec745a5 refs #1075 add notification when email not validate The 1 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 ec745a54113f54595c258e443371157d7aa92e91 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 28 14:10:36 2014 +0200 refs #1075 add notification when email not validate Summary of changes: .../pollen/services/bean/PollenUserBean.java | 11 ++++++++++ pollen-ui-angular/src/main/webapp/i18n/en.js | 1 + pollen-ui-angular/src/main/webapp/i18n/fr.js | 1 + .../src/main/webapp/js/controllers/userCtrl.js | 24 +++++++++++++++++++--- 4 files changed, 34 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit ec745a54113f54595c258e443371157d7aa92e91 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 28 14:10:36 2014 +0200 refs #1075 add notification when email not validate --- .../pollen/services/bean/PollenUserBean.java | 11 ++++++++++ pollen-ui-angular/src/main/webapp/i18n/en.js | 1 + pollen-ui-angular/src/main/webapp/i18n/fr.js | 1 + .../src/main/webapp/js/controllers/userCtrl.js | 24 +++++++++++++++++++--- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenUserBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenUserBean.java index f156379..0a63778 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenUserBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollenUserBean.java @@ -44,6 +44,8 @@ public class PollenUserBean extends PollenBean<PollenUser> { protected boolean isDisabled; + protected boolean emailIsValidate; + public PollenUserBean() { super(PollenUser.class); } @@ -58,6 +60,7 @@ public class PollenUserBean extends PollenBean<PollenUser> { setLanguage(entity.getLanguage()); setEmail(entity.getEmail()); setPassword(entity.getPassword()); + setEmailIsValidate(entity.getEmailActivationToken() == null); } @@ -124,4 +127,12 @@ public class PollenUserBean extends PollenBean<PollenUser> { public void setDisabled(boolean isDisabled) { this.isDisabled = isDisabled; } + + public boolean isEmailIsValidate () { + return emailIsValidate; + } + + public void setEmailIsValidate (boolean emailIsValidate) { + this.emailIsValidate = emailIsValidate; + } } diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 0f5f5f2..10ffde2 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -71,6 +71,7 @@ var translateEN = { 'user.generatePassword.success' : 'E-mail send with new password', 'user.validate.success' : 'You just validate you email, you can login now', 'user.validate.error' : 'Email already validate or invalid', +'user.warning.emailNotValidate' : 'Your don\'t have validate your email', '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', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index 44fb6fa..0263961 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -71,6 +71,7 @@ var translateFR = { 'user.generatePassword.success' : 'Un mail avec le nouveau mot de passe vient d\'être envoyé..', 'user.validate.success' : 'Vous venez de valider votre courriel, connectez-vous dès maintenants.', 'user.validate.error' : 'Erreur lors de la validation, courriel déjà validé ou invalide', +'user.warning.emailNotValidate' : 'Vous n\'avez pas validé votre email', '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 144df17..146c079 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js @@ -76,12 +76,19 @@ angular.module('userControllers', []) } }]) -.controller('UserValidateCtrl', ['$scope', '$rootScope', '$routeParams', '$location', 'User', - function ($scope, $rootScope, $routeParams, $location, User) { +.controller('UserValidateCtrl', ['$scope', '$rootScope', '$routeParams', '$location', 'User', 'SessionStorage', + function ($scope, $rootScope, $routeParams, $location, User, SessionStorage) { + + var currentUser = SessionStorage.get().user; if (angular.isDefined($routeParams.userId) && angular.isDefined($routeParams.token)) { User.validate({userId: $routeParams.userId, token:$routeParams.token}, null, function() { $rootScope.$broadcast('newSuccess', 'user.validate.success'); + if (currentUser.id == $routeParams.userId) { + currentUser.emailIsValidate = true; + SessionStorage.save({user: currentUser}); + $rootScope.$broadcast('editUser'); + } $location.url('/'); }, function () { $rootScope.$broadcast('newError', 'user.validate.error'); @@ -212,7 +219,8 @@ angular.module('userControllers', []) }; }]) -.controller('UserLoginCtrl', ['$scope', 'UserLogin', 'UserLogout', 'User', 'SessionStorage', '$route', '$location', '$translate', function ($scope, UserLogin, UserLogout, User, SessionStorage, $route, $location, $translate) { +.controller('UserLoginCtrl', ['$scope', '$rootScope', 'UserLogin', 'UserLogout', 'User', 'SessionStorage', '$route', '$location', '$translate', '$timeout', + function ($scope, $rootScope, UserLogin, UserLogout, User, SessionStorage, $route, $location, $translate, $timeout) { if (angular.isUndefined($scope.data)) { $scope.data = {user:{}}; } @@ -227,6 +235,12 @@ angular.module('userControllers', []) $scope.currentUser = SessionStorage.get().user; + $timeout(function () { + if (angular.isDefined($scope.currentUser) && !$scope.currentUser.emailIsValidate) { + $rootScope.$broadcast('newWarning', 'user.warning.emailNotValidate', -1); + } + }); + $scope.login = function () { UserLogin.login({}, $scope.data.user, function (data) { SessionStorage.save({'token':data.permission}); @@ -234,6 +248,10 @@ angular.module('userControllers', []) $scope.currentUser = user; SessionStorage.save({'user':user}); + if (angular.isDefined($scope.currentUser) && !$scope.currentUser.emailIsValidate) { + $rootScope.$broadcast('newWarning', 'user.warning.emailNotValidate', -1); + } + delete $scope.data.user; // reload page for right user $route.reload(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm