OK a number of small changes here.

Firstly, I'm replacing all use of old-style global variables like
$HTTY_REFERER with their new-style equivalent $_SERVER["HTTP_REFERER"]
Also using $_POST instead $HTTP_POST_VARS  etc

Secondly, if gdversion == 0 (ie GD is not installed) then:

 - users are not even allowed to upload new images
 - graphs now just print a message instead of failing.

this allows Moodle to still be used even if GD is not present
This commit is contained in:
moodler
2003-01-05 06:45:20 +00:00
parent 3b7c1de95e
commit 607809b3ba
25 changed files with 147 additions and 95 deletions
+4 -4
View File
@@ -17,14 +17,14 @@
}
if (isset($course) && isset($HTTP_POST_VARS)) { // add or update form submitted
if (isset($_POST["course"])) { // add or update form submitted
if (isset($SESSION->modform)) { // Variables are stored in the session
$mod = $SESSION->modform;
unset($SESSION->modform);
save_session("SESSION");
} else {
$mod = (object)$HTTP_POST_VARS;
$mod = (object)$_POST;
}
require_login($mod->course);
@@ -118,7 +118,7 @@
error("Could not cache module information!");
}
redirect($HTTP_REFERER);
redirect($_SERVER["HTTP_REFERER"]);
exit;
} else if (isset($delete)) { // value = course module
@@ -218,7 +218,7 @@
} else if (isset($add)) {
if (!$add) {
redirect($HTTP_REFERER);
redirect($_SERVER["HTTP_REFERER"]);
die;
}