True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("./inc/functions.inc.php"); /* Check header and authentication */ $phpgw_info["setup"]["stage"]["header"] = $phpgw_setup->check_header(); if ($phpgw_info["setup"]["stage"]["header"] != "10"){ Header("Location: manageheader.php"); exit; }elseif (!$phpgw_setup->auth("Config")){ $phpgw_setup->show_header("Please login",True); $phpgw_setup->login_form(); exit; } /* Database actions */ $phpgw_setup->loaddb(); $phpgw_info["setup"]["stage"]["db"] = $phpgw_setup->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"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "drop"; $phpgw_info["setup"]["stage"]["db"] = 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"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion"; $phpgw_info["setup"]["stage"]["db"] = 5; break; case "Create": $subtitle = "Creating Tables"; $submsg = "At your request, this script is going to attempt to the tables for you."; $subaction = "created"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "new"; $phpgw_info["setup"]["stage"]["db"] = 5; break; } /* Display code */ $phpgw_setup->show_header($phpgw_info["setup"]["header_msg"]); if (phpversion() < "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." . "Please upgrade to at least version 3.0.16."; exit; } //$phpgw_setup->app_status(); $phpgw_info["server"]["app_images"] = "templates/default/images"; echo ""; echo ' '; switch($phpgw_info["setup"]["stage"]["db"]){ case 1: echo ''; case 2: echo ''; break; case 3: /* commented out because I cannot accuratly figure out if the DB exists */ //echo ''; echo ''; break; case 4: echo ''; break; case 5: echo ''; break; case 10: echo ''; break; default: echo ''; break; } echo ' '; $phpgw_info["setup"]["stage"]["config"] = $phpgw_setup->check_config(); switch($phpgw_info["setup"]["stage"]["config"]){ case 1: echo ''; break; case 10: echo ''; break; default: echo ''; break; } echo ' '; $phpgw_info["setup"]["stage"]["lang"] = $phpgw_setup->check_lang(); switch($phpgw_info["setup"]["stage"]["lang"]){ case 1: echo '"; break; case 10: echo '"; break; default: echo ''; break; } /* I will probably not need this section at all echo ' '; switch($phpgw_info["setup"]["stage"]["apps"]){ case 1: echo ''; break; case 10: echo ''; break; default: echo ''; break; } */ echo '
Step 1 - database management 
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.
'; switch ($phpgw_domain[$ConfigDomain]["db_type"]){ case "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 ".$phpgw_domain[$ConfigDomain]["db_name"]." ;
mysql> grant all on ".$phpgw_domain[$ConfigDomain]["db_name"].".* to phpgroupware@localhost identified by 'password';
"; break; case "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 ".$phpgw_domain[$ConfigDomain]["db_name"]."
"; break; } echo '
'; echo "\n"; echo 'Once the database is setup correctly
the tables
O'; echo "You appear to be running version ".$phpgw_info["setup"]["oldver"]["phpgwapi"]." of phpGroupWare.
\n"; echo "We will automaticly update your tables/records to ".$phpgw_info["server"]["versions"]["phpgwapi"].", 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"; $phpgw_setup->db->Halt_On_Error = "report"; include ("./sql/common_main.inc.php"); $phpgw_setup->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 '
O
Your database does not exist.
Step 2 - Configuration 
OPlease configure phpGroupWare for your environment.'; echo "
"; echo '
XConfiguration completed.'; echo "
"; echo '
Click Here to setup 1 admin account and 3 demo accounts.
This will delete all existing accounts'; echo '
ONot ready for this stage yet.
Step 3 - language management 
OYou do not have any languages installed. Please install one now
'; echo "
OThis stage is completed
'; echo "Currently installed languages: "; reset ($phpgw_info["setup"]["installed_langs"]); while (list ($key, $value) = each ($phpgw_info["setup"]["installed_langs"])) { if (!$notfirst){ echo $value; }else{ echo ", ".$value; } $notfirst = True; } echo "
"; echo "
ONot ready for this stage yet.
Step 4 - Add-on Application Installation 
OYou are ready for this stage, but this stage is not yet written.
OThis stage is completed
ONot ready for this stage yet.
'; echo ""; ?>