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
  • Loading branch information
dregad committed Aug 3, 2017
1 parent d6d7dc2 commit 4980b3b
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions login_page.php
Expand Up @@ -139,7 +139,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 @@ -193,17 +194,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 4980b3b

Please sign in to comment.