From: moodler Date: Sat, 11 Jan 2003 03:03:54 +0000 (+0000) Subject: Closing sessions may fix some problems on WIndows/CGI systems ... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bee00f48aaf4353a724e9014547b65342f7b2366;p=moodle.git Closing sessions may fix some problems on WIndows/CGI systems ... --- diff --git a/login/index.php b/login/index.php index 9c7560382d..edbc2906f5 100644 --- a/login/index.php +++ b/login/index.php @@ -20,11 +20,11 @@ } - if ($frm = data_submitted()) { + if ($frm = data_submitted()) { $user = authenticate_user_login($frm->username, $frm->password); - update_login_count(); + update_login_count(); if ($user) { if (! $user->confirmed ) { // they never confirmed via email @@ -50,22 +50,26 @@ error("Wierd error: could not update login records"); } - set_moodle_cookie($USER->username); + set_moodle_cookie($USER->username); if (user_not_fully_set_up($USER)) { $site = get_site(); - header("Location: $CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id"); + session_write_close(); + header("Location: $CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id"); } else if (empty($SESSION->wantsurl)) { - header("Location: $CFG->wwwroot"); + session_write_close(); + header("Location: $CFG->wwwroot"); - } else { - header("Location: $SESSION->wantsurl"); - unset($SESSION->wantsurl); + } else { + $wantsurl = $SESSION->wantsurl; + unset($SESSION->wantsurl); save_session("SESSION"); - } + session_write_close(); + header("Location: $wantsurl"); + } - reset_login_count(); + reset_login_count(); die; @@ -80,7 +84,7 @@ } if (empty($SESSION->wantsurl)) { - $SESSION->wantsurl = $_SERVER["HTTP_REFERER"]; + $SESSION->wantsurl = $_SERVER["HTTP_REFERER"]; save_session("SESSION"); }