From 5ce0456d47fe5191c8c4cd2e4e6da81e7346a8f1 Mon Sep 17 00:00:00 2001 From: skeeter Date: Thu, 9 Nov 2000 13:21:36 +0000 Subject: [PATCH] cleanup of warnings --- index.php | 23 +++++++++++++++-------- login.php | 15 ++++++++------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/index.php b/index.php index a5c8addbc2..c9d2f9aa8d 100755 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ /* $Id$ */ - if (! $sessionid) { + if (!isset($sessionid) || !$sessionid) { Header("Location: login.php"); exit; } @@ -43,7 +43,10 @@ . ""; } - if ($phpgw_info["user"]["apps"]["admin"] && $phpgw_info["server"]["checkfornewversion"]) { + if ((isset($phpgw_info["user"]["apps"]["admin"]) && + $phpgw_info["user"]["apps"]["admin"]) && + (isset($phpgw_info["server"]["checkfornewversion"]) && + $phpgw_info["server"]["checkfornewversion"])) { $phpgw->network->set_addcrlf(False); if ($phpgw->network->open_port("phpgroupware.org",80,30)) { $phpgw->network->write_port("GET /currentversion HTTP/1.0\nHOST: www.phpgroupware.org\n\n"); @@ -75,14 +78,18 @@ Open notify window'; - switch($code){ - case "5": - echo lang("You do not have permissions to that application"); - break; + if(isset($code) && $code){ + switch($code){ + case "5": + echo lang("You do not have permissions to that application"); + break; + } } - if ($phpgw_info["user"]["apps"]["email"] - && $phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"]) { + if ((isset($phpgw_info["user"]["apps"]["email"]) && + $phpgw_info["user"]["apps"]["email"]) && + (isset($phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"]) && + $phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"])) { echo "\n"; $mbox = $phpgw->msg->login(); diff --git a/login.php b/login.php index c121851b70..4c339e243f 100755 --- a/login.php +++ b/login.php @@ -29,6 +29,7 @@ } */ $deny_login = False; + $tmpl = new Template($phpgw_info["server"]["template_dir"]); $tmpl->set_file(array("login_form" => "login.tpl", @@ -51,7 +52,7 @@ { global $phpgw_info, $code, $lastloginid, $login; /* This needs to be this way, because if someone doesnt want to use cookies, we shouldnt sneak one in */ - if ($code != 5 && $phpgw_info["server"]["usecookies"] == True){ + if ($code != 5 && (isset($phpgw_info["server"]["usecookies"]) && $phpgw_info["server"]["usecookies"])){ if (!empty($login)) { SetCookie("lastloginid",$login, time() + (24 * 3600 * 14),"/"); } @@ -88,20 +89,20 @@ deny_login(); } - if ($submit) { + if (isset($submit) && $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 (!isset($sessionid) || !$sessionid) { + Header("Location: ".$phpgw_info["server"]["webserver_url"]."/login.php?cd=5"); } else { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php", "cd=yes")); + Header("Location: ".$phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php", "cd=yes")); } } else { - if ($last_loginid) { + if (isset($last_loginid) && $last_loginid) { $phpgw->db->query("select account_id from accounts where account_lid='$last_loginid'"); $phpgw->db->next_record();