diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-07-15 20:51:38 -0700 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-07-15 20:51:38 -0700 |
| commit | 1026054147a0b3bd4b3280c415485d4b75f6a57b (patch) | |
| tree | f9c482a3a198d19a74fa3f5748e6a14b58b06b8e /installer/web.php | |
| parent | c4fce2cc680c3257cf6ea7844b8ee9e61c02db09 (diff) | |
| parent | f6973431b7f8df24c081a03c7c989f621ab2a708 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
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()) { |
