-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes to the installation wizard #68
Conversation
…nnection to the SQL server
#3 (in Ambrose's fork).
@@ -16,7 +16,7 @@ | |||
|
|||
if(isset($_POST['submit'])) { | |||
//check DB & table connection | |||
$db = create_and_switch_db($_POST['db_host'], $_POST['db_port'], $_POST['db_login'], $_POST['db_password'], $_POST['tb_prefix'], $_POST['db_name'], true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passwords with U+0027 were escaped with backslashes. Eventually these backslashes make it to mysql_connect(), which causes a failure to connect.
Usernames and passwords cannot contain quotes. See the instructions immediately following the two fields in the registration form. |
Not the ATutor admin/user passwords, but the actual MySQL admin password. You can’t control what passwords the real MySQL admin happens to have used. |
BTW, there is no restriction on apostrophes for ATutor admin and user passwords either. There are restrictions on usernames but not passwords, and in fact passwords with apostrophes went through OK without trouble, and the resulting system is usable. |
…ut why PHP is erroring out on $addslashes
…d somewhere; they just needed to be declared global.
@@ -419,7 +419,8 @@ function create_and_switch_db($db_host, $db_port, $db_login, $db_pwd, $tb_prefix | |||
} else { | |||
$msg->addError('UNABLE_CONNECT_DB'); | |||
} | |||
} | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any further tests are just going to fail because we don’t have a connection to the SQL server. So instead of presenting a whole bunch of misleading error messages to the user, we should just stop here.
… are specifically trying to write a PHP literal string; we are not dealing with CGI queries here
@@ -154,7 +154,7 @@ | |||
if ($_POST['step1']['old_path'] != '') { | |||
$db = @mysql_connect($_POST['step1']['db_host'] . ':' . $_POST['step1']['db_port'], $_POST['step1']['db_login'], urldecode($_POST['step1']['db_password'])); | |||
} else { | |||
$db = @mysql_connect($_POST['step2']['db_host'] . ':' . $_POST['step2']['db_port'], $_POST['step2']['db_login'], $_POST['step2']['db_password']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The missing urldecode() call is what ultimately causes the “MySQL version” field to come out blank in step 6 of the installation, during the “Anonymous Data Collection”.
no longer mergable with queryDB() update |
Please pull if you think this is ok. This is basically just these: