Bläddra i källkod

add setting for "intro url"

Jason Rivard 7 år sedan
förälder
incheckning
624f4c5e18

+ 2 - 0
server/src/main/java/password/pwm/config/PwmSetting.java

@@ -80,6 +80,8 @@ public enum PwmSetting {
             "pwm.logoutURL", PwmSettingSyntax.STRING, PwmSettingCategory.GENERAL),
     URL_HOME(
             "pwm.homeURL", PwmSettingSyntax.STRING, PwmSettingCategory.GENERAL),
+    URL_INTRO(
+            "pwm.introURL", PwmSettingSyntax.SELECT, PwmSettingCategory.GENERAL),
     PWM_INSTANCE_NAME(
             "pwmInstanceName", PwmSettingSyntax.STRING, PwmSettingCategory.GENERAL),
     IDLE_TIMEOUT_SECONDS(

+ 11 - 0
server/src/main/resources/password/pwm/config/PwmSetting.xml

@@ -92,6 +92,17 @@
             <value />
         </default>
     </setting>
+    <setting hidden="false" key="pwm.introURL" level="1">
+        <flag>Select_AllowUserInput</flag>
+        <regex>^/.+</regex>
+        <default>
+            <value>/private</value>
+        </default>
+        <options>
+            <option value="/private">/private</option>
+            <option value="/public">/public</option>
+        </options>
+    </setting>
     <setting hidden="false" key="pwmInstanceName" level="2">
         <default>
             <value />

+ 2 - 0
server/src/main/resources/password/pwm/i18n/PwmSetting.properties

@@ -579,6 +579,7 @@ Setting_Description_pwmAdmin.queryMatch=Specify the permissions @PwmAppName@ use
 Setting_Description_pwm.appProperty.overrides=(Troubleshooting only) Specify an override application properties value.  Do not use unless directed to by a support expert.
 Setting_Description_pwm.forwardURL=Specify a URL that @PwmAppName@ forwards users to after the users complete any activity which does not require a log out.<br/><br/>You can override this setting for any given user session by adding a <i>forwardURL</i> parameter to any HTTP request. If blank, the system forwards the user to the @PwmAppName@ menu.
 Setting_Description_pwm.homeURL=Specify the URL to redirect the user to upon clicking the home button. If blank, the home button returns the user to the application context URL.
+Setting_Description_pwm.introURL=URL to redirect user to upon accessing the base context of this server (<code>@PwmContextPath@</code>).  The value must start with a slash (<code>/</code>) character, and it will be prepended by the base application path.
 Setting_Description_pwmInstanceName=Specify the name of this application instance. If blank, @PwmAppName@ uses a persistent, randomly generated value. The recommended value is blank.
 Setting_Description_pwm.logoutURL=Specify the URL to redirect user to upon logout. If users access the site through a web authentication gateway, set the Logout URL to the gateway's Logout URL. If you are using a gateway and do not include the proper logout URL here, then users encounter authentication errors, intruder lockouts, and other problems. If things are working properly then the users see the gateway log out screen when logging out.<br/><br/>You can set the Logout URL to any appropriate relative or absolute URL.  At the time the user's browser requests this URL, the local session has already been invalidated.<br/><br/>You can always override this setting for any given user session by adding a <b>logoutURL</b> parameter to any HTTP request during the session.
 Setting_Description_pwm.publishStats.enable=Enable this option to periodically share anonymous statistics of @PwmAppName@. The published statistics are\:<ul><li>Version/Build Information</li><li>Cumulative Statistics</li><li>Which settings are non-default (but not the actual setting values)</li><li>Operating system name and version</li></ul>Enabling this setting helps @PwmAppName@ developers know which features are used most often.
@@ -1062,6 +1063,7 @@ Setting_Label_pwmAdmin.queryMatch=Administrator Permission
 Setting_Label_pwm.appProperty.overrides=App Property Overrides
 Setting_Label_pwm.forwardURL=Forward URL
 Setting_Label_pwm.homeURL=Home URL
+Setting_Label_pwm.introURL=Intro URL
 Setting_Label_pwmInstanceName=Instance Name
 Setting_Label_pwm.logoutURL=Logout URL
 Setting_Label_pwm.publishStats.enable=Enable Anonymous Statistics Publishing

+ 2 - 2
server/src/main/webapp/index.jsp

@@ -1,4 +1,4 @@
-<%--
+<%@ page import="password.pwm.http.JspUtility" %><%--
   ~ Password Management Servlets (PWM)
   ~ http://www.pwm-project.org
   ~
@@ -28,7 +28,7 @@
 <%@ include file="WEB-INF/jsp/fragment/header.jsp" %>
 <body class="nihilo">
 <%
-    final String redirectURL = request.getContextPath() + "/private/";
+    final String redirectURL = request.getContextPath() + JspUtility.getPwmRequest(pageContext).getPwmApplication().getConfig().readSettingAsString(PwmSetting.URL_INTRO);
     response.sendRedirect(redirectURL);
 %>
 <div id="wrapper">