Skip to content

Commit

Permalink
Install: fix db connection as admin check (#1049)
Browse files Browse the repository at this point in the history
Commit 4271855 (issue #22400)
introduced a regression in the installer, causing the 'Attempting to
connect to database as admin' check to fail for new installations, even
though the Admin user ID and password are correct.

Fixes #22510
  • Loading branch information
dregad committed Mar 12, 2017
1 parent 92ab77a commit 92f07eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions admin/install.php
Expand Up @@ -408,17 +408,17 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password );

if( $t_result ) {
# check if db exists for the admin
$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name );
}
if( $t_result ) {
$t_db_open = true;
$f_db_exists = true;

# due to a bug in ADODB, this call prompts warnings, hence the @
# the check only works on mysql if the database is open
$t_version_info = @$g_db->ServerInfo();

# check if db exists for the admin
$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name );
if( $t_result ) {
$t_db_open = true;
$f_db_exists = true;
}

print_test_result( GOOD );
} else {
print_test_result( BAD, true, 'Does administrative user have access to the database? ( ' . db_error_msg() . ' )' );
Expand Down

0 comments on commit 92f07eb

Please sign in to comment.