Widespread changes throughout Moodle to make sure it works on
servers that have register_globals turned off (this is the
default setting on newer version of PHP).
In fact it's partly a hack that globalises all GET, POST, FILES
AND COOKIE variables. Unfortunately though the SESSION and
USER global session variables are only available as $_SESSION["USER"]
and $_SESSION["SESSION"], which is cumbersome to use.
So, for every request I now make a copy of these two session variables
into $USER and $SESSION. Whenever I update them thoughout Moodle I
now have to call save_session("USER") which copies them back to the
session variable. This seems to be working well now.
Because I'm using $_SESSION etc now this will raise
the required minimum version of PHP to 4.1.0
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
if ($SESSION->returnpage) {
|
||||
$return = $SESSION->returnpage;
|
||||
unset($SESSION->returnpage);
|
||||
save_session("SESSION");
|
||||
redirect($return);
|
||||
} else {
|
||||
redirect("view.php?id=$mod->course");
|
||||
@@ -79,6 +80,7 @@
|
||||
|
||||
if (isset($return)) {
|
||||
$SESSION->returnpage = $HTTP_REFERER;
|
||||
save_session("SESSION");
|
||||
}
|
||||
|
||||
if (isset($move)) {
|
||||
|
||||
Reference in New Issue
Block a user