Author: bleny Date: 2014-04-11 11:36:02 +0200 (Fri, 11 Apr 2014) New Revision: 1880 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1880 Log: fixes #4496 prevent user need to double input credentials Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/LoginAction.java trunk/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp trunk/wao-web/src/main/webapp/wao.css Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/LoginAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/LoginAction.java 2014-04-11 09:00:25 UTC (rev 1879) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/LoginAction.java 2014-04-11 09:36:02 UTC (rev 1880) @@ -48,6 +48,8 @@ protected transient WaoUsersService service; + protected boolean credentialsAsked = true; + protected String login; protected String password; @@ -93,6 +95,8 @@ waoUser = service.authenticate(login, password); + credentialsAsked = false; + if (cguAccepted) { service.acceptCgu(waoUser); } @@ -177,4 +181,8 @@ public Map<String, String> getUserProfiles() { return userProfiles; } + + public boolean isCredentialsAsked() { + return credentialsAsked; + } } Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp 2014-04-11 09:00:25 UTC (rev 1879) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp 2014-04-11 09:36:02 UTC (rev 1880) @@ -38,12 +38,23 @@ <fieldset> - <s:textfield name="login" - label="%{getText('wao.ui.field.WaoUser.login')}" /> + <s:if test="credentialsAsked"> - <s:password name="password" - label="%{getText('wao.ui.field.WaoUser.password')}" /> + <s:textfield name="login" + label="%{getText('wao.ui.field.WaoUser.login')}"/> + <s:password name="password" + label="%{getText('wao.ui.field.WaoUser.password')}"/> + + </s:if> + <s:else> + + <s:hidden name="login" label="%{login}"/> + + <s:hidden name="password" value="%{password}"/> + + </s:else> + <s:if test="userProfileAsked"> <s:radio name="userProfileId" list="userProfiles" label="%{getText('wao.ui.form.authentication.chooseUserProfile')}" /> @@ -58,10 +69,17 @@ </fieldset> - <s:submit type="button" cssClass="btn btn-primary"> - <s:text name="wao.ui.form.authentication.action.submit" /> - </s:submit> + <div class="form-actions"> + <s:submit type="button" cssClass="btn btn-primary"> + <s:text name="wao.ui.form.authentication.action.submit"/> + </s:submit> + <s:url namespace="/authentication" action="login!input" id="cancelUrl"/> + <s:a href="%{cancelUrl}" cssClass="btn"> + <s:text name="wao.ui.action.cancel"/> + </s:a> + </div> + </s:form> <s:if test="acceptCguAsked"> Modified: trunk/wao-web/src/main/webapp/wao.css =================================================================== --- trunk/wao-web/src/main/webapp/wao.css 2014-04-11 09:00:25 UTC (rev 1879) +++ trunk/wao-web/src/main/webapp/wao.css 2014-04-11 09:36:02 UTC (rev 1880) @@ -140,15 +140,20 @@ margin-top: 75px; } +form#login .form-actions, +form.filters-form .form-actions, +#boat-details .form-actions { + clear: both; + margin-top: 0px; + border: none; + background-color: inherit; +} + textarea { width: 100%; min-height: 150px; } -.form-actions button[type="submit"] { - float: right; -} - th.actions, td.actions { white-space: nowrap; } @@ -184,13 +189,6 @@ margin-right: 5px; } -form.filters-form .form-actions { - clear: both; - margin-top: 0px; - border: none; - background-color: white; -} - /****************************************************************************** * Styles spécifiques pour certaines pages de l'appli *****************************************************************************/ @@ -204,10 +202,6 @@ text-align: right; } -form#login button[type="submit"] { - margin-left: 180px; -} - #cgu { overflow-y: auto; max-height: 300px; @@ -304,9 +298,3 @@ /*max-width: 35%;*/ flex: 1; } - -#boat-details .form-actions { - margin-top: 15px; - border: none; - background-color: inherit; -}
participants (1)
-
bleny@users.forge.codelutin.com