True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("../header.inc.php"); $phpgw_info["server"]["api_dir"] = $phpgw_info["server"]["include_root"]."/phpgwapi"; /* Database setup */ switch($phpgw_info["server"]["db_type"]){ case "postgresql": include($phpgw_info["server"]["api_dir"] . "/phpgw_db_pgsql.inc.php"); break; case "oracle": include($phpgw_info["server"]["api_dir"] . "/phpgw_db_oracle.inc.php"); break; default: include($phpgw_info["server"]["api_dir"] . "/phpgw_db_mysql.inc.php"); } $db = new db; $db->Host = $phpgw_info["server"]["db_host"]; $db->Type = $phpgw_info["server"]["db_type"]; $db->Database = $phpgw_info["server"]["db_name"]; $db->User = $phpgw_info["server"]["db_user"]; $db->Password = $phpgw_info["server"]["db_pass"]; // $db->Halt_On_Error = "report"; $db->Halt_On_Error = "no"; switch($msg){ case "1": return "You have been successfully logged out"; break; case "2": return "Your old tables were deleted"; break; } /* Database setup */ switch($action){ case "askforupgrade": echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Analysis
You appear to be running a pre-beta version of phpGroupWare
\n"; echo " We are providing an automated upgrade system, but we highly recommend backing up your tables incase the script causes damage to your data.
\n"; echo " These automated scripts can easily destroy your data. Please backup before gonig any further!
\n"; ?>
>
 Upgrade information
Select your old version:
Port old globalconfig settings.
\n"; echo " \n"; echo "  Information\n"; echo " \n"; echo " \n"; echo " At your request, this script is going to take the evil action of dropping your existing tables and re-creating them in the new format.\n"; echo " \n"; include ("droptables_".$phpgw_info["server"]["db_type"].".inc.php"); include ("createtables_".$phpgw_info["server"]["db_type"].".inc.php"); include ("default_records.inc.php"); include ("lang_records.inc.php"); echo " \n"; echo "  Status\n"; echo " \n"; echo " \n"; echo " If you did not recieve any errors, your tables have been created.
\n"; echo " Click here to configure the environment.\n"; echo " \n"; echo "\n"; break; case "Upgrade": echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Information
At your request, this script is going to attempt to upgrade your old tables to the new format.
\n"; $currentver = $oldversion; include ("upgradetables_".$phpgw_info["server"]["db_type"].".inc.php"); // include ("default_records.inc.php"); include ("lang_records.inc.php"); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Status
If you did not recieve any errors, your tables *should* have been updated (no warranty on data integrity).
\n"; echo " Click here to configure the environment.
\n"; break; default: $db->query("select * from config"); if ($db->num_rows() == 0){ $db->query("select * from accounts"); if ($db->num_rows() == 0){ echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; include ("createtables_".$phpgw_info["server"]["db_type"].".inc.php"); include ("default_records.inc.php"); include ("lang_records.inc.php"); echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Analysis
You appear to be running a new install of phpGroupWare, so the tables will be created for you.
 Status
If you did not recieve any errors, your tables have been created.
\n"; echo " Click here to configure the environment.
\n"; }else{ Header("Location: $PHP_SELF?action=askforupgrade"); } }else{ echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Analysis
Your database seems to be current.
\n"; echo " Click here to configure the environment.
\n"; } } //db->disconnect(); ?>