]> git.mjollnir.org Git - moodle.git/commitdiff
fixed problem when saving module settings
authorskodak <skodak>
Thu, 16 Mar 2006 10:11:06 +0000 (10:11 +0000)
committerskodak <skodak>
Thu, 16 Mar 2006 10:11:06 +0000 (10:11 +0000)
admin/module.php

index f9545c7aa0a0790860844e25e50cf60ade28b8d6..efc5c765132e9968aa31ee58d2d086672ec8e22d 100644 (file)
@@ -3,8 +3,6 @@
 
     require_once('../config.php');
 
-    $module = required_param('module', PARAM_SAFEDIR);
-
     require_login();
 
     if (!isadmin()) {
         error("Site isn't defined!");
     }
 
-    require_once("$CFG->dirroot/mod/$module/lib.php");
-
 /// If data submitted, then process and store.
 
     if ($config = data_submitted()) {
+        $module = optional_param('module', '', PARAM_SAFEDIR);
 
         if (!confirm_sesskey()) {
             error(get_string('confirmsesskeybad', 'error'));
         }
 
-        if ($module) {
+        if ($module != '') {
+            require_once("$CFG->dirroot/mod/$module/lib.php");
             // if the config.html contains a hidden form field giving
             // the module name then the form does not have to prefix all
             // its variable names, we will do it here.
@@ -48,6 +46,8 @@
     }
 
 /// Otherwise print the form.
+    $module = required_param('module', PARAM_SAFEDIR);
+    require_once("$CFG->dirroot/mod/$module/lib.php");
 
     $stradmin = get_string("administration");
     $strconfiguration = get_string("configuration");