mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-07 05:50:13 +01:00
Cleaning up setup
This commit is contained in:
parent
8ed5524101
commit
e339bcabf6
@ -15,54 +15,58 @@
|
|||||||
// password in ../header.inc.php to protect all of the setup
|
// password in ../header.inc.php to protect all of the setup
|
||||||
// pages from unauthorized use.
|
// pages from unauthorized use.
|
||||||
|
|
||||||
function setup_header()
|
function setup_header($title = "")
|
||||||
{
|
{
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
|
|
||||||
echo '<title>phpGroupWare - setup</title><BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" '
|
echo '<title>phpGroupWare setup ' . $title . '</title><BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" '
|
||||||
. 'marginright="0" marginbottom="0"><table border="0" width="100%"><tr>'
|
. 'marginright="0" marginbottom="0"><table border="0" width="100%"><tr>'
|
||||||
. '<td align="left" bgcolor="486591"> <font color="fefefe">phpGroupWare version '
|
. '<td align="left" bgcolor="486591"> <font color="fefefe">phpGroupWare version '
|
||||||
. $phpgw_info["server"]["version"] . ' setup</font></td></tr></table>';
|
. $phpgw_info["server"]["version"] . ' setup</font></td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function loginForm($err="") {
|
function loginForm($err="")
|
||||||
global $PHP_SELF;
|
{
|
||||||
echo "<html><head><title>phpGroupWare Setup - please Login</title></head>\n";
|
global $PHP_SELF;
|
||||||
echo "<body bgcolor='#ffffff'>\n";
|
|
||||||
echo "<table border=\"0\" align=\"center\">\n";
|
setup_header("Please login");
|
||||||
echo " <tr bgcolor=\"486591\">\n";
|
|
||||||
echo " <td colspan=\"2\"><font color=\"fefefe\"> <b>Setup Login</b></font></td>\n";
|
|
||||||
echo " </tr>\n";
|
|
||||||
if ($err != "") {
|
|
||||||
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$err."</font></td></tr>\n";
|
|
||||||
}
|
|
||||||
echo " <tr bgcolor=\"e6e6e6\">\n";
|
|
||||||
echo " <td><form action='".$PHP_SELF."' method='POST'>\n";
|
|
||||||
echo " <input type='password' name='FormPW' value=''>\n";
|
|
||||||
echo " <input type='submit' name='Login' value='Login'>\n";
|
|
||||||
echo " </form></td>\n";
|
|
||||||
echo " </tr>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
echo "</body></html>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($FormPW) ) {
|
echo "<p><body bgcolor='#ffffff'>\n";
|
||||||
if ($FormPW != $phpgw_info["server"]["config_passwd"]) {
|
echo "<table border=\"0\" align=\"center\">\n";
|
||||||
loginForm("Invalid password.");
|
echo " <tr bgcolor=\"486591\">\n";
|
||||||
exit;
|
echo " <td colspan=\"2\"><font color=\"fefefe\"> <b>Setup Login</b></font></td>\n";
|
||||||
}
|
echo " </tr>\n";
|
||||||
// Valid login, fall through and set the cookie
|
if ($err != "") {
|
||||||
$SetupCookie = $FormPW;
|
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$err."</font></td></tr>\n";
|
||||||
} else if (isset($SetupCookie)) {
|
}
|
||||||
if ($SetupCookie != $phpgw_info["server"]["config_passwd"]) {
|
echo " <tr bgcolor=\"e6e6e6\">\n";
|
||||||
setcookie("SetupCookie",""); // scrub the old one
|
echo " <td><form action='".$PHP_SELF."' method='POST'>\n";
|
||||||
loginForm("Invalid session cookie (cookies must be enabled)");
|
echo " <input type='password' name='FormPW' value=''>\n";
|
||||||
exit;
|
echo " <input type='submit' name='Login' value='Login'>\n";
|
||||||
|
echo " </form></td>\n";
|
||||||
|
echo " </tr>\n";
|
||||||
|
echo "</table>\n";
|
||||||
|
echo "</body></html>\n";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
loginForm();
|
if (isset($FormPW)) {
|
||||||
exit;
|
if ($FormPW != $phpgw_info["server"]["config_passwd"]) {
|
||||||
}
|
loginForm("Invalid password.");
|
||||||
// Auth ok.
|
exit;
|
||||||
setcookie("SetupCookie","$SetupCookie");
|
}
|
||||||
?>
|
// Valid login, fall through and set the cookie
|
||||||
|
$SetupCookie = $FormPW;
|
||||||
|
} else if (isset($SetupCookie)) {
|
||||||
|
if ($SetupCookie != $phpgw_info["server"]["config_passwd"]) {
|
||||||
|
setcookie("SetupCookie",""); // scrub the old one
|
||||||
|
loginForm("Invalid session cookie (cookies must be enabled)");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
loginForm();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Auth ok.
|
||||||
|
setcookie("SetupCookie","$SetupCookie");
|
||||||
|
?>
|
@ -62,20 +62,23 @@
|
|||||||
* for applications to inteact with the user, this is how it is. *
|
* for applications to inteact with the user, this is how it is. *
|
||||||
* *
|
* *
|
||||||
\**********************************************************************/
|
\**********************************************************************/
|
||||||
|
setup_header();
|
||||||
|
echo "<br>";
|
||||||
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
$baseDir = $phpgw_info["server"]["server_root"];
|
$baseDir = $phpgw_info["server"]["server_root"];
|
||||||
include("./inc/core_setup.inc.php");
|
include("./inc/core_setup.inc.php");
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
echo "<table border='0' align='center' bgcolor='#e6e6e6' cellpadding='3' cellspacing='0'>\n";
|
echo "<table width=\"70%\" border='0' align='center' bgcolor='#e6e6e6' cellpadding='3' cellspacing='0'>\n";
|
||||||
echo "<tr bgcolor='#486591'>";
|
echo "<tr bgcolor='#486591'>";
|
||||||
echo "<th><font color='#fefefe'>phpGroupWare Core Staus</font></th>";
|
echo "<th align=\"center\"><font color='#fefefe'>phpGroupWare Core Staus</font></th>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
$db->query("select app_version from applications where app_name='admin'");
|
$db->query("select app_version from applications where app_name='admin'");
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$curversion = $db->f("app_version");
|
$curversion = $db->f("app_version");
|
||||||
echo "<tr><td>Core version $curversion. No updates needed.</td></tr>\n";
|
echo "<tr><td align=\"center\">Core version $curversion. No updates needed.</td></tr>\n";
|
||||||
echo "</table>\n\n";
|
echo "</table>\n\n";
|
||||||
}
|
}
|
||||||
// Remove the appName from all users and groupws on the system
|
// Remove the appName from all users and groupws on the system
|
||||||
@ -204,11 +207,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initial HTML output
|
|
||||||
echo "<html><head><title>Setup phpGroupWare</title></head>\n";
|
|
||||||
echo "<body bgcolor='#ffffff'>\n";
|
|
||||||
|
|
||||||
// Loop through all the directories looking for possible 3rd party apps
|
// Loop through all the directories looking for possible 3rd party apps
|
||||||
$baseDir = $phpgw_info["server"]["server_root"];
|
$baseDir = $phpgw_info["server"]["server_root"];
|
||||||
$setupFile = "/inc/setup.inc.php"; // File to look for to identify apps
|
$setupFile = "/inc/setup.inc.php"; // File to look for to identify apps
|
||||||
@ -287,16 +285,16 @@
|
|||||||
|
|
||||||
echo "<form action='".$PHP_SELF."' method='POST'>\n";
|
echo "<form action='".$PHP_SELF."' method='POST'>\n";
|
||||||
|
|
||||||
echo "<table border='0' align='center' bgcolor='#e6e6e6' cellpadding='3' cellspacing='1'>\n";
|
echo "<table border='0' align='center' bgcolor='#e6e6e6' cellpadding='3' cellspacing='1' width=\"70%\">\n";
|
||||||
echo "<tr bgcolor='#486591'><th colspan='7'><font size='+1' color='#fefefe'>Application Setup</font></th></tr>\n";
|
echo "<tr bgcolor='#486591'><th colspan='7'><font color='#fefefe'>Application Setup</font></th></tr>\n";
|
||||||
echo "<tr bgcolor='#486591'>";
|
echo "<tr bgcolor='#486591'>";
|
||||||
echo "<th><font color='#fefefe'>Application</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Application</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Installed Version</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Installed Version</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Detected Version</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Detected Version</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Install</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Install</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Upgrade</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Upgrade</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Remove</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Remove</font></td>";
|
||||||
echo "<th><font color='#fefefe'>Do Nothing</font></th>";
|
echo "<td align=\"center\"><font color='#fefefe'>Do Nothing</font></td>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
$numApps = 0;
|
$numApps = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user