Skip to content
Permalink
Browse files

Fixed up cancel button on module editing page to avoid error

when returning to course page.

Fix by Scott Elliott.
  • Loading branch information...
moodler
moodler committed Aug 8, 2003
1 parent ee23f38 commit 072426e0c1e89f4443cb47f829b2e2c6155e83d1
Showing with 7 additions and 7 deletions.
  1. +7 −7 course/mod.php
@@ -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!");
}

0 comments on commit 072426e

Please sign in to comment.
You can’t perform that action at this time.