Fixed up cancel button on module editing page to avoid error

when returning to course page.

Fix by Scott Elliott.
This commit is contained in:
moodler
2003-08-08 16:46:16 +00:00
parent ee23f384bf
commit 072426e0c1
+7 -7
View File
@@ -7,6 +7,13 @@
require_login();
if (isset($SESSION->modform)) { // Variables are stored in the session
$mod = $SESSION->modform;
unset($SESSION->modform);
} else {
$mod = (object)$_POST;
}
if (isset($cancel)) {
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
@@ -20,13 +27,6 @@
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);
} else {
$mod = (object)$_POST;
}
if (!isteacher($mod->course)) {
error("You can't modify this course!");
}