branch develop updated (6397169 -> 131ebac)
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 6397169 some version upgrade new 131ebac can put a simple login instead of mail for user internal-test #6307 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 131ebac36af56202ab1564cf5228de733efbceb7 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Feb 13 17:29:01 2015 +0100 can put a simple login instead of mail for user internal-test #6307 Summary of changes: .../coselmar/services/v1/UsersWebService.java | 5 +++-- coselmar-ui/src/main/webapp/i18n/en.js | 3 +++ coselmar-ui/src/main/webapp/i18n/fr.js | 3 +++ .../src/main/webapp/views/users/edituser.html | 20 +++++++++++++++----- 4 files changed, 24 insertions(+), 7 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 131ebac36af56202ab1564cf5228de733efbceb7 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Feb 13 17:29:01 2015 +0100 can put a simple login instead of mail for user internal-test #6307 --- .../coselmar/services/v1/UsersWebService.java | 5 +++-- coselmar-ui/src/main/webapp/i18n/en.js | 3 +++ coselmar-ui/src/main/webapp/i18n/fr.js | 3 +++ .../src/main/webapp/views/users/edituser.html | 20 +++++++++++++++----- 4 files changed, 24 insertions(+), 7 deletions(-) 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 aa02c66..afaf5cc 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 @@ -62,6 +62,7 @@ import org.apache.commons.mail.EmailException; import org.apache.commons.mail.SimpleEmail; import org.debux.webmotion.server.render.Render; import org.nuiton.topia.persistence.TopiaNoResultException; +import org.nuiton.util.StringUtil; import static org.apache.commons.logging.LogFactory.getLog; @@ -247,7 +248,7 @@ public class UsersWebService extends CoselmarWebServiceSupport { commit(); // send mail to user with password - if (StringUtils.isNotBlank(mail)) { + if (StringUtils.isNotBlank(mail) && StringUtil.isEmail(mail)) { UserAccountCreatedMail userAccountCreatedMail = new UserAccountCreatedMail(getServicesContext().getLocale()); userAccountCreatedMail.setUser(user); userAccountCreatedMail.setPassword(password); @@ -349,7 +350,7 @@ public class UsersWebService extends CoselmarWebServiceSupport { coselmarUser.setPassword(encodedPassword); //if it is a modification by Admin, send new mail to user - if (isAdmin || isSupervisor4Client) { + if ( (isAdmin || isSupervisor4Client) && StringUtil.isEmail(coselmarUser.getMail())) { UserPasswordChangedMail userPasswordChangedMail = new UserPasswordChangedMail(getServicesContext().getLocale()); userPasswordChangedMail.setUser(user); userPasswordChangedMail.setPassword(newPassword); diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index ca4cc92..f5f301f 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -186,6 +186,7 @@ var translateEN = { "user.metadata.name" : "Name", "user.metadata.firstName" : "First name", "user.metadata.mail" : "Contact", +"user.metadata.mail.login" : "Login", "user.metadata.phone" : "Phone number", "user.metadata.qualification" : "Qualification", "user.metadata.organization" : "Organization", @@ -218,6 +219,8 @@ var translateEN = { "user.message.enterMail" : "Please enter your email", "user.message.unknownMail" : "This email does not exist.", "user.message.newPasswordSent" : "A new password has been sent.", +"user.message.wannaSimpleLogin" : "Use simple login, not a mail (Warning : no password could be sent)", +"user.message.invalidLogin" : "Login is mandatory.", "user.button.add" : "Add an user", "user.button.add.client" : "Add a client", diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index 34f92d9..8796029 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -186,6 +186,7 @@ var translateFR = { "user.metadata.name" : "Nom", "user.metadata.firstName" : "Prénom", "user.metadata.mail" : "Contact", +"user.metadata.mail.login" : "Identifiant", "user.metadata.phone" : "Numéro de téléphone", "user.metadata.qualification" : "Profession", "user.metadata.organization" : "Organisation", @@ -218,6 +219,8 @@ var translateFR = { "user.message.enterMail" : "Veuillez entrer votre courriel", "user.message.unknownMail" : "Ce courriel est inconnu.", "user.message.newPasswordSent" : "Un nouveau mot de passe a été envoyé.", +"user.message.wannaSimpleLogin" : "Utiliser un simple identifiant et non un courriel (Attention : aucun mot de passe ne pourra être envoyé.)", +"user.message.invalidLogin" : "L'identifiant est obligatoire.", "user.button.add" : "Ajouter un utilisateur", "user.button.add.client" : "Ajouter un client", diff --git a/coselmar-ui/src/main/webapp/views/users/edituser.html b/coselmar-ui/src/main/webapp/views/users/edituser.html index dd0bb34..a768748 100644 --- a/coselmar-ui/src/main/webapp/views/users/edituser.html +++ b/coselmar-ui/src/main/webapp/views/users/edituser.html @@ -80,13 +80,23 @@ </div> <div class="form-group" ng-class="{'has-error' : userForm.mail.$invalid && !userForm.mail.$pristine}"> - <label class="col-md-4 control-label">{{ 'user.metadata.mail' | translate }} *</label> + <label class="col-md-4 control-label" ng-if="!simpleLogin">{{ 'user.metadata.mail' | translate }} *</label> + <label class="col-md-4 control-label" ng-if="simpleLogin">{{ 'user.metadata.mail.login' | translate }} *</label> <div class="col-md-5"> - <input type="email" class="form-control" name="mail" - placeholder="example@provider.mail" - ng-model="user.mail" required/> - <p ng-show="userForm.mail.$invalid && !userForm.mail.$pristine" class="help-block">{{ 'user.message.invalidMail' | translate }}</p> + <input type="email" class="form-control" name="mail" ng-model="user.mail" + placeholder="example@provider.mail" required + ng-if="!simpleLogin" /> + + <input type="text" class="form-control" name="mail" ng-model="user.mail" + placeholder="login" required + ng-if="simpleLogin" /> + + <p ng-show="currentUser && (currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR') && currentUser.userId != user.id"> + <input type="checkbox" ng-model="simpleLogin">{{ 'user.message.wannaSimpleLogin' | translate }} + </p> + <p ng-show="userForm.mail.$invalid && !userForm.mail.$pristine" class="help-block" ng-if="!simpleLogin">{{ 'user.message.invalidMail' | translate }}</p> + <p ng-show="userForm.mail.$invalid && !userForm.mail.$pristine" class="help-block" ng-if="simpleLogin">{{ 'user.message.invalidLogin' | translate }}</p> </div> </div> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm