2000-09-28 16:28:34 +02:00
|
|
|
<?php
|
2000-09-28 02:50:18 +02:00
|
|
|
/**************************************************************************\
|
2000-11-06 04:22:52 +01:00
|
|
|
* phpGroupWare *
|
2000-09-28 02:50:18 +02:00
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
2000-09-28 03:15:51 +02:00
|
|
|
/* $Id$ */
|
2000-11-17 16:51:31 +01:00
|
|
|
|
|
|
|
// Idea: This is so I don't forget. When they are preforming a new install, after config,
|
|
|
|
// forward them right to index.php. Create a session for them and have a nice little intro
|
|
|
|
// page explaining what to do from there (ie, create there own account)
|
2000-09-28 02:50:18 +02:00
|
|
|
|
|
|
|
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True);
|
2000-11-30 22:20:07 +01:00
|
|
|
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";
|
2000-12-02 07:18:55 +01:00
|
|
|
|
|
|
|
$tables = $db->table_names();
|
2000-12-02 14:20:39 +01:00
|
|
|
if (is_array($tables) && count($tables) > 0){
|
2000-11-30 22:20:07 +01:00
|
|
|
/* 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"]){
|
2000-12-01 21:07:23 +01:00
|
|
|
$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)";
|
|
|
|
}
|
2000-11-30 22:20:07 +01:00
|
|
|
}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)";
|
2000-11-06 04:22:52 +01:00
|
|
|
}
|
2000-11-30 22:20:07 +01:00
|
|
|
}else{
|
|
|
|
/* no tables, so checking if we can create them */
|
2000-11-30 23:29:06 +01:00
|
|
|
|
|
|
|
/* I cannot get either to work properly
|
2000-11-30 22:20:07 +01:00
|
|
|
$isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3");
|
2000-11-30 23:29:06 +01:00
|
|
|
*/
|
|
|
|
|
2000-11-30 22:20:07 +01:00
|
|
|
$db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )");
|
|
|
|
|
|
|
|
if (isset($db_rights)){
|
2000-11-30 23:29:06 +01:00
|
|
|
//if (isset($isdb)){
|
2000-11-30 22:20:07 +01:00
|
|
|
$stage = 2.3;
|
|
|
|
$header_msg = "Stage 2 (Create tables)";
|
|
|
|
}else{
|
|
|
|
$stage = 2.1;
|
|
|
|
$header_msg = "Stage 2 (Create Database)";
|
2000-09-30 04:40:33 +02:00
|
|
|
}
|
2000-11-30 22:20:07 +01:00
|
|
|
$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);
|
2000-12-01 19:25:01 +01:00
|
|
|
echo "</body></html>";
|
2000-12-02 04:07:35 +01:00
|
|
|
?>
|