True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("./inc/functions.inc.php"); /* processing and discovery phase */ check_header(); if ( $stage >= 1.2){ if (!auth()){ show_header("Please login",True); loginForm($login_msg); exit; }else{ /* authentication settled. Moving to the database portion. */ loaddb(); check_db(); } } switch($action){ case "Delete all my tables and data": $subtitle = "Deleting Tables"; $submsg = "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."; $subaction = "deleted"; $currentver = "drop"; $stage = 2.5; break; case "Upgrade": $subtitle = "Upgrading Tables"; $submsg = "At your request, this script is going to attempt to upgrade your old tables to the new format."; $subaction = "upgraded"; $currentver = "oldversion"; $stage = 2.5; break; case "Create": $subtitle = "Creating Tables"; $submsg = "At your request, this script is going to attempt to the tables for you."; $subaction = "created"; $currentver = "new"; $stage = 2.5; break; } /* Display code */ show_header($header_msg); 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."; exit; } /* The stages are as follows: Stage 1.1 = header does not exists yet Stage 1.2 = header exists, but is the wrong version Stage 1.3 = header exists and is current Stage 2.1 = database does not exists yet Stage 2.2 = database exists pre-beta tables Stage 2.3 = database exists but no tables Stage 2.4 = database and tables exists but need upgrading Stage 2.5 = tables being modified in some way Stage 2.6 = database and tables exists and are current Stage 3.1 = configuration has not been done Stage 3.2 = configuration has been completed Stage 4.1 = install new language Stage 5.1 = something to do with the add-on applications Stage 5.2 = */ echo ''; echo ' '; if ($stage == 1.1) { echo ''; }elseif ($stage == 1.2) { echo ''; }elseif ($stage >= 1.3) { echo ''; } echo ' '; if ($stage < 2.1) { echo ''; }elseif ($stage == 2.1) { echo ''; }elseif ($stage == 2.2) { echo ''; }elseif ($stage == 2.3) { /* commented out because I cannot accuratly figure out if the DB exists */ //echo ''; echo ''; }elseif ($stage == 2.4) { echo ''; }elseif ($stage == 2.5) { echo ''; }elseif ($stage >= 2.6) { echo ''; } echo ' '; if ($stage < 3.1) { echo ''; }elseif ($stage == 3.1) { echo ''; }elseif ($stage == 3.2) { echo ''; } echo ' '; if ($stage < 4.1) { echo ''; }elseif ($stage == 4.1) { echo ''; }elseif ($stage == 4.2) { echo ''; } echo ' '; if ($stage < 5.1) { echo ''; }elseif ($stage == 5.1) { echo ''; }elseif ($stage == 5.2) { echo ''; } echo '
Step 1 - header.inc.php 
O
You have not created your header.inc.php yet.
O
Your header.inc.php is out of date. Please upgrade it.
X
Your header.inc.php is in place and current.
Step 2 - database management 
ONot ready for this stage yet.
O
Your database does not exist.
O'; echo ' You appear to be running a pre-beta version of phpGroupWare
We are providing an automated upgrade system, but we highly recommend backing up your tables incase the script causes damage to your data.
These automated scripts can easily destroy your data. Please backup before going any further!
Select your old version:
'; echo '
O
Your database exist, would you like to create your tables now?
OMake sure that your database is created and the account permissions are set.
'; if ($phpgw_domain[$SetupDomain]["db_type"] == "mysql"){ echo "
Instructions for creating the database in MySQL:
Login to mysql -
[user@server user]# mysql -u root -p
Create the empty database and grant user permissions -
mysql> create database phpgroupware;
mysql> grant all on phpgroupware.* to phpgroupware@localhost identified by 'password';
"; }elseif ($phpgw_domain[$SetupDomain]["db_type"] == "pgsql"){ echo "
Instructions for creating the database in PostgreSQL:
Start the postmaster
[user@server user]# postmaster -i -D /home/[username]/[dataDir]
Create the empty database -
[user@server user]# createdb phpgroupware
"; } echo '
'; echo "\n"; echo 'Once the database is setup correctly
the tables
O'; echo "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 in case the script causes damage to your data.\n"; echo "These automated scripts can easily destroy your data. Please backup before going any further!\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo '
O'; echo "\n"; echo " \n"; echo " \n"; echo " \n"; $db->Halt_On_Error = "report"; include ("./sql/common_main.inc.php"); $db->Halt_On_Error = "no"; echo " \n"; echo " \n"; echo "
 $subtitle
$submsg
 Table Change Messages
 Status
If you did not recieve any errors, your tables have been $subaction.
\n"; echo "
\n"; echo "
\n"; echo '
'; echo '
XYour tables are current.'; echo "
\n"; echo "\n"; echo "
Insanity: \n"; echo '
'; echo '
Step 3 - Configuration 
ONot ready for this stage yet.
OPlease phpGroupWare for your environment.'; echo "
"; echo '
XConfiguration completed.'; echo "
"; echo '
Step 4 - language management 
ONot ready for this stage yet.
Ostage 4.1.
Ostage 4.2.
Step 5 - Add-on Application Installation 
ONot ready for this stage yet.
Ostage 5.1.
Ostage 5.2.
'; echo ""; ?>