From f6973431b7f8df24c081a03c7c989f621ab2a708 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 15 Jul 2009 21:48:47 +0800 Subject: 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 --- installer/web.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'installer/web.php') 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()) { -- cgit v1.2.3 From 33495256407e9cad69cc44c4da96b4f5cfdba1d6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 15 Jul 2009 20:58:20 -0700 Subject: Revert "Fix for ticket #544." This reverts commit f6973431b7f8df24c081a03c7c989f621ab2a708. --- installer/views/get_db_info.html.php | 43 +++++++++++++++++++++++++++++---- installer/views/install.html.php | 3 +-- installer/views/var_dir_status.html.php | 30 ----------------------- installer/web.php | 21 ++++++---------- 4 files changed, 47 insertions(+), 50 deletions(-) delete mode 100644 installer/views/var_dir_status.html.php (limited to 'installer/web.php') diff --git a/installer/views/get_db_info.html.php b/installer/views/get_db_info.html.php index adc775a4..94c19585 100644 --- a/installer/views/get_db_info.html.php +++ b/installer/views/get_db_info.html.php @@ -1,4 +1,32 @@ +

Welcome!

+

+ Installing Gallery is very easy. We just need to know how to talk + to your MySQL database, and we need a place to store your photos on + your web host. +

+ + +
+ Photo Storage + +

+ We're having trouble creating a place for your photos. Can you + help? Please create a directory called "var" using mkdir var in your + gallery3 directory, then run chmod 777 var. That + should fix it. +

+ Check again +

+ +

+ We've found a place to store your photos: + +

+ +
+ +
Database @@ -13,7 +41,7 @@ Database Name - + @@ -21,7 +49,7 @@ User - + @@ -29,7 +57,7 @@ Password - + @@ -37,7 +65,7 @@ Host - + @@ -45,14 +73,19 @@ Table Prefix - + + + + (Please fix the photo storage problem before continuing) +
+ diff --git a/installer/views/install.html.php b/installer/views/install.html.php index 31112c28..a0eddaf3 100644 --- a/installer/views/install.html.php +++ b/installer/views/install.html.php @@ -8,8 +8,7 @@
- - +