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."; } /* 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"; // Prevent app setup from running $ok = false; break; case "prebetaversion": echo "phpGroupWare Setup\n"; echo "\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"; $currentver = "drop"; include ($basedir."/sql/common_main.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 deleting 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"; 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 ($basedir."/sql/common_main.inc.php"); $db->Halt_On_Error = "no"; 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 "; echo " updated (no warranty on data integrity).
\n"; break; default: if (isset($oldversion)){ if ($phpgw_info["server"]["version"] != $oldversion){ Header("Location: $PHP_SELF?action=regularversion"); $ok = false; } }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"; $currentver = "new"; include ($basedir."/sql/common_main.inc.php"); $db->Halt_On_Error = "no"; 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 "
\n"; }else{ Header("Location: $PHP_SELF?action=prebetaversion"); $ok = false; } }else{ echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
  phpGroupware Core Analysis
Your database seems to be current.
\n"; } } } if (!$ok) { echo ""; } // Leave php close tag off, don't want to mess up later Header() calls