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-10-04 21:40:09 +02:00
|
|
|
|
2000-11-30 22:20:07 +01:00
|
|
|
$db->query("show tables");
|
|
|
|
if ($db->num_rows()){
|
|
|
|
/* tables exists. checking for post beta version */
|
|
|
|
$db->free();
|
|
|
|
$db->query("select app_version from applications where app_name='admin'");
|
|
|
|
$db->next_record();
|
|
|
|
$oldversion = $db->f("app_version");
|
|
|
|
$db->free();
|
|
|
|
if (isset($oldversion)){
|
|
|
|
if ($oldversion == $phpgw_info["server"]["version"]){
|
|
|
|
$stage = 2.5;
|
|
|
|
$header_msg = "Stage 2 (Tables are Current)";
|
|
|
|
}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 */
|
|
|
|
$db->free();
|
|
|
|
$isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3");
|
|
|
|
echo "isdb: ".$isdb."<br>\n";
|
|
|
|
|
|
|
|
|
|
|
|
$db->free();
|
|
|
|
$db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )");
|
|
|
|
echo "db_rights: ".$db_rights."<br>\n";
|
|
|
|
|
|
|
|
if (isset($db_rights)){
|
|
|
|
$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-10-11 00:53:45 +02:00
|
|
|
?>
|
2000-11-06 04:22:52 +01:00
|
|
|
</body>
|
|
|
|
</html>
|