Skip to content
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

Closed
wants to merge 15 commits into from
Closed

Conversation

acli
Copy link
Contributor

@acli acli commented May 2, 2013

Please pull if you think this is ok. This is basically just these:

  1. Fix for the use of database admin passwords that contain single quotes (U+0027) (test commit #3, 0004894: Improved the flowerplayer conversion based on the flash availability #10 in this fork)
  2. Suppress spurious error messages that are a result of a failure to connect to the database (symptom of 1)

@@ -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);
Copy link
Contributor Author

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.

@atutor
Copy link
Owner

atutor commented May 2, 2013

Usernames and passwords cannot contain quotes. See the instructions immediately following the two fields in the registration form.

@acli
Copy link
Contributor Author

acli commented May 2, 2013

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.

@acli
Copy link
Contributor Author

acli commented May 2, 2013

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.

@@ -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;
Copy link
Contributor Author

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']);
Copy link
Contributor Author

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”.

acli added 4 commits May 4, 2013 14:50
…angled, causing the Access denied error that eventually caused no version string to be returned. Fixes #21 in my fork.
…angled, causing the Access denied error that eventually caused no version string to be returned. Fixes #21 in my fork.
@atutor
Copy link
Owner

atutor commented May 10, 2014

no longer mergable with queryDB() update

@atutor atutor closed this May 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants