added configuration portion of the setup

This commit is contained in:
seek3r 2000-12-01 20:07:23 +00:00
parent f5045f8e13
commit 31bb096266
4 changed files with 52 additions and 27 deletions

View File

@ -22,32 +22,35 @@
exit; exit;
} }
loaddb(); loaddb();
if ($newsettings["auth_type"] != "ldap") {
setup_header();
}
if ($submit) { if ($submit) {
@$db->query("delete from config"); @$db->query("delete from config");
while ($newsetting = each($newsettings)) { while ($newsetting = each($newsettings)) {
if ($newsetting[0] == "nntp_server") { if ($newsetting[0] == "nntp_server") {
$db->query("select config_value FROM config WHERE config_name='nntp_server'"); $db->query("select config_value FROM config WHERE config_name='nntp_server'");
if ($db->num_rows()) { if ($db->num_rows()) {
$db->next_record(); $db->next_record();
if ($db->f("config_value") <> $newsetting[1]) { if ($db->f("config_value") <> $newsetting[1]) {
$db->query("DELETE FROM newsgroups"); $db->query("DELETE FROM newsgroups");
$db->query("DELETE FROM users_newsgroups"); $db->query("DELETE FROM users_newsgroups");
} }
} }
} }
$db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0]) $db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0])
. "','" . addslashes($newsetting[1]) . "')"); . "','" . addslashes($newsetting[1]) . "')");
} }
if ($newsettings["auth_type"] == "ldap") { if ($newsettings["auth_type"] == "ldap") {
Header("Location: ldap.php"); Header("Location: ldap.php");
exit; exit;
} else { } else {
echo "<center>Your config has been updated<br><a href='".$newsettings["webserver_url"]."/login.php'>Click here to login</a>"; //echo "<center>Your config has been updated<br><a href='".$newsettings["webserver_url"]."/login.php'>Click here to login</a>";
} Header("Location: index.php");
exit;
}
}
if ($newsettings["auth_type"] != "ldap") {
show_header("Configuration");
} }
@$db->query("select * from config"); @$db->query("select * from config");

View File

@ -237,20 +237,32 @@
echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n"; echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n";
echo '</form>'; echo '</form>';
echo '</td></tr>'; echo '</td></tr>';
}elseif ($stage == 2.6) { }elseif ($stage >= 2.6) {
echo '<tr><td align="center">X</td><td>Your tables are current.'; echo '<tr><td align="center">X</td><td>Your tables are current.';
echo "<form method=\"POST\" action=\"tables.php\">\n"; echo "<form method=\"POST\" action=\"tables.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\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\">, then re-create the tables.\n"; echo "<br>Insanity: <input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
echo '</form>'; echo '</form>';
echo '</td></tr>'; echo '</td></tr>';
} }
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - Configuration</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 3.1) { if ($stage < 3.1) {
echo '<tr><td align="center">O</td><td>Not ready for this stage yet.</td></tr>'; echo '<tr><td align="center">O</td><td>Not ready for this stage yet.</td></tr>';
}elseif ($stage == 3.1) { }elseif ($stage == 3.1) {
echo '<tr><td align="center">O</td><td>stage 3.1.<br></td></tr>'; echo '<tr><td align="center">O</td><td>Please phpGroupWare for your environment.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Configure Now\"></form>";
echo '</td></tr>';
}elseif ($stage == 3.2) { }elseif ($stage == 3.2) {
echo '<tr><td align="center">X</td><td>Configuration completed.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Edit Current Configuration\"></form>";
echo '</td></tr>';
}
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 4 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 4.1) {
echo '<tr><td align="center">O</td><td>Not ready for this stage yet.</td></tr>';
}elseif ($stage == 4.1) {
echo '<tr><td align="center">O</td><td>stage 3.1.<br></td></tr>';
}elseif ($stage == 4.2) {
echo '<tr><td align="center">O</td><td>stage 3.2.<br></td></tr>'; echo '<tr><td align="center">O</td><td>stage 3.2.<br></td></tr>';
} }
echo '</table>'; echo '</table>';

View File

@ -47,8 +47,17 @@
$db->free(); $db->free();
if (isset($oldversion)){ if (isset($oldversion)){
if ($oldversion == $phpgw_info["server"]["version"]){ if ($oldversion == $phpgw_info["server"]["version"]){
$stage = 2.6; $db->query("select config_value from config where config_name='freshinstall'");
$header_msg = "Stage 2 (Tables are Current)"; $db->next_record();
$configed = $db->f("config_value");
$db->free();
if ($configed){
$stage = 3.1;
$header_msg = "Stage 3 (Needs Configuration)";
}else{
$stage = 3.2;
$header_msg = "Stage 3 (Configuration OK)";
}
}else{ }else{
$stage = 2.4; $stage = 2.4;
$header_msg = "Stage 2 (Tables need upgrading)"; $header_msg = "Stage 2 (Tables need upgrading)";

View File

@ -47,6 +47,7 @@
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); $db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); $db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); $db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')");
} }
if ($useglobalconfigsettings == "on"){ if ($useglobalconfigsettings == "on"){