Skip to content

Commit

Permalink
Execute login page checks that can run without admin dir
Browse files Browse the repository at this point in the history
Some of the admin checks performed on login page can (and should) be
executed if the admin dir does not exist (e.g. default administrator
account password, detailed error settings).

Fixes #23181

Backported from master-2.5 branch 4980b3b
  • Loading branch information
dregad committed Aug 4, 2017
1 parent 21a15b8 commit 82f913d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions login_page.php
Expand Up @@ -146,7 +146,8 @@

$t_warnings = array();
$t_upgrade_required = false;
if( config_get_global( 'admin_checks' ) == ON && file_exists( dirname( __FILE__ ) .'/admin' ) ) {

if( config_get_global( 'admin_checks' ) == ON ) {
# Check if the admin directory is accessible
$t_admin_dir = dirname( __FILE__ ) . '/admin';
$t_admin_dir_is_accessible = @file_exists( $t_admin_dir . '/.' );
Expand Down Expand Up @@ -200,17 +201,21 @@ function debug_setting_message ( $p_type, $p_setting, $p_value ) {
}

# Check for db upgrade for versions > 1.0.0 using new installer and schema
require_once( 'admin' . DIRECTORY_SEPARATOR . 'schema.php' );
$t_upgrades_reqd = count( $g_upgrade ) - 1;
if( $t_admin_dir_is_accessible ) {
require_once( 'admin/schema.php' );
$t_upgrades_reqd = count( $g_upgrade ) - 1;

if( ( 0 < $t_db_version ) &&
if( ( 0 < $t_db_version ) &&
( $t_db_version != $t_upgrades_reqd ) ) {

if( $t_db_version < $t_upgrades_reqd ) {
$t_warnings[] = lang_get( 'error_database_version_out_of_date_2' );
$t_upgrade_required = true;
} else {
$t_warnings[] = lang_get( 'error_code_version_out_of_date' );
if( $t_db_version < $t_upgrades_reqd ) {
$t_warnings[] = lang_get( 'error_database_version_out_of_date_2'
);
$t_upgrade_required = true;
}
else {
$t_warnings[] = lang_get( 'error_code_version_out_of_date' );
}
}
}
}
Expand Down

0 comments on commit 82f913d

Please sign in to comment.