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:
+7
-7
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user