True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("./inc/functions.inc.php"); if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) { $stage = 1.1; $header_msg = "Stage One"; }else{ include("../header.inc.php"); if (!isset($phpgw_domain) || $phpgw_info["server"]["header_version"] != $phpgw_info["server"]["current_header_version"]) { $stage = 1.2; $header_msg = "Stage One (Upgrade your header.inc.php)"; }else{ /* header.inc.php part settled. Moving to authentication */ $stage = 1.3; $header_msg = "Stage One (Completed)"; if (!auth()){ show_header("Please login",True); loginForm($login_msg); exit; }else{ /* authentication settled. Moving to the database portion. */ loaddb(); $db->Halt_On_Error = "no"; $db->query("show tables"); if ($db->num_rows()){ /* tables exists. checking for post beta version */ $db->free(); $db->query("select app_version from applications where app_name='admin'"); $db->next_record(); $oldversion = $db->f("app_version"); $db->free(); if (isset($oldversion)){ if ($oldversion == $phpgw_info["server"]["version"]){ $stage = 2.5; $header_msg = "Stage 2 (Tables are Current)"; }else{ $stage = 2.4; $header_msg = "Stage 2 (Tables need upgrading)"; } }else{ $stage = 2.2; $header_msg = "Stage 2 (Tables appear to be pre-beta)"; } }else{ /* no tables, so checking if we can create them */ $db->free(); $isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); echo "isdb: ".$isdb."
\n"; $db->free(); $db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); echo "db_rights: ".$db_rights."
\n"; if (isset($db_rights)){ $stage = 2.3; $header_msg = "Stage 2 (Create tables)"; }else{ $stage = 2.1; $header_msg = "Stage 2 (Create Database)"; } $db->query("DROP TABLE phpgw_testrights"); } } /* from authentication check */ } /* from header version check */ } /* From header.inc.php not existing */ show_header($header_msg); show_steps($stage); ?>