diff --git a/index.php b/index.php index dddfdadfb3..d84311c892 100755 --- a/index.php +++ b/index.php @@ -63,6 +63,12 @@ Open notify window'; + switch($code){ + case "5": + echo lang("You do not have permissions to that application"); + break; + } + if ($phpgw_info["user"]["permissions"]["email"] && $phpgw_info["user"]["preferences"]["mainscreen_showmail"]) { echo "\n"; @@ -90,7 +96,7 @@ echo "\n"; $phpgw->db->query("select DISTINCT firstname,lastname from addressbook where " . "bday like '" . $phpgw->common->show_date(time(),"n/d") - . "/%' and (owner='" . $phpgw->session->loginid . "' or access='" + . "/%' and (owner='" . $phpgw_info["user"]["userid"] . "' or access='" . "public')"); while ($phpgw->db->next_record()) { echo "" . lang_common("Today is x's birthday!", $phpgw->db->f("firstname") . " " @@ -102,7 +108,7 @@ $phpgw->common->show_date(time(),"Y")),"n/d" ); $phpgw->db->query("select firstname,lastname from addressbook where " . "bday like '$tommorow/%' and (owner='" - . $phpgw->session->loginid . "' or access='public')"); + . $phpgw_info["user"]["userid"] . "' or access='public')"); while ($phpgw->db->next_record()) { echo "" . lang_common("Tommorow is x's birthday.", $phpgw->db->f("firstname") . " " . $phpgw->db->f("lastname")) . "\n"; @@ -119,10 +125,10 @@ && $phpgw_info["user"]["preferences"]["mainscreen_showevents"]) { echo "\n"; include($phpgw_info["server"]["server_root"] . "/calendar/inc/functions.inc.php"); - $repeated_events = read_repeated_events($phpgw->session->loginid); + $repeated_events = read_repeated_events($phpgw_info["user"]["userid"]); $phpgw->db->query("select count(*) from webcal_entry,webcal_entry_user" . " where cal_date='" . $phpgw->common->show_date(time(),"Ymd") - . "' and (webcal_entry_user.cal_login='" . $phpgw->session->loginid + . "' and (webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' and webcal_entry.cal_id = webcal_entry_user.cal_id) and " . "(cal_priority='3')"); $phpgw->db->next_record(); diff --git a/login.php b/login.php index e33e6947d0..e6faa12b1e 100755 --- a/login.php +++ b/login.php @@ -50,16 +50,21 @@ function check_logoutcode($code) { - if ($code == "1") { - return lang_login("You have been successfully logged out"); - } - else if ($code == "2") { - return lang_login("Sorry, your login has expired"); - } - else if ($code == "5") { - return "" . lang_login("Bad login or password") . ""; - } - else { + global $phpgw_info; + switch($code){ + case "1": + return lang_login("You have been successfully logged out"); + break; + case "2": + return lang_login("Sorry, your login has expired"); + break; + case "5": + return "" . lang_login("Bad login or password") . ""; + break; + case "10": + return "" . lang_login("Your session could not be verified.") . ""; + break; + default: return " "; } } @@ -72,17 +77,15 @@ if ($submit) { if (getenv(REQUEST_METHOD) != "POST") { - Header("Location: " . $phpgw->link("", "cd=5")); + Header("Location: " . $phpgw->link("", "code=5")); } - if (!($phpgw->auth->authenticate($login, $passwd))) { + $sessionid = $phpgw->session->create($login,$passwd); + if (!$sessionid) { Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=5"); } else { - // Make sure the server allows us to use cookies - if (! $phpgw_info["server"]["usecookies"]) { - $usecookies = False; - } - $phpgw->session->create($phpgw->db->f("loginid"),$passwd, $usecookies); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]) . "/", "cd=yes"); + } // Create the users private_dir if not exist /* @@ -92,12 +95,15 @@ if(!is_dir($basedir . $phpgw->db->f("loginid"))) mkdir($basedir . $phpgw->db->f("loginid"), 0707); */ -// Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] -// . "/", $usecookies)); + +/* + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/", $usecookies)); Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/", "cd=yes")); exit; } +*/ } else { if ($last_loginid) { $phpgw->db->query("select value from preferences where owner='$last_loginid' " @@ -128,4 +134,4 @@ $tmpl->parse("login2out","login2"); $tmpl->parse("loginout", "login"); $tmpl->p("loginout"); -?> +?> \ No newline at end of file