Changeset 7500 for trunk/www/switch.jsp


Ignore:
Timestamp:
Aug 8, 2018, 12:57:12 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2124: Add support for a third field in the login form

Added an extra field getExtraField() to the LoginFormAction interface. A default implementation should provide backwards compatibility to existing implementations.

The login forms have been updated to display the extra field if it is present. The entered value is added to the LoginRequest as an attribute with name extraValue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/switch.jsp

    r7408 r7500  
    8080  FieldInfo loginField = loginAction.getLoginField();
    8181  FieldInfo passwordField = loginAction.getPasswordField();
     82  FieldInfo extraField = loginAction.getExtraField();
    8283  %>
    8384  <base:page type="popup" title="Switch user">
     
    122123        </td>
    123124      </tr>
     125      <%
     126      if (extraField != null)
     127      {
     128        %>
     129        <tr <%=valueIfNotNull("class=\"", extraField.getClazz(), "\"")%> id="extra-row">
     130          <th><%=extraField.getPrompt() %></th>
     131          <td><input class="text" name="extraField" id="extraField"
     132            type="<%=extraField.hasHiddenCharacters() ? "password" : "text"%>"
     133            <%=valueIfNotNull("style=\"", extraField.getStyle(), "\"") %>
     134            <%=valueIfNotNull("title=\"", extraField.getTooltip(), "\"") %>
     135            <%=valueIfNotNull("placeholder=\"", extraField.getPlaceHolder(), "\"") %>
     136            maxlength="80"
     137            tabindex="0">
     138          </td>
     139        </tr>
     140        <%
     141      }
     142      %>
    124143      <tr>
    125144        <th><label for="remainOnPage">Remain on this page</label></th>
Note: See TracChangeset for help on using the changeset viewer.