6 Replies Latest reply on Mar 1, 2012 3:54 AM by Bruno Felix

    Login page customization - add new fields

    Bruno Felix Newbie

      Hello,

       

      I'd like to modify/override the login.jsp page when the first login of an user occurs to force him to change his password.  I've already modified the login.jsp page in my portal extension to show the "new password" and "confirm password" field when needed.

      But, as far as I understand, the login servlet has only 4 parameters (username, password, initialuri, rememberme).

      So, when if I define my login form like this:

      <form action="<%= contextPath + "/login"%>" method="post" style="margin: 0px;">
                      <% if (uri != null) { %>
                          <input type="hidden" name="initialURI" value="<%=uri%>"/>
                      <% } %>
                          <table>
       <tr class="FieldContainer">
       <td class="FieldLabel"><%=res.getString("UILoginForm.label.UserName")%></td>
       <td><input class="UserName" name="username" value="<%=username%>"/></td>
       </tr>
       <tr class="FieldContainer" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event);">
       <td class="FieldLabel"><%=res.getString("UILoginForm.label.password")%></td>
       <td><input class="Password" type="password" name="password" value=""/></td>
       </tr>
       <%
       if (changePwd) {
       %>
       <tr class="FieldContainer" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event);">
       <td class="FieldLabel"><%=res.getString("UILoginForm.label.newpassword")%></td>
       <td><input class="Password" type="password" name="newpassword" value=""/></td>
       </tr>
       <tr class="FieldContainer" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event);">
       <td class="FieldLabel"><%=res.getString("UILoginForm.label.confpassword")%></td>
       <td><input class="Password" type="password" name="confpassword" value=""/></td>
       </tr>
       <%
       }
       %>
       </table>
      

       

      I won't be able to get the new password and confirmed password like this:

      request.getParameter("newpassword")

       

      So, how can I retrieve my confpassword and newpassword?  Do I have to write a new servlet to be able to do this?

       

      Thanks for viewing.