summaryrefslogtreecommitdiff
path: root/installer/web.php
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-07-18 17:51:23 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-07-18 17:51:23 +0200
commitc78744d4f8a0cfad7ca5aa3d2867fb66d4c6b8c4 (patch)
treee2b4d5d066590a966d949409cb48104456edaf7e /installer/web.php
parent7f5030ac208c30a7dc576a57cd9e665022ccbde5 (diff)
parentdf22832a5b7e7c1962940becab1c90aaec3392f9 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'installer/web.php')
-rw-r--r--installer/web.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/installer/web.php b/installer/web.php
index fd75d352..78784539 100644
--- a/installer/web.php
+++ b/installer/web.php
@@ -20,12 +20,6 @@
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":
@@ -33,13 +27,18 @@ if (installer::already_installed()) {
if ($errors) {
$content = render("environment_errors.html.php", array("errors" => $errors));
} else {
- $request_db_info = $is_var_writable = installer::var_writable();
- $content = render("var_dir_status.html.php", array("writable" => $is_var_writable));
+ $content = render("get_db_info.html.php");
}
break;
case "save_db_info":
- $request_db_info = true;
+ $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");
+
if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");
} else if (!installer::select_db($config)) {
@@ -59,7 +58,6 @@ 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());
}
@@ -68,9 +66,6 @@ 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()) {