diff --git a/setup/config.php b/setup/config.php index acaf437638..5bea214216 100644 --- a/setup/config.php +++ b/setup/config.php @@ -23,6 +23,14 @@ } loaddb(); + /* Guessing default paths. */ + $current_config["files_dir"] = ereg_replace("/setup","/files",dirname($SCRIPT_FILENAME)); + if (is_dir("/tmp")){ + $current_config["temp_dir"] = "/tmp"; + }else{ + $current_config["temp_dir"] = "/path/to/temp/dir"; + } + if ($submit) { @$db->query("delete from config"); while ($newsetting = each($newsettings)) { diff --git a/setup/inc/core_setup.inc.php b/setup/inc/core_setup.inc.php deleted file mode 100644 index 10f5dab6ae..0000000000 --- a/setup/inc/core_setup.inc.php +++ /dev/null @@ -1,231 +0,0 @@ -query("select app_version from applications where app_name='admin'"); - @$db->next_record(); - $oldversion = $db->f("app_version"); - } - - if ($action != "Delete my old tables" && ! isset($oldversion)) { - setup_header(); - echo "
"; - } - - 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 diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index 8f13922b42..dce64d50e9 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -22,41 +22,32 @@ } $phpgw_info["server"]["current_header_version"] = "1.4"; - function show_header($title = "",$nologoutbutton = False) { + function show_header($title = "",$nologoutbutton = False) + { global $phpgw_info, $PHP_SELF; - ?> - - - phpGroupWare Setup - <?php - if ($title != ""){echo " - ".$title;} ?> - - - - - - -
 phpGroupWare version setup + echo ' + + + phpGroupWare Setup'; + if ($title != ""){echo " - ".$title;} + echo' + + + + + + -
 phpGroupWare version '.$phpgw_info["server"]["version"].' setup - Logout '; - } - - echo "
"; +
'; + if ($nologoutbutton) { + echo " "; + } else { + echo 'Logout '; + } + echo "
"; } - function loginForm($err=""){ + function loginForm($err="") + { global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF; echo "

\n"; echo "\n"; @@ -83,7 +74,44 @@ echo "
\n"; echo "\n"; } - function auth(){ + + function check_header() + { + global $phpgw_domain, $phpgw_info, $stage, $header_msg; + if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) { + $stage = 1.1; + $header_msg = "Stage One"; + }else{ + include("../header.inc.php"); + if (!isset($phpgw_domain) || $phpgw_info["server"]["header_version"] != $phpgw_info["server"]["current_header_version"]) { + $stage = 1.2; + $header_msg = "Stage One (Upgrade your header.inc.php)"; + }else{ /* header.inc.php part settled. Moving to authentication */ + $stage = 1.3; + $header_msg = "Stage One (Completed)"; + } + } + } + + function generate_header(){ + Global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v; + $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); + if($ftemplate){ + $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); + $template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template")); + fclose($ftemplate); + while(list($k,$v) = each($HTTP_POST_VARS)) { + $template = ereg_replace("__".strtoupper($k)."__",$v,$template); + } + return $template; + }else{ + echo "Could not open the header template for reading!
"; + exit; + } + } + + function auth() + { global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $db, $HTTP_POST_VARS, $login_msg; if (isset($FormLogout)) { setcookie("SetupPW"); // scrub the old one @@ -114,7 +142,8 @@ } } - function loaddb(){ + function loaddb() + { global $phpgw_info, $phpgw_domain, $SetupDomain, $db; /* Database setup */ $phpgw_info["server"]["api_dir"] = $phpgw_info["server"]["include_root"]."/phpgwapi"; @@ -128,174 +157,54 @@ } - function show_steps($stage, $note = False) { - global $phpgw_info, $phpgw_domain, $SetupDomain, $oldversion, $currentver, $db, $subtitle, $submsg, $subaction; - /* 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 ''; - } - if ($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
- "; + function check_db() + { + global $phpgw_info, $oldversion, $db, $stage, $header_msg; + $db->Halt_On_Error = "no"; + $tables = $db->table_names(); + if (is_array($tables) && count($tables) > 0){ + /* tables exists. checking for post beta version */ + $db->query("select app_version from applications where app_name='admin'"); + $db->next_record(); + $oldversion = $db->f("app_version"); + if (isset($oldversion)){ + if ($oldversion == $phpgw_info["server"]["version"]){ + $db->query("select config_value from config where config_name='freshinstall'"); + $db->next_record(); + $configed = $db->f("config_value"); + if ($configed){ + $stage = 3.1; + $header_msg = "Stage 3 (Needs Configuration)"; + }else{ + $stage = 3.2; + $header_msg = "Stage 3 (Configuration OK)"; + } + }else{ + $stage = 2.4; + $header_msg = "Stage 2 (Tables need upgrading)"; + } + }else{ + $stage = 2.2; + $header_msg = "Stage 2 (Tables appear to be pre-beta)"; } - 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.
'; - } - - function generate_header(){ - Global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v; - $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); - if($ftemplate){ - $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); - $template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template")); - fclose($ftemplate); - while(list($k,$v) = each($HTTP_POST_VARS)) { - $template = ereg_replace("__".strtoupper($k)."__",$v,$template); - } - return $template; }else{ - echo "Could not open the header template for reading!
"; - exit; + /* no tables, so checking if we can create them */ + + /* I cannot get either to work properly + $isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); + */ + + $db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); + + if (isset($db_rights)){ + //if (isset($isdb)){ + $stage = 2.3; + $header_msg = "Stage 2 (Create tables)"; + }else{ + $stage = 2.1; + $header_msg = "Stage 2 (Create Database)"; + } + $db->query("DROP TABLE phpgw_testrights"); } } ?> diff --git a/setup/inc/setup_auth.inc.php b/setup/inc/setup_auth.inc.php deleted file mode 100644 index e67c592aad..0000000000 --- a/setup/inc/setup_auth.inc.php +++ /dev/null @@ -1,140 +0,0 @@ - - - - phpGroupWare setup <?php echo $title; ?> - - - - - - -
 phpGroupWare version setup - - Logout '; - } - - echo "
"; - } - - function loginForm($err=""){ - global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF; - - setup_header("Please login",True); - echo "

\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - if ($err != "") { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo "
 Setup Login
".$err."
\n"; - if (count($phpgw_domain) > 1){ - echo " \n"; - echo "
Domain:
Password:
\n"; - }else{ - echo " \n"; - echo " \n"; - } - echo " \n"; - echo "
\n"; - echo "\n"; - } - - function loaddb(){ - global $phpgw_domain, $phpgw_info, $FormLogout, $FormDomain, $SetupPW, $SetupDomain, $db, $PHP_SELF, $HTTP_POST_VARS; - - /* This code makes sure the newer multi-domain supporting header.inc.php is being used */ - if (!isset($phpgw_domain)) { - setup_header("Upgrade your header.inc.php"); - echo "
You will need to upgrade your header.inc.php before you can continue with this setup"; - exit; - } - - /* Based on authentication, the database will be loaded */ - reset($phpgw_domain); - $default_domain = each($phpgw_domain); - $phpgw_info["server"]["default_domain"] = $default_domain[0]; - unset ($default_domain); // we kill this for security reasons - - if (isset($FormLogout)) { - setcookie("SetupPW"); // scrub the old one - setcookie("SetupDomain"); // scrub the old one - loginForm("You have sucessfully logged out"); - exit; - } elseif (isset($SetupPW)) { - if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) { - setcookie("SetupPW"); // scrub the old one - setcookie("SetupDomain"); // scrub the old one - loginForm("Invalid session cookie (cookies must be enabled)"); - exit; - } - } elseif (isset($FormPW)) { - if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { - setcookie("SetupPW",$FormPW); - setcookie("SetupDomain",$FormDomain); - $SetupDomain = $FormDomain; - }else{ - loginForm("Invalid password."); - exit; - } - } else { - loginForm(); - exit; - } - - - /* Database setup */ - include($phpgw_info["server"]["api_dir"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php"); - $db = new db; - $db->Host = $phpgw_domain[$SetupDomain]["db_host"]; - $db->Type = $phpgw_domain[$SetupDomain]["db_type"]; - $db->Database = $phpgw_domain[$SetupDomain]["db_name"]; - $db->User = $phpgw_domain[$SetupDomain]["db_user"]; - $db->Password = $phpgw_domain[$SetupDomain]["db_pass"]; - } - loaddb(); -?> diff --git a/setup/index.php b/setup/index.php index 3591178eb8..64e1e47b35 100644 --- a/setup/index.php +++ b/setup/index.php @@ -18,74 +18,200 @@ $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("./inc/functions.inc.php"); - if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) { - $stage = 1.1; - $header_msg = "Stage One"; - }else{ - include("../header.inc.php"); - if (!isset($phpgw_domain) || $phpgw_info["server"]["header_version"] != $phpgw_info["server"]["current_header_version"]) { - $stage = 1.2; - $header_msg = "Stage One (Upgrade your header.inc.php)"; - }else{ /* header.inc.php part settled. Moving to authentication */ - $stage = 1.3; - $header_msg = "Stage One (Completed)"; - if (!auth()){ - show_header("Please login",True); - loginForm($login_msg); - exit; - }else{ /* authentication settled. Moving to the database portion. */ - loaddb(); - $db->Halt_On_Error = "no"; - - $tables = $db->table_names(); - if (is_array($tables) && count($tables) > 0){ - /* tables exists. checking for post beta version */ - $db->query("select app_version from applications where app_name='admin'"); - $db->next_record(); - $oldversion = $db->f("app_version"); - if (isset($oldversion)){ - if ($oldversion == $phpgw_info["server"]["version"]){ - $db->query("select config_value from config where config_name='freshinstall'"); - $db->next_record(); - $configed = $db->f("config_value"); - if ($configed){ - $stage = 3.1; - $header_msg = "Stage 3 (Needs Configuration)"; - }else{ - $stage = 3.2; - $header_msg = "Stage 3 (Configuration OK)"; - } - }else{ - $stage = 2.4; - $header_msg = "Stage 2 (Tables need upgrading)"; - } - }else{ - $stage = 2.2; - $header_msg = "Stage 2 (Tables appear to be pre-beta)"; - } - }else{ - /* no tables, so checking if we can create them */ + /* 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(); + } + } - /* I cannot get either to work properly - $isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); - */ - - $db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); + 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 */ - if (isset($db_rights)){ - //if (isset($isdb)){ - $stage = 2.3; - $header_msg = "Stage 2 (Create tables)"; - }else{ - $stage = 2.1; - $header_msg = "Stage 2 (Create Database)"; - } - $db->query("DROP TABLE phpgw_testrights"); - } - } /* from authentication check */ - } /* from header version check */ - } /* From header.inc.php not existing */ show_header($header_msg); - show_steps($stage); + 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 ""; ?> diff --git a/setup/tables.php b/setup/tables.php deleted file mode 100644 index 646ef15708..0000000000 --- a/setup/tables.php +++ /dev/null @@ -1,71 +0,0 @@ - True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); - include("./inc/functions.inc.php"); - include("../header.inc.php"); - - // Authorize the user to use setup app and load the database - // Does not return unless user is authorized - if (!auth()){ - Header("Location: index.php"); - exit; - } - loaddb(); - $db->Halt_On_Error = "no"; - //$db->Halt_On_Error = "report"; - - if (!isset($oldversion)){ - Header("Location: index.php"); - exit; -// $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."; - } - /* Database setup */ - 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"; - 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; - $currentver = "oldversion"; - 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"; - break; - } - - $stage = 2.5; - show_header($header_msg); - show_steps($stage); - echo ""; -?> \ No newline at end of file