MDL-30722 mod_forum: prevented users being auto-logged in as guest when they access...
authorAndrew Davis <andrew@moodle.com>
Fri, 23 Dec 2011 05:28:08 +0000 (12:28 +0700)
committerAndrew Davis <andrew@moodle.com>
Tue, 31 Jan 2012 02:03:40 +0000 (09:03 +0700)
mod/forum/unsubscribeall.php

index 4bf4aa2..a425c6b 100644 (file)
@@ -27,8 +27,10 @@ require_once("lib.php");
 $confirm = optional_param('confirm', false, PARAM_BOOL);
 
 $PAGE->set_url('/mod/forum/unsubscribeall.php');
+$PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
 
-require_login();
+// Do not autologin guest. Only proper users can have forum subscriptions.
+require_login(null, false);
 
 $return = $CFG->wwwroot.'/';