phpGroupWare setup ' . $title . '' . '
 phpGroupWare version ' . $phpgw_info["server"]["version"] . ' setup
'; } function loginForm($err="") { global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPasswd, $PHP_SELF; setup_header("Please login"); echo "

\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; if ($err != "") { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo "
 Setup Login
".$err."
\n"; if (count($phpgw_domain) > 1){ echo " \n"; echo "
Domain:
Password:
\n"; }else{ echo " \n"; echo " \n"; } echo " \n"; echo "
\n"; echo "\n"; } //if (count($phpgw_domain) > 1){ // echo "count: ".count($phpgw_domain)."
\n";; //} 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."); 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)"); 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"]; } ?>