From ad1bddfcf7db2d2fd0380165d8737ec677df1cc1 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 3 Sep 2000 23:22:14 +0000 Subject: [PATCH] A few small random changes --- admin/accounts.php | 9 +++++---- login.php | 30 ++++++++++++++---------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/admin/accounts.php b/admin/accounts.php index 0d15901f29..b76206da50 100755 --- a/admin/accounts.php +++ b/admin/accounts.php @@ -16,8 +16,8 @@ $t = new Template($phpgw_info["server"]["template_dir"]); $t->set_file(array( "header" => "accounts.tpl", - "row" => "accounts.tpl", - "footer" => "accounts.tpl" )); + "row" => "accounts.tpl", + "footer" => "accounts.tpl" )); $t->set_block("header","row","footer"); @@ -34,7 +34,7 @@ if ($query) { $querymethod = " where firstname like '%$query%' OR lastname like '%$query%' OR loginid " - . "like '%$query%' "; + . "like '%$query%' "; } $phpgw->db->query("select count(*) from accounts $querymethod"); @@ -60,7 +60,7 @@ $t->parse("out","header"); $phpgw->db->query("select con,firstname,lastname,loginid from accounts $querymethod " - . "$ordermethod limit $limit"); + . "$ordermethod limit $limit"); while ($phpgw->db->next_record()) { $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); @@ -96,6 +96,7 @@ } + $t->set_var("hidden_vars",$phpgw->form_sessionid()); $t->set_var("actionurl",$phpgw->link("newaccount.php")); $t->set_var("lang_add",lang_common("add")); $t->set_var("lang_search",lang_common("search")); diff --git a/login.php b/login.php index 5b0aa39457..794d2bec82 100755 --- a/login.php +++ b/login.php @@ -31,7 +31,6 @@ // When I am updating my server, I don't want people logging in a messing // things up. - function deny_login() { global $tmpl; @@ -45,11 +44,9 @@ function show_cookie() { global $phpgw_info, $code, $lastloginid, $login; - if ($code != 5 && $phpgw_info["server"]["usecookies"] == True){ - if (!empty($login)) { - SetCookie("lastloginid",$login, time() + (24 * 3600 * 14),"/"); - } - return $lastloginid; + + if ($code != 5) { + return $lastloginid; } } @@ -77,28 +74,28 @@ /* Program starts here */ if ($deny_login) { - deny_login(); + deny_login(); } if ($submit) { if (getenv(REQUEST_METHOD) != "POST") { - Header("Location: " . $phpgw->link("", "code=5")); + Header("Location: " . $phpgw->link("", "code=5")); } $sessionid = $phpgw->session->create($login,$passwd); - if (!$sessionid) { - Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=5"); + if (! $sessionid) { + Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=5"); } else { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]) . "/", "cd=yes"); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]) . "/", "cd=yes"); } } else { if ($last_loginid) { - $phpgw->db->query("select value from preferences where owner='$last_loginid' " - . "and name='lang'"); - $phpgw->db->next_record(); - if (! $phpgw->db->f("value")) { - $users_lang = "en"; + $phpgw->db->query("select value from preferences where owner='$last_loginid' " + . "and name='lang'"); + $phpgw->db->next_record(); + if (! $phpgw->db->f("value")) { + $users_lang = "en"; // } else { // $users_lang = $phpgw->db->f("value"); // include($phpgw_info["server"]["include_root"] . "/lang/$users_lang/" . $users_lang @@ -107,6 +104,7 @@ } } $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("cd",check_logoutcode($cd)); $tmpl->set_var("cookie",show_cookie()); $tmpl->set_var("lang_username",lang_login("username"));