From 343e2010ae276fa4ca5e56c40eb6f06cd01a6136 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 23 Jun 2009 17:43:46 +1200 Subject: connect to pg working --- install.php | 97 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 44 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 61156e937..9f48c919d 100644 --- a/install.php +++ b/install.php @@ -204,21 +204,21 @@ function handlePost() $fail = true; } - if (empty($password)) { - updateStatus("No password specified.", true); - $fail = true; - } +// if (empty($password)) { +// updateStatus("No password specified.", true); +// $fail = true; +// } if (empty($sitename)) { updateStatus("No sitename specified.", true); $fail = true; } - if($fail){ - showForm(); - return; - } - + if($fail){ + showForm(); + return; + } + switch($dbtype) { case 'mysql': mysql_db_installer($host, $database, $username, $password, $sitename); break; @@ -233,46 +233,55 @@ function handlePost() 'SMS carrier', + 'notice_source' => 'notice source', + 'foreign_services' => 'foreign service') + as $scr => $name) { + updateStatus(sprintf("Adding %s data to database...", $name)); + $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn); if ($res === false) { - updateStatus("Can't run database script.", true); + updateStatus(sprintf("Can't run %d script.", $name), true); showForm(); return; } - foreach (array('sms_carrier' => 'SMS carrier', - 'notice_source' => 'notice source', - 'foreign_services' => 'foreign service') - as $scr => $name) { - updateStatus(sprintf("Adding %s data to database...", $name)); - $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn); - if ($res === false) { - updateStatus(sprintf("Can't run %d script.", $name), true); - showForm(); - return; - } - } + } updateStatus("Writing config file..."); $sqlUrl = "mysqli://$username:$password@$host/$database"; -- cgit v1.2.3-54-g00ecf