diff --git a/setup/config.php b/setup/config.php index c11f9b19f4..911b01b64f 100644 --- a/setup/config.php +++ b/setup/config.php @@ -20,7 +20,7 @@ // Authorize the user to use setup app include("./inc/setup_auth.inc.php"); // Does not return unless user is authorized - + if ($newsettings["auth_type"] != "ldap") { setup_header(); } diff --git a/setup/inc/setup_auth.inc.php b/setup/inc/setup_auth.inc.php index bd7b007eb1..d6831af7c0 100644 --- a/setup/inc/setup_auth.inc.php +++ b/setup/inc/setup_auth.inc.php @@ -14,7 +14,7 @@ // Include to check user authorization against the // password in ../header.inc.php to protect all of the setup // pages from unauthorized use. - + function setup_header($title = "") { global $phpgw_info; @@ -22,12 +22,17 @@ echo 'phpGroupWare setup ' . $title . '' . '
 phpGroupWare version ' - . $phpgw_info["server"]["version"] . ' setup
'; + . $phpgw_info["server"]["version"] . ' setup'; + echo "
\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo ""; } function loginForm($err="") { - global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPasswd, $PHP_SELF; + global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF; setup_header("Please login"); echo "

\n"; @@ -54,49 +59,48 @@ echo "\n"; } -//if (count($phpgw_domain) > 1){ -// echo "count: ".count($phpgw_domain)."
\n";; -//} - + if (!isset($phpgw_domain)) { + setup_header("Upgrade your header.inc.php"); + echo "
You will need to upgrade your header.inc.php before you can continue with this setup"; + exit; + } reset($phpgw_domain); $default_domain = each($phpgw_domain); $phpgw_info["server"]["default_domain"] = $default_domain[0]; unset ($default_domain); // we kill this for security reasons - if (isset($FormPW)) { - if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { - setcookie("SetupPasswd","$FormPW"); - setcookie("SetupDomain","$FormDomain"); - }else{ - loginForm("Invalid password."); + if (isset($FormLogout)) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + loginForm("You have sucessfully logged out"); + exit; + } elseif (isset($SetupPW)) { + if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + loginForm("Invalid session cookie (cookies must be enabled)"); exit; } - } elseif (isset($SetupPasswd)) { - if ($SetupPasswd != $phpgw_domain[$SetupDomain]["config_passwd"]) { - setcookie("SetupPasswd",""); // scrub the old one - setcookie("SetupDomain",""); // scrub the old one - loginForm("Invalid session cookie (cookies must be enabled)"); + } elseif (isset($FormPW)) { + if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { + setcookie("SetupPW",$FormPW); + setcookie("SetupDomain",$FormDomain); + $SetupDomain = $FormDomain; + }else{ + loginForm("Invalid password."); exit; } } else { loginForm(); exit; } - /* Database setup */ - include($phpgw_info["server"]["api_dir"] . "/phpgw_db_".$phpgw_info["server"]["db_type"].".inc.php"); - $db = new db; - if ($phpgw_info["multiable_domains"] != True){ - $db->Host = $phpgw_info["server"]["db_host"]; - $db->Type = $phpgw_info["server"]["db_type"]; - $db->Database = $phpgw_info["server"]["db_name"]; - $db->User = $phpgw_info["server"]["db_user"]; - $db->Password = $phpgw_info["server"]["db_pass"]; - }else{ - $db->Host = $phpgw_domain[$SetupDomain]["db_host"]; - $db->Type = $phpgw_domain[$SetupDomain]["db_type"]; - $db->Database = $phpgw_domain[$SetupDomain]["db_name"]; - $db->User = $phpgw_domain[$SetupDomain]["db_user"]; - $db->Password = $phpgw_domain[$SetupDomain]["db_pass"]; - } + /* Database setup */ + include($phpgw_info["server"]["api_dir"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php"); + $db = new db; + $db->Host = $phpgw_domain[$SetupDomain]["db_host"]; + $db->Type = $phpgw_domain[$SetupDomain]["db_type"]; + $db->Database = $phpgw_domain[$SetupDomain]["db_name"]; + $db->User = $phpgw_domain[$SetupDomain]["db_user"]; + $db->Password = $phpgw_domain[$SetupDomain]["db_pass"]; ?> diff --git a/setup/index.php b/setup/index.php index 119c55e4d4..4f0b218aa5 100644 --- a/setup/index.php +++ b/setup/index.php @@ -49,6 +49,15 @@ if (!$ok) { exit; } else { + echo ' ' + . '
 phpGroupWare version ' + . $phpgw_info["server"]["version"] . ' setup'; + echo "
\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "
"; + echo "\n"; echo ""; echo "";
phpGroupWare Core Staus