ソースを参照

add app property for control of token choice page

Jason Rivard 8 年 前
コミット
4d077499dd

+ 1 - 0
src/main/java/password/pwm/AppProperty.java

@@ -285,6 +285,7 @@ public enum AppProperty {
     TOKEN_CLEANER_INTERVAL_SECONDS                  ("token.cleaner.intervalSeconds"),
     TOKEN_MASK_EMAIL_REGEX                          ("token.mask.email.regex"),
     TOKEN_MASK_EMAIL_REPLACE                        ("token.mask.email.replace"),
+    TOKEN_MASK_SHOW_SELECTION                       ("token.mask.showSelection"),
     TOKEN_MASK_SMS_REGEX                            ("token.mask.sms.regex"),
     TOKEN_MASK_SMS_REPLACE                          ("token.mask.sms.replace"),
     TOKEN_MAX_UNIQUE_CREATE_ATTEMPTS                ("token.maxUniqueCreateAttempts"),

+ 1 - 0
src/main/java/password/pwm/http/tag/conditional/PwmIfTest.java

@@ -62,6 +62,7 @@ public enum PwmIfTest {
     peopleSearchEnabled(new BooleanPwmSettingTest(PwmSetting.PEOPLE_SEARCH_ENABLE)),
     orgChartEnabled(new OrgChartEnabled()),
     passwordExpired(new PasswordExpired()),
+    showMaskedTokenSelection(new BooleanAppPropertyTest(AppProperty.TOKEN_MASK_SHOW_SELECTION)),
 
     accountInfoEnabled(new BooleanPwmSettingTest(PwmSetting.ACCOUNT_INFORMATION_ENABLED)),
 

+ 1 - 0
src/main/resources/password/pwm/AppProperty.properties

@@ -271,6 +271,7 @@ telemetry.minimumAuthentications=10
 token.cleaner.intervalSeconds=3605
 token.mask.email.regex=(?<=.).(?=[^@]*?@)|(?:(?<=@.)|(?!^)\\G(?=[^@]*$)).(?=.*\\.)
 token.mask.email.replace=*
+token.mask.showSelection=true
 token.mask.sms.regex=\\d(?!.{0,3}$)
 token.mask.sms.replace=*
 token.maxUniqueCreateAttempts=100

+ 36 - 32
src/main/webapp/WEB-INF/jsp/forgottenpassword-tokenchoice.jsp

@@ -54,22 +54,24 @@
                     <pwm:display key="Display_RecoverTokenSendChoiceEmail"/>
                 </td>
             </tr>
-            <tr>
-                <td>
-                </td>
-                <td>
-                    <% for (final TokenDestinationItem item : tokenDestinationItems) { %>
-                    <% if (item.getType() == TokenDestinationItem.Type.email) { %>
-                    <%=item.getDisplay()%>
-                    <% } %>
-                    <% } %>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    &nbsp;
-                </td>
-            </tr>
+            <pwm:if test="<%=PwmIfTest.showMaskedTokenSelection%>">
+                <tr>
+                    <td>
+                    </td>
+                    <td>
+                        <% for (final TokenDestinationItem item : tokenDestinationItems) { %>
+                        <% if (item.getType() == TokenDestinationItem.Type.email) { %>
+                        <%=item.getDisplay()%>
+                        <% } %>
+                        <% } %>
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        &nbsp;
+                    </td>
+                </tr>
+            </pwm:if>
             <tr>
                 <td style="text-align: center">
                     <form action="<pwm:current-url/>" method="post" enctype="application/x-www-form-urlencoded" name="search" class="pwm-form">
@@ -86,22 +88,24 @@
                     <pwm:display key="Display_RecoverTokenSendChoiceSMS"/>
                 </td>
             </tr>
-            <tr>
-                <td>
-                </td>
-                <td>
-                    <% for (final TokenDestinationItem item : tokenDestinationItems) { %>
-                    <% if (item.getType() == TokenDestinationItem.Type.sms) { %>
-                    <%=item.getDisplay()%>
-                    <% } %>
-                    <% } %>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    &nbsp;
-                </td>
-            </tr>
+            <pwm:if test="<%=PwmIfTest.showMaskedTokenSelection%>">
+                <tr>
+                    <td>
+                    </td>
+                    <td>
+                        <% for (final TokenDestinationItem item : tokenDestinationItems) { %>
+                        <% if (item.getType() == TokenDestinationItem.Type.sms) { %>
+                        <%=item.getDisplay()%>
+                        <% } %>
+                        <% } %>
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        &nbsp;
+                    </td>
+                </tr>
+            </pwm:if>
             <tr>
                 <td>
                     <%@ include file="/WEB-INF/jsp/fragment/forgottenpassword-cancel.jsp" %>