Starting to add in the select box for multiable domains in login.php

This commit is contained in:
jengo 2000-12-08 05:13:50 +00:00
parent 64bf029080
commit 1fa47ac057
2 changed files with 28 additions and 7 deletions

View File

@ -42,6 +42,9 @@
"config_passwd" => "__CONFIG_PASS__" "config_passwd" => "__CONFIG_PASS__"
); );
/* If you want to have your domains in a select box, change to True */
$phpgw_info["server"]["show_domain_selectbox"] = True;
/* This is used to control mcrypt's use */ /* This is used to control mcrypt's use */
$phpgw_info["server"]["mcrypt_enabled"] = __ENABLE_MCRYPT__; $phpgw_info["server"]["mcrypt_enabled"] = __ENABLE_MCRYPT__;
/* Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use. */ /* Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use. */

View File

@ -14,6 +14,9 @@
$phpgw_info["flags"] = array("disable_template_class" => True, "login" => True, "currentapp" => "login", "noheader" => True); $phpgw_info["flags"] = array("disable_template_class" => True, "login" => True, "currentapp" => "login", "noheader" => True);
include("./header.inc.php"); include("./header.inc.php");
$deny_login = False;
/* /*
if ($code != 10 && $phpgw_info["server"]["usecookies"] == False) { if ($code != 10 && $phpgw_info["server"]["usecookies"] == False) {
Setcookie("sessionid"); Setcookie("sessionid");
@ -21,21 +24,23 @@
Setcookie("domain"); Setcookie("domain");
} }
*/ */
$deny_login = False;
$tmpl = new Template($phpgw_info["server"]["template_dir"]); $tmpl = new Template($phpgw_info["server"]["template_dir"]);
$tmpl->set_file(array("login_form" => "login.tpl",
"domain_row" => "login_domain_row.tpl")); if (! $deny_login && ! $phpgw_info["server"]["show_domain_selectbox"]) {
$tmpl->set_block("login_form","domain_row"); $tmpl->set_file(array("login_form" => "login.tpl"));
} else if ($phpgw_info["server"]["show_domain_selectbox"]) {
$tmpl->set_file(array("login_form" => "login_selectdomain.tpl"));
} else {
$tmpl->set_file(array("login_form" => "login_denylogin.tpl"));
}
// When I am updating my server, I don't want people logging in a messing // When I am updating my server, I don't want people logging in a messing
// things up. // things up.
function deny_login() function deny_login()
{ {
global $tmpl; global $tmpl;
$tmpl->set_var("updating","<center>Opps! You caught us in the middle of a system" $tmpl->parse("loginout", "login_form");
. " upgrade.<br>Please, check back with us shortly.</center>");
$tmpl->parse("loginout", "login");
$tmpl->p("loginout"); $tmpl->p("loginout");
exit; exit;
} }
@ -110,6 +115,19 @@
if(!isset($cd) || !$cd) $cd=""; if(!isset($cd) || !$cd) $cd="";
if ($phpgw_info["server"]["show_domain_selectbox"]) {
reset($phpgw_domain);
unset($domain_select); // For security ... just in case
while ($domain = each($phpgw_domain)) {
$domain_select .= '<option value="' . $domain[0] . '"';
if ($domain[0] == "last_domain") {
$domain_select .= " selected";
}
$domain_select .= '>' . $domain[0] . '</option>';
}
$tmpl->set_var("select_domain",$domain_select);
}
$tmpl->set_var("login_url", $phpgw_info["server"]["webserver_url"] . "/login.php"); $tmpl->set_var("login_url", $phpgw_info["server"]["webserver_url"] . "/login.php");
$tmpl->set_var("website_title", $phpgw_info["server"]["site_title"]); $tmpl->set_var("website_title", $phpgw_info["server"]["site_title"]);
$tmpl->set_var("cd",check_logoutcode($cd)); $tmpl->set_var("cd",check_logoutcode($cd));