]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed a bug. When replying to an email copy, you would be forwarded
authormartin <martin>
Sun, 8 Sep 2002 15:39:44 +0000 (15:39 +0000)
committermartin <martin>
Sun, 8 Sep 2002 15:39:44 +0000 (15:39 +0000)
to the login screen to login first.  However, this was being saved
as the place to go back to after replying.

I added a check for this so now it behaves as you'd expect.

mod/forum/lib.php

index 2f27c45c584186b9ad38dd89d0e4ffb98e1dbb33..08e9f0fba51f8581e3218f9add772db424624cec 100644 (file)
@@ -413,11 +413,14 @@ function forum_count_unrated_posts($discussionid, $userid) {
 
 
 function forum_set_return() {
-    global $SESSION, $HTTP_REFERER;
+    global $CFG, $SESSION, $HTTP_REFERER;
 
-    if (! $SESSION->fromdiscussion) {
-        $SESSION->fromdiscussion = $HTTP_REFERER;
-        save_session("SESSION");
+    if (! isset($SESSION->fromdiscussion)) {
+        // If the referer is NOT a login screen then save it.
+        if (! strncasecmp("$CFG->wwwroot/login", $HTTP_REFERER, 300)) {
+            $SESSION->fromdiscussion = $HTTP_REFERER;
+            save_session("SESSION");
+        }
     }
 }