Skip to content

Commit

Permalink
Use config_get_global for default_home_page
Browse files Browse the repository at this point in the history
Issue #23626
  • Loading branch information
atrol committed Nov 13, 2017
1 parent bc0fb1e commit c5614ea
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/access_api.php
Expand Up @@ -92,7 +92,7 @@ function access_denied() {
print_link_button( auth_login_page( 'return=' . $t_return_page ), lang_get( 'click_to_login' ) );
echo '</p><p class="center">';
print_link_button(
helper_mantis_url( config_get( 'default_home_page' ) ),
helper_mantis_url( config_get_global( 'default_home_page' ) ),
lang_get( 'proceed' )
);
echo '</p>';
Expand All @@ -102,7 +102,7 @@ function access_denied() {
layout_admin_page_begin();
echo '<div class="space-10"></div>';
html_operation_failure(
helper_mantis_url( config_get( 'default_home_page' ) ),
helper_mantis_url( config_get_global( 'default_home_page' ) ),
error_string( ERROR_ACCESS_DENIED )
);
layout_admin_page_end();
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -34,7 +34,7 @@
require_api( 'print_api.php' );

if( auth_is_user_authenticated() ) {
print_header_redirect( config_get( 'default_home_page' ) );
print_header_redirect( config_get_global( 'default_home_page' ) );
} else {
print_header_redirect( auth_login_page() );
}
2 changes: 1 addition & 1 deletion login.php
Expand Up @@ -43,7 +43,7 @@

$f_username = gpc_get_string( 'username', '' );
$f_password = gpc_get_string( 'password', '' );
$t_return = string_url( string_sanitize_url( gpc_get_string( 'return', config_get( 'default_home_page' ) ) ) );
$t_return = string_url( string_sanitize_url( gpc_get_string( 'return', config_get_global( 'default_home_page' ) ) ) );
$f_from = gpc_get_string( 'from', '' );
$f_secure_session = gpc_get_bool( 'secure_session', false );
$f_reauthenticate = gpc_get_bool( 'reauthenticate', false );
Expand Down
2 changes: 1 addition & 1 deletion login_page.php
Expand Up @@ -86,7 +86,7 @@
if( !is_blank( $f_return ) ) {
print_header_redirect( $f_return, false, false, true );
} else {
print_header_redirect( config_get( 'default_home_page' ) );
print_header_redirect( config_get_global( 'default_home_page' ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion login_password_page.php
Expand Up @@ -121,7 +121,7 @@
if( !is_blank( $f_return ) ) {
print_header_redirect( $f_return, false, false, true );
} else {
print_header_redirect( config_get( 'default_home_page' ) );
print_header_redirect( config_get_global( 'default_home_page' ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion manage_user_impersonate.php
Expand Up @@ -49,7 +49,7 @@

form_security_purge( 'manage_user_impersonate' );

$t_redirect_to = config_get( 'default_home_page' );
$t_redirect_to = config_get_global( 'default_home_page' );

layout_page_header();

Expand Down
4 changes: 2 additions & 2 deletions set_project.php
Expand Up @@ -78,9 +78,9 @@
if( !is_blank( $c_ref ) ) {
$t_redirect_url = $c_ref;
} else if( !isset( $_SERVER['HTTP_REFERER'] ) || is_blank( $_SERVER['HTTP_REFERER'] ) ) {
$t_redirect_url = config_get( 'default_home_page' );
$t_redirect_url = config_get_global( 'default_home_page' );
} else {
$t_home_page = config_get( 'default_home_page' );
$t_home_page = config_get_global( 'default_home_page' );

# Check that referrer matches our address after squashing case (case insensitive compare)
$t_path = rtrim( config_get_global( 'path' ), '/' );
Expand Down
6 changes: 3 additions & 3 deletions tests/test_config_get_set.php
Expand Up @@ -39,12 +39,12 @@
print_r( $t_test );

$t_config = 'default_home_page';
$t_test = config_get( $t_config );
$t_test = config_get_global( $t_config );
print_r( $t_config );
print_r( $t_test );
$t_test .= '?test';
config_set( $t_config, $t_test );
$t_test = config_get( $t_config );
config_set_global( $t_config, $t_test );
$t_test = config_get_global( $t_config );
print_r( $t_test );

$g_test_config = array();
Expand Down

0 comments on commit c5614ea

Please sign in to comment.