From 55638ce3a5f45470780c6a311578354d3b5fe6b8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 28 Aug 2003 18:14:45 +0000 Subject: [PATCH] fixed some probs with not existing database --- phpgwapi/inc/class.setup.inc.php | 2 +- phpgwapi/inc/class.setup_detection.inc.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.setup.inc.php b/phpgwapi/inc/class.setup.inc.php index bcc6d7e74e..6ca5f74986 100644 --- a/phpgwapi/inc/class.setup.inc.php +++ b/phpgwapi/inc/class.setup.inc.php @@ -122,7 +122,7 @@ elseif(!empty($ConfigLogin) && $auth_type == 'Config') { /* config login */ - if($FormPW == stripslashes(@$GLOBALS['phpgw_domain'][$FormDomain]['config_passwd'])) + if(isset($GLOBALS['phpgw_domain'][$FormDomain]) && $FormPW == stripslashes(@$GLOBALS['phpgw_domain'][$FormDomain]['config_passwd'])) { setcookie('ConfigPW',"$FormPW","$expire"); setcookie('ConfigDomain',"$FormDomain","$expire"); diff --git a/phpgwapi/inc/class.setup_detection.inc.php b/phpgwapi/inc/class.setup_detection.inc.php index 7d6619e079..93bf478fe5 100644 --- a/phpgwapi/inc/class.setup_detection.inc.php +++ b/phpgwapi/inc/class.setup_detection.inc.php @@ -252,6 +252,15 @@ $GLOBALS['phpgw_setup']->db->Halt_On_Error = 'no'; // _debug_array($setup_info); + if (!$GLOBALS['phpgw_setup']->db->Link_ID) + { + $GLOBALS['phpgw_setup']->db->connect(); + } + if (!$GLOBALS['phpgw_setup']->db->Link_ID) + { + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)'; + return 1; + } if(!isset($setup_info['phpgwapi']['currentver'])) { $setup_info = $this->get_db_versions($setup_info);