code clean up, hopefully this should help clean up the problems jengo is having with php 3.0.16

This commit is contained in:
seek3r 2000-12-31 09:50:16 +00:00
parent 07d6df2ebd
commit a812666b75
4 changed files with 186 additions and 211 deletions

View File

@ -25,7 +25,7 @@
// password in ../header.inc.php to protect all of the setup
// pages from unauthorized use.
if(file_exists("../version.inc.php") || is_file("../version.inc.php")) {
if(file_exists("../version.inc.php")) {
include("../version.inc.php"); // To set the current core version
}else{
$phpgw_info["server"]["versions"]["phpgwapi"] = "Undetected";
@ -35,8 +35,5 @@
include("./inc/phpgw_setup.inc.php");
include("./inc/phpgw_schema_proc.inc.php");
include("./inc/phpgw_template.inc.php");
$phpgw_setup = new phpgw_setup;
$phpgw_setup->template = new Template("../");
?>

View File

@ -14,35 +14,26 @@
class phpgw_setup
{
var $db;
var $template;
function show_header($title = "",$nologoutbutton = False, $logoutfrom = "config")
{
global $phpgw_info, $PHP_SELF;
echo '
<html>
<head>
<title>phpGroupWare Setup
';
if ($title != ""){echo " - ".$title;}
echo'
</title>
<style type="text/css"><!-- .link { color: #FFFFFF; } --></style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version '.$phpgw_info["server"]["versions"]["phpgwapi"].' setup</font>
</td>
<td align="right" bgcolor="486591">
';
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout='.$logoutfrom.'" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
echo "<html>\n<head>\n";
echo " <title>phpGroupWare Setup"; if ($title != ""){echo " - ".$title;}; echo "</title>\n";
echo " <style type=\"text/css\"><!-- .link { color: #FFFFFF; } --></style>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=\"FFFFFF\" margintop=\"0\" marginleft=\"0\" marginright=\"0\" marginbottom=\"0\">";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr>";
echo " <td align=\"left\" bgcolor=\"486591\">&nbsp;<font color=\"fefefe\">phpGroupWare version ".$phpgw_info["server"]["versions"]["phpgwapi"]." setup</font></td>";
echo " <td align=\"right\" bgcolor=\"486591\">";
if ($nologoutbutton) {
echo "&nbsp;</td>";
} else {
echo "<a href=\"".$PHP_SELF."?FormLogout=".$logoutfrom."\" class=\"link\">Logout</a>&nbsp;</td>";
}
echo "</tr></table>";
}
function login_form()
{
global $phpgw_info, $phpgw_domain, $PHP_SELF;
@ -57,15 +48,15 @@
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td><form action='index.php' method='POST'>\n";
if (count($phpgw_domain) > 1){
echo " <table><tr><td>Domain: </td><td><input type='text' name='FormDomain' value=''></td></tr>\n";
echo " <tr><td>Password: </td><td><input type='password' name='FormPW' value=''></td></tr></table>\n";
echo " <table><tr><td>Domain: </td><td><input type=\"text\" name=\"FormDomain\" value=\"\"></td></tr>\n";
echo " <tr><td>Password: </td><td><input type=\"password\" name=\"FormPW\" value=\"\"></td></tr></table>\n";
}else{
reset($phpgw_domain);
$default_domain = each($phpgw_domain);
echo " <input type='password' name='FormPW' value=''>\n";
echo " <input type='hidden' name='FormDomain' value='".$default_domain[0]."'>\n";
echo " <input type=\"password\" name=\"FormPW\" value=\"\">\n";
echo " <input type=\"hidden\" name=\"FormDomain\" value=\"".$default_domain[0]."\">\n";
}
echo " <input type='submit' name='ConfigLogin' value='Login'>\n";
echo " <input type=\"submit\" name=\"ConfigLogin\" value=\"Login\">\n";
echo " </form></td>\n";
echo " </tr>\n";
}
@ -73,11 +64,11 @@
echo " <tr bgcolor=\"486591\">\n";
echo " <td colspan=\"2\"><font color=\"fefefe\">&nbsp;<b>Header Admin Login</b></font></td>\n";
echo " </tr>\n";
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$phpgw_info["setup"]["HeaderLoginMSG"]."</font></td></tr>\n";
echo " <tr bgcolor=\"#e6e6e6\"><td colspan=\"2\"><font color=\"#ff0000\">".$phpgw_info["setup"]["HeaderLoginMSG"]."</font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td><form action='manageheader.php' method='POST'>\n";
echo " <input type='password' name='FormPW' value=''>\n";
echo " <input type='submit' name='HeaderLogin' value='Login'>\n";
echo " <td><form action=\"manageheader.php\" method=\"POST\">\n";
echo " <input type=\"password\" name=\"FormPW\" value=\"\">\n";
echo " <input type=\"submit\" name=\"HeaderLogin\" value=\"Login\">\n";
echo " </form></td>\n";
echo " </tr>\n";
@ -88,33 +79,36 @@
function check_header()
{
global $phpgw_domain, $phpgw_info;
if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) {
if(!file_exists("../header.inc.php")) {
$phpgw_info["setup"]["header_msg"] = "Stage One";
return 1;
return "1";
}else{
include("../header.inc.php");
if (!isset($phpgw_info["server"]["header_admin_password"])){
$phpgw_info["setup"]["header_msg"] = "Stage One (No header admin password set)";
return 2;
}elseif (!isset($phpgw_domain) || $phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) {
return "2";
}elseif (!isset($phpgw_domain)) {
$phpgw_info["setup"]["header_msg"] = "Stage One (Upgrade your header.inc.php)";
return 3;
return "3";
}elseif ($phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) {
$phpgw_info["setup"]["header_msg"] = "Stage One (Upgrade your header.inc.php)";
return "3";
}else{ /* header.inc.php part settled. Moving to authentication */
$phpgw_info["setup"]["header_msg"] = "Stage One (Completed)";
return 10;
return "10";
}
}
}
function generate_header()
{
global $setting, $phpgw_setup, $phpgw_info;
global $setting, $phpgw_setup, $phpgw_info, $header_template;
$phpgw_setup->template->set_file(array("header" => "header.inc.php.template"));
$header_template->set_file(array("header" => "header.inc.php.template"));
while(list($k,$v) = each($setting)) {
$phpgw_setup->template->set_var(strtoupper($k),$v);
$header_template->set_var(strtoupper($k),$v);
}
return $phpgw_setup->template->parse("out","header");
return $header_template->parse("out","header");
}
function auth($auth_type = "Config")
@ -318,42 +312,5 @@
}
*/
}
function setup_header($title = "",$nologoutbutton = False) {
global $phpgw_info, $PHP_SELF;
// Ok, so it isn't the greatest idea, but it works for now. Setup needs to be rewritten.
if ($phpgw_info["setup"]["dontshowtheheaderagain"]) {
return False;
}
$phpgw_info["setup"]["dontshowtheheaderagain"] = True;
?>
<head>
<title>phpGroupWare setup <?php echo $title; ?></title>
<style type="text/css">
<!--
.link
{
color: #FFFFFF;
}
-->
</style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version <?php
echo $phpgw_info["server"]["versions"]["phpgwapi"]; ?> setup</font>
</td>
<td align="right" bgcolor="486591">
<?php
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout=True" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
}
}
?>

View File

@ -69,139 +69,153 @@
$phpgw_info["server"]["app_images"] = "templates/default/images";
echo '<table border="1" width="100%" cellspacing="0" cellpadding="2">';
/*
echo ' <tr><td align="left" WIDTH="20%" bgcolor="486591"><font color="fefefe">Step 0 - header.inc.php</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($phpgw_info["setup"]["stage"]["header"] <= 1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./manageheader.php" method=post>You have not created your header.inc.php yet.<br> <input type=submit value="Create one now"></form></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["header"] == 2 || $phpgw_info["setup"]["stage"] == 3) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./manageheader.php" method=post>Your header.inc.php is out of date. Please upgrade it.<br> <input type=submit value="Upgrade now"></form></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["header"] == 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td><form action="./manageheader.php" method=post>
Your header.inc.php is in place and current.<br> <input type=submit value="Edit existing header.inc.php"></form></td></tr>';
}
*/
echo "<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 1 - database management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($phpgw_info["setup"]["stage"]["header"] < 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] <= 1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database does not exist.<br> <input type=submit value="Create one now"></form></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] == 2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo '
You appear to be running a pre-beta version of phpGroupWare<br>
We are providing an automated upgrade system, but we highly recommend backing up your tables incase the script causes damage to your data.<br>
These automated scripts can easily destroy your data. Please backup before going any further!<br>
<form method="post" action="index.php">
Select your old version:
<select name="oldversion">
<option value="7122000">7122000</option>
<option value="8032000">8032000</option>
<option value="8072000">8072000</option>
<option value="8212000">8212000</option>
<option value="9052000">9052000</option>
<option value="9072000">9072000</option>
<option value="9262000">9262000</option>
<option value="0_9_1">0.9.1</option>
<option value="0_9_2">0.9.2</option>
</select>
<input type="submit" name="action" value="Upgrade">
<input type="submit" name="action" value="Delete all my tables and data">
</form>';
echo '</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] == 3) {
/* commented out because I cannot accuratly figure out if the DB exists */
//echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database exist, would you like to create your tables now?<br> <input type=submit value="Create tables"></form></td></tr>';
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Make sure that your database is created and the account permissions are set.<br>';
if ($phpgw_domain[$SetupDomain]["db_type"] == "mysql"){
echo "
<br>Instructions for creating the database in MySQL:<br>
Login to mysql -<br>
<i>[user@server user]# mysql -u root -p</i><br>
Create the empty database and grant user permissions -<br>
<i>mysql> create database phpgroupware;</i><br>
<i>mysql> grant all on phpgroupware.* to phpgroupware@localhost identified by 'password';</i><br>
";
}elseif ($phpgw_domain[$SetupDomain]["db_type"] == "pgsql"){
echo "
<br>Instructions for creating the database in PostgreSQL:<br>
Start the postmaster<br>
<i>[user@server user]# postmaster -i -D /home/[username]/[dataDir]</i><br>
Create the empty database -<br>
<i>[user@server user]# createdb phpgroupware</i><br>
";
}
echo '<form action="index.php" method=post>';
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
echo 'Once the database is setup correctly <br><input type=submit name="action" value="Create"> the tables</form></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] == 4) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "You appear to be running version ".$phpgw_info["setup"]["oldver"]["phpgwapi"]." of phpGroupWare.<br>\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 "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"".$phpgw_info["setup"]["oldver"]["phpgwapi"]."\">\n";
echo "<input type=\"hidden\" name=\"useglobalconfigsettings\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Upgrade\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
echo "</form>\n";
echo "<form method=\"POST\" action=\"config.php\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Dont touch my data\">\n";
echo "</form>\n";
echo '</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] == 5) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "<table width=\"100%\">\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>$subtitle</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>$submsg</td></tr>\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Table Change Messages</b></font></td></tr>\n";
$phpgw_setup->db->Halt_On_Error = "report";
include ("./sql/common_main.inc.php");
$phpgw_setup->db->Halt_On_Error = "no";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Status</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>If you did not recieve any errors, your tables have been $subaction.<br></tr>\n";
echo "</table>\n";
echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n";
echo '</form>';
echo '</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["db"] == 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Your tables are current.';
echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
echo "<br>Insanity: <input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
echo '</form>';
echo '</td></tr>';
switch($phpgw_info["setup"]["stage"]["db"]){
case 1:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database does not exist.<br> <input type=submit value="Create one now"></form></td></tr>';
case 2:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo '
You appear to be running a pre-beta version of phpGroupWare<br>
We are providing an automated upgrade system, but we highly recommend backing up your tables incase the script causes damage to your data.<br>
These automated scripts can easily destroy your data. Please backup before going any further!<br>
<form method="post" action="index.php">
Select your old version:
<select name="oldversion">
<option value="7122000">7122000</option>
<option value="8032000">8032000</option>
<option value="8072000">8072000</option>
<option value="8212000">8212000</option>
<option value="9052000">9052000</option>
<option value="9072000">9072000</option>
<option value="9262000">9262000</option>
<option value="0_9_1">0.9.1</option>
<option value="0_9_2">0.9.2</option>
</select>
<input type="submit" name="action" value="Upgrade">
<input type="submit" name="action" value="Delete all my tables and data">
</form>
';
echo '</td></tr>';
break;
case 3:
/* commented out because I cannot accuratly figure out if the DB exists */
//echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database exist, would you like to create your tables now?<br> <input type=submit value="Create tables"></form></td></tr>';
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Make sure that your database is created and the account permissions are set.<br>';
switch ($phpgw_domain[$SetupDomain]["db_type"]){
case "mysql":
echo "
<br>Instructions for creating the database in MySQL:<br>
Login to mysql -<br>
<i>[user@server user]# mysql -u root -p</i><br>
Create the empty database and grant user permissions -<br>
<i>mysql> create database phpgroupware;</i><br>
<i>mysql> grant all on phpgroupware.* to phpgroupware@localhost identified by 'password';</i><br>
";
break;
case "pgsql":
echo "
<br>Instructions for creating the database in PostgreSQL:<br>
Start the postmaster<br>
<i>[user@server user]# postmaster -i -D /home/[username]/[dataDir]</i><br>
Create the empty database -<br>
<i>[user@server user]# createdb phpgroupware</i><br>
";
break;
}
echo '<form action="index.php" method=post>';
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
echo 'Once the database is setup correctly <br><input type=submit name="action" value="Create"> the tables</form></td></tr>';
break;
case 4:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "You appear to be running version ".$phpgw_info["setup"]["oldver"]["phpgwapi"]." of phpGroupWare.<br>\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 "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"".$phpgw_info["setup"]["oldver"]["phpgwapi"]."\">\n";
echo "<input type=\"hidden\" name=\"useglobalconfigsettings\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Upgrade\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
echo "</form>\n";
echo "<form method=\"POST\" action=\"config.php\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Dont touch my data\">\n";
echo "</form>\n";
echo '</td></tr>';
break;
case 5:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "<table width=\"100%\">\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>$subtitle</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>$submsg</td></tr>\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Table Change Messages</b></font></td></tr>\n";
$phpgw_setup->db->Halt_On_Error = "report";
include ("./sql/common_main.inc.php");
$phpgw_setup->db->Halt_On_Error = "no";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Status</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>If you did not recieve any errors, your tables have been $subaction.<br></tr>\n";
echo "</table>\n";
echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n";
echo '</form>';
echo '</td></tr>';
break;
case 10:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Your tables are current.';
echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
echo "<br>Insanity: <input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
echo '</form>';
echo '</td></tr>';
break;
default:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database does not exist.<br> <input type=submit value="Create one now"></form></td></tr>';
break;
}
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 2 - Configuration</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($phpgw_info["setup"]["stage"]["db"] < 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["config"] <= 1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Please configure phpGroupWare for your environment.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Configure Now\"></form>";
echo '</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["config"] == 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Configuration completed.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Edit Current Configuration\"></form>";
echo '<br><a href="setup_demo.php">Click Here</a> to setup 1 admin account and 3 demo accounts. <br><b>This will delete all existing accounts</b>';
echo '</td></tr>';
switch($phpgw_info["setup"]["stage"]["config"]){
case 1:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Please configure phpGroupWare for your environment.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Configure Now\"></form>";
echo '</td></tr>';
break;
case 10:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Configuration completed.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Edit Current Configuration\"></form>";
echo '<br><a href="setup_demo.php">Click Here</a> to setup 1 admin account and 3 demo accounts. <br><b>This will delete all existing accounts</b>';
echo '</td></tr>';
break;
default:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
break;
}
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($phpgw_info["setup"]["stage"]["config"] < 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["lang"] <= 1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You are ready for this stage, but this stage is not yet written.<br></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["lang"] == 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br></td></tr>';
switch($phpgw_info["setup"]["stage"]["lang"]){
case 1:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You are ready for this stage, but this stage is not yet written.<br></td></tr>';
break;
case 10:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br></td></tr>';
break;
default:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
break;
}
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 4 - Add-on Application Installation</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($phpgw_info["setup"]["stage"]["lang"] < 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["apps"] <= 1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You are ready for this stage, but this stage is not yet written.<br></td></tr>';
}elseif ($phpgw_info["setup"]["stage"]["apps"] == 10) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br></td></tr>';
switch($phpgw_info["setup"]["stage"]["apps"]){
case 1:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You are ready for this stage, but this stage is not yet written.<br></td></tr>';
break;
case 10:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br></td></tr>';
break;
default:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
break;
}
echo '</table>';
echo "</body></html>";

View File

@ -37,6 +37,8 @@
switch($action){
case "download":
include("./inc/phpgw_template.inc.php");
$header_template = new Template("../");
header("Content-disposition: attachment; filename=\"header.inc.php\"");
header("Content-type: application/octet-stream");
header("Pragma: no-cache");
@ -45,6 +47,8 @@
echo $newheader;
break;
case "view":
include("./inc/phpgw_template.inc.php");
$header_template = new Template("../");
$phpgw_setup->show_header("Generated header.inc.php", False, "header");
echo "<br>Save this text as contents of your header.inc.php<br><hr>";
$newheader = $phpgw_setup->generate_header();
@ -53,8 +57,9 @@
echo "</pre></body></html>";
break;
case "write config":
include("./inc/phpgw_template.inc.php");
$header_template = new Template("../");
if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){
$phpgw_setup->show_header("Saved header.inc.php", False, "header");
$newheader = $phpgw_setup->generate_header();
$fsetup = fopen("../header.inc.php","w");
fwrite($fsetup,$newheader);
@ -250,5 +255,7 @@
echo "</form>";
echo "</body>";
echo "</html>";
break; // ending the switch default
}
?>