diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-15 21:48:47 +0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-15 21:56:15 +0800 |
commit | f6973431b7f8df24c081a03c7c989f621ab2a708 (patch) | |
tree | fd91ad84c80781e84a6e1e5d819e091200ebb807 /installer/web.php | |
parent | d192f2f1bc1227938d3144381ef311c7e07b47b0 (diff) |
Fix for ticket #544.
* Separate the portion of get_db_info.html.php that displays the status
of the var directory into a separate view var_dir_status.html.php
* Change the processing to always generate the database information request
screen unless there is an environment error, the var directory is not writable
and the install was successful
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'installer/web.php')
-rw-r--r-- | installer/web.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/installer/web.php b/installer/web.php index 78784539..fd75d352 100644 --- a/installer/web.php +++ b/installer/web.php @@ -20,6 +20,12 @@ if (installer::already_installed()) { $content = render("success.html.php"); } else { + $config = array("host" => empty($_POST["dbhost"]) ? "localhost" : $_POST["dbhost"], + "user" => empty($_POST["dbuser"]) ? "root" : $_POST["dbuser"], + "password" => empty($_POST["dbpass"]) ? "" : $_POST["dbpass"], + "dbname" => empty($_POST["dbname"]) ? "gallery3" : $_POST["dbname"], + "prefix" => empty($_POST["prefix"]) ? "" : $_POST["prefix"], + "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); switch (@$_GET["step"]) { default: case "welcome": @@ -27,18 +33,13 @@ if (installer::already_installed()) { if ($errors) { $content = render("environment_errors.html.php", array("errors" => $errors)); } else { - $content = render("get_db_info.html.php"); + $request_db_info = $is_var_writable = installer::var_writable(); + $content = render("var_dir_status.html.php", array("writable" => $is_var_writable)); } break; case "save_db_info": - $config = array("host" => $_POST["dbhost"], - "user" => $_POST["dbuser"], - "password" => $_POST["dbpass"], - "dbname" => $_POST["dbname"], - "prefix" => $_POST["prefix"], - "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); - + $request_db_info = true; if (!installer::connect($config)) { $content = render("invalid_db_info.html.php"); } else if (!installer::select_db($config)) { @@ -58,6 +59,7 @@ if (installer::already_installed()) { $content = render("success.html.php", array("user" => $user, "password" => $password)); installer::create_private_key($config); + $request_db_info = false; } catch (Exception $e) { $content = oops($e->getMessage()); } @@ -66,6 +68,9 @@ if (installer::already_installed()) { } } +if (empty($errors) && !empty($request_db_info)) { + $database_form = render("get_db_info.html.php", $config); +} include("views/install.html.php"); function render($view, $args=array()) { |