diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 9c23ddd065..868b7aef0a 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -3357,7 +3357,7 @@ * Specify where the user should be sent after logging out. * @global string $g_logout_redirect_page */ -$g_logout_redirect_page = 'login_page.php'; +$g_logout_redirect_page = AUTH_PAGE_USERNAME; ########### # Headers # diff --git a/core/authentication_api.php b/core/authentication_api.php index 19323e0b47..38d2dd5fc3 100644 --- a/core/authentication_api.php +++ b/core/authentication_api.php @@ -225,7 +225,7 @@ function auth_credential_page( $p_query_string = '', $p_user_id = null ) { $p_user_id = auth_get_current_user_id(); } - $t_url = 'login_password_page.php'; + $t_url = AUTH_PAGE_CREDENTIAL; if( $p_user_id === NO_USER || !user_exists( $p_user_id ) ) { return helper_url_combine( $t_url, $p_query_string ); } diff --git a/core/classes/AuthFlags.class.php b/core/classes/AuthFlags.class.php index 9b13592910..ba1e2b867b 100644 --- a/core/classes/AuthFlags.class.php +++ b/core/classes/AuthFlags.class.php @@ -51,14 +51,29 @@ class AuthFlags { /** * The login page to use instead of the standard MantisBT login page. This can be * a plugin page. + * + * @see $credentials_page * @see $logout_page * @var string|null */ private $login_page = null; + /** + * The page to use for providing credentials. This can be the default password page + * provided by MantisBT, an auth plugin provided page that asks for credentials or + * an auth plugin provided page that re-directs to an IDP. + * + * @see $login_page + * @see $logout_page + * @var string|null + */ + private $credentials_page = null; + /** * The logout page to use instead of the standard MantisBT logout page. This can be * a plugin page. + * + * @see $credentials_page * @see $login_page * @see $logout_redirect_page * @var string|null @@ -68,6 +83,7 @@ class AuthFlags { /** * The page to redirect to after successful logout. This can be a plugin page. Such * page can display content directly to redirect to a MantisBT page to a remote page. + * * @see $logout_page * @var string|null */ @@ -138,11 +154,15 @@ function setLoginPage( $p_page ) { } function getLoginPage() { - if( is_null( $this->login_page ) ) { - return 'login_page.php'; - } + return is_null( $this->login_page ) ? AUTH_PAGE_USERNAME : $this->login_page; + } + + function setCredentialsPage( $p_page ) { + $this->credentials_page = $p_page; + } - return $this->login_page; + function getCredentialsPage() { + return is_null( $this->credentials_page ) ? AUTH_PAGE_CREDENTIAL : $this->credentials_page; } function setLogoutPage( $p_page ) { diff --git a/core/constant_inc.php b/core/constant_inc.php index 3fc5c291b0..931d39eee9 100644 --- a/core/constant_inc.php +++ b/core/constant_inc.php @@ -682,6 +682,10 @@ define( 'LOGIN_METHOD_API_TOKEN', 'api-token' ); define( 'LOGIN_METHOD_ANONYMOUS', 'anonymous' ); +# AUTH PAGES +define( 'AUTH_PAGE_USERNAME', 'login_page.php' ); +define( 'AUTH_PAGE_CREDENTIAL', 'login_password_page.php' ); + # SLIM FRAMEWORK ATTRIBUTES define( 'ATTRIBUTE_FORCE_API_ENABLED', 'force_enable_api' ); diff --git a/css/status_config.php b/css/status_config.php index 556ec9922d..a6bd78213d 100644 --- a/css/status_config.php +++ b/css/status_config.php @@ -68,7 +68,7 @@ } switch( $t_referer_page ) { - case 'login_page.php': + case AUTH_PAGE_USERNAME: case 'signup_page.php': case 'lost_pwd_page.php': case 'account_update.php': diff --git a/login_page.php b/login_page.php index 5da4f9f7ab..65846a2d83 100644 --- a/login_page.php +++ b/login_page.php @@ -212,7 +212,7 @@ function debug_setting_message ( $p_type, $p_setting, $p_value ) {
-
+
$t_username, 'cookie_error' => $f_cookie_error, diff --git a/lost_pwd_page.php b/lost_pwd_page.php index ae6ba5dd76..eca6264e14 100644 --- a/lost_pwd_page.php +++ b/lost_pwd_page.php @@ -125,7 +125,7 @@
- + diff --git a/signup.php b/signup.php index 0a6c3194e8..6f3754924e 100644 --- a/signup.php +++ b/signup.php @@ -128,7 +128,7 @@
diff --git a/signup_page.php b/signup_page.php index 752a74e92f..099fc6e51c 100644 --- a/signup_page.php +++ b/signup_page.php @@ -160,7 +160,7 @@
- +