True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("../header.inc.php"); $phpgw_info["server"]["api_dir"] = $phpgw_info["server"]["include_root"]."/phpgwapi"; // Authorize the user to use setup app include("setup_auth.inc.php"); // Does not return unless user is authorized /* Database setup */ include($phpgw_info["server"]["api_dir"] . "/phpgw_db_".$phpgw_info["server"]["db_type"].".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"; if (!isset($oldversion)){ $db->query("select app_version from applications where app_name='admin'"); $db->next_record(); $oldversion = $db->f("app_version"); } if (PHP_VERSION < "3.0.16") { echo "You appear to be running an old version of PHP. It its recommend that you upgrade " . "to a new version. Older version of PHP might not run phpGroupWare correctly, if at all."; } 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 "regularversion": echo "phpGroupWare Setup\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " "; echo " \n"; echo "
 Analysis
You appear to be running version $oldversion of phpGroupWare.
\n"; echo " We will automaticly update your tables/records to ".$phpgw_info["server"]["version"].", 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 going any further!
"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "\n"; break; case "prebetaversion": echo "phpGroupWare Setup\n"; echo "\n"; 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 going any further!
\n"; ?>
>
 Upgrade information
Select your old version:
Port old globalconfig settings.
phpGroupWare Setup\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $db->Halt_On_Error = "report"; 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"); $db->Halt_On_Error = "no"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Information
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.
 Status
If you did not recieve any serious errors, your tables have been created.
\n"; echo " Click here to configure the environment.
\n"; break; case "Upgrade": echo "phpGroupWare Setup\n"; echo "\n"; 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; $db->Halt_On_Error = "report"; include ("upgradetables_".$phpgw_info["server"]["db_type"].".inc.php"); // include ("default_records.inc.php"); $db->Halt_On_Error = "no"; 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 serious errors, your tables *should* have been updated (no warranty on data integrity).
\n"; echo " Click here to configure the environment.
\n"; break; default: if (isset($oldversion)){ if ($phpgw_info["server"]["version"] == $oldversion){ echo "phpGroupWare Setup\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Analysis
Your database is to date with version $oldversion.
\n"; echo " Click here to configure the environment.
\n"; }else{ Header("Location: $PHP_SELF?action=regularversion"); } }else{ $db->query("select * from config"); if ($db->num_rows() == 0){ $db->query("select * from accounts"); if ($db->num_rows() == 0){ echo "phpGroupWare Setup\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $db->Halt_On_Error = "report"; include ("createtables_".$phpgw_info["server"]["db_type"].".inc.php"); include ("default_records.inc.php"); include ("lang_records.inc.php"); $db->Halt_On_Error = "no"; 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=prebetaversion"); } }else{ echo "phpGroupWare Setup\n"; echo "\n"; 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"; } } } echo ""; //db->disconnect(); ?>