]> git.mjollnir.org Git - moodle.git/commitdiff
Closing sessions may fix some problems on WIndows/CGI systems ...
authormoodler <moodler>
Sat, 11 Jan 2003 03:03:54 +0000 (03:03 +0000)
committermoodler <moodler>
Sat, 11 Jan 2003 03:03:54 +0000 (03:03 +0000)
login/index.php

index 9c7560382deb305447add41704ea36c1bf50d3a4..edbc2906f5846aafab55d38558487fcbbd9f9978 100644 (file)
     }
 
 
-       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 
                 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");
     }