Liferay建立新使用者頁面中的隨機文本驗證詳細分析

來源:互聯網
上載者:User

Liferay 6.1的建立新使用者頁面如圖:

這個頁面的代碼在/html/portlet/login/create_account.jsp中:

... <portlet:actionURL var="createAccoutURL">     <portlet:param name="saveLastPath" value="0" />     <portlet:param name="struts_action" value="/login/create_account" /> </portlet:actionURL>      <aui:form action="<%= createAccoutURL %>" method="post" name="fm">     <aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.ADD %>" />     <aui:input name="redirect" type="hidden" value="<%= redirect %>" />     <aui:input name="openId" type="hidden" value="<%= openId %>" />      ..              <%         UserPasswordException upe = (UserPasswordException)errorException;         %>              <c:if test="<%= upe.getType() == UserPasswordException.PASSWORD_CONTAINS_TRIVIAL_WORDS %>">             <liferay-ui:message key="that-password-uses-common-words-please-enter-in-a-password-that-is-harder-to-guess-i-e-contains-a-mix-of-numbers-and-letters" />         </c:if>              <c:if test="<%= upe.getType() == UserPasswordException.PASSWORD_INVALID %>">             <liferay-ui:message key="that-password-is-invalid-please-enter-in-a-different-password" />         </c:if>              <c:if test="<%= upe.getType() == UserPasswordException.PASSWORD_LENGTH %>">             <%= LanguageUtil.format(pageContext, "that-password-is-too-short-or-too-long-please-make-sure-your-password-is-between-x-and-512-characters", String.valueOf(passwordPolicy.getMinLength()), false) %>         </c:if>              <c:if test="<%= upe.getType() == UserPasswordException.PASSWORD_TOO_TRIVIAL %>">             <liferay-ui:message key="that-password-is-too-trivial" />         </c:if>              <c:if test="<%= upe.getType() == UserPasswordException.PASSWORDS_DO_NOT_MATCH %>">             <liferay-ui:message key="the-passwords-you-entered-do-not-match-each-other-please-re-enter-your-password" />         </c:if>     </liferay-ui:error>          <liferay-ui:error exception="<%= UserScreenNameException.class %>" message="please-enter-a-valid-screen-name" />     <liferay-ui:error exception="<%= WebsiteURLException.class %>" message="please-enter-a-valid-url" />          <c:if test='<%= SessionMessages.contains(request, "missingOpenIdUserInformation") %>'>         <div class="portlet-msg-info">             <liferay-ui:message key="you-have-successfully-authenticated-please-provide-the-following-required-information-to-access-the-portal" />         </div>     </c:if>          <aui:model-context model="<%= Contact.class %>" />          <aui:fieldset>         <aui:column>             <aui:input model="<%= User.class %>" name="firstName" />                  <aui:input model="<%= User.class %>" name="middleName" />                  <aui:input model="<%= User.class %>" name="lastName">                 <c:if test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.USERS_LAST_NAME_REQUIRED, PropsValues.USERS_LAST_NAME_REQUIRED) %>">                     <aui:validator name="required" />                 </c:if>             </aui:input>                  <c:if test="<%= !PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.USERS_SCREEN_NAME_ALWAYS_AUTOGENERATE) %>">                 <aui:input model="<%= User.class %>" name="screenName" />             </c:if>                  <aui:input model="<%= User.class %>" name="emailAddress">                 <c:if test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.USERS_EMAIL_ADDRESS_REQUIRED, PropsValues.USERS_EMAIL_ADDRESS_REQUIRED) %>">                     <aui:validator name="required" />                 </c:if>             </aui:input>         </aui:column>              <aui:column>             <c:if test="<%= PropsValues.LOGIN_CREATE_ACCOUNT_ALLOW_CUSTOM_PASSWORD %>">                 <aui:input label="password" name="password1" size="30" type="password" value="" />                      <aui:input label="enter-again" name="password2" size="30" type="password" value="">                     <aui:validator name="equalTo">                         '#<portlet:namespace />password1'                    </aui:validator>                 </aui:input>             </c:if>                  <c:choose>                 <c:when test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.FIELD_ENABLE_COM_LIFERAY_PORTAL_MODEL_CONTACT_BIRTHDAY) %>">                     <aui:input name="birthday" value="<%= birthday %>" />                 </c:when>                 <c:otherwise>                     <aui:input name="birthdayMonth" type="hidden" value="<%= Calendar.JANUARY %>" />                     <aui:input name="birthdayDay" type="hidden" value="1" />                     <aui:input name="birthdayYear" type="hidden" value="1970" />                 </c:otherwise>             </c:choose>                  <c:if test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.FIELD_ENABLE_COM_LIFERAY_PORTAL_MODEL_CONTACT_MALE) %>">                 <aui:select label="gender" name="male">                     <aui:option label="male" value="1" />                     <aui:option label="female" selected="<%= !male %>" value="0" />                 </aui:select>             </c:if>                  <c:if test="<%= PropsValues.CAPTCHA_CHECK_PORTAL_CREATE_ACCOUNT %>">                 <portlet:actionURL windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>" var="captchaURL">                     <portlet:param name="struts_action" value="/login/captcha" />                 </portlet:actionURL>                      <liferay-ui:captcha url="<%= captchaURL %>" />             </c:if>         </aui:column>     </aui:fieldset>          <aui:button-row>         <aui:button type="submit" />     </aui:button-row> </aui:form>      <liferay-util:include page="/html/portlet/login/navigation.jsp" />      <c:if test="<%= windowState.equals(WindowState.MAXIMIZED) %>">     <aui:script>         Liferay.Util.focusFormField(document.<portlet:namespace />fm.<portlet:namespace />firstName);     </aui:script> </c:if>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.