]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16180 - better checking of mnet support in mahara portfolio plugin (and removed...
authormjollnir_ <mjollnir_>
Tue, 2 Sep 2008 15:43:55 +0000 (15:43 +0000)
committermjollnir_ <mjollnir_>
Tue, 2 Sep 2008 15:43:55 +0000 (15:43 +0000)
portfolio/type/mahara/lib.php

index aa1089431e960f65f7f2976a1d865424b115a9ca..b0ef8c87e83fbf1c51099e40b03d17db03de5722 100644 (file)
@@ -47,16 +47,13 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
         }
         $mform->addElement('select', 'mnethostid', get_string('mnethost', 'portfolio_mahara'), $hosts);
         $mform->addRule('mnethostid', $strrequired, 'required', null, 'client');
-        if ($errorcode = self::plugin_sanity_check()) {
-            return $errorcode; // processing stops when we return a string.
-        }
-        if (!empty($this) && $errorcode = $this->instance_sanity_check()) {
-            return $errorcode;
-        }
     }
 
     public function instance_sanity_check() {
         // make sure the host record exists since we don't have referential integrity
+        if (!is_enabled_auth('mnet')) {
+            return PORTFOLIO_MAHARA_ERR_NOMNETAUTH;
+        }
         try {
             $this->ensure_mnethost();
         }
@@ -83,9 +80,6 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
         if (!self::get_mnet_hosts()) {
             $errorcode =  PORTFOLIO_MAHARA_ERR_NOHOSTS;
         }
-        if (!empty($errorcode)) { // disable the plugins // @todo
-            $DB->set_field('portfolio_instance', 'visible', 0, array('plugin' => 'mahara'));
-        }
         return $errorcode;
     }