From b0482154d89c8d86accb586dbe4e670d07cef8e9 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Tue, 2 Sep 2008 15:43:55 +0000 Subject: [PATCH] MDL-16180 - better checking of mnet support in mahara portfolio plugin (and removed unnecessary sanity check code that's handled by the main portfolio api) --- portfolio/type/mahara/lib.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/portfolio/type/mahara/lib.php b/portfolio/type/mahara/lib.php index aa1089431e..b0ef8c87e8 100644 --- a/portfolio/type/mahara/lib.php +++ b/portfolio/type/mahara/lib.php @@ -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; } -- 2.39.5