MDL-23245 Fixed plugin type of auth_mnet in config_plugins table

This commit is contained in:
David Mudrak 2010-07-13 11:14:29 +00:00
parent 6ad4b78fcf
commit 94cf0a1e56
5 changed files with 54 additions and 7 deletions

View File

@ -130,7 +130,7 @@ if (!is_enabled_auth('mnet')) {
$warn .= '<p>' . get_string('authmnetdisabled','mnet').'</p>';
}
if (get_config('auth/mnet', 'auto_add_remote_users') != true) {
if (get_config('auth_mnet', 'auto_add_remote_users') != true) {
$warn .= '<p>' . get_string('authmnetautoadddisabled','mnet').'</p>';
}
if (!empty($warn)) {

View File

@ -28,7 +28,7 @@ class auth_plugin_mnet extends auth_plugin_base {
*/
function auth_plugin_mnet() {
$this->authtype = 'mnet';
$this->config = get_config('auth/mnet');
$this->config = get_config('auth_mnet');
$this->mnet = get_mnet_environment();
}
@ -154,7 +154,7 @@ class auth_plugin_mnet extends auth_plugin_base {
// set RPC timeout to 30 seconds if not configured
// TODO: Is this needed/useful/problematic?
if (empty($this->config->rpc_negotiation_timeout)) {
set_config('rpc_negotiation_timeout', '30', 'auth/mnet');
set_config('rpc_negotiation_timeout', '30', 'auth_mnet');
}
// get the host info
@ -679,11 +679,11 @@ class auth_plugin_mnet extends auth_plugin_base {
if (!isset ($config->auto_add_remote_users)) {
$config->auto_add_remote_users = '0';
} See MDL-21327 for why this is commented out
set_config('auto_add_remote_users', $config->auto_add_remote_users, 'auth/mnet');
set_config('auto_add_remote_users', $config->auto_add_remote_users, 'auth_mnet');
*/
// save settings
set_config('rpc_negotiation_timeout', $config->rpc_negotiation_timeout, 'auth/mnet');
set_config('rpc_negotiation_timeout', $config->rpc_negotiation_timeout, 'auth_mnet');
return true;
}

47
auth/mnet/db/upgrade.php Normal file
View File

@ -0,0 +1,47 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Keeps track of upgrades to the auth_mnet plugin
*
* @package auth
* @subpackage mnet
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_auth_mnet_upgrade($oldversion) {
global $CFG, $DB, $OUTPUT;
// fix the plugin type in config_plugins table
if ($oldversion < 2010071300) {
if ($configs = $DB->get_records('config_plugins', array('plugin' => 'auth/mnet'))) {
foreach ($configs as $config) {
unset_config($config->name, $config->plugin);
set_config($config->name, $config->value, 'auth_mnet');
}
}
unset($configs);
upgrade_plugin_savepoint(true, 2010071300, 'auth', 'mnet');
}
return true;
}

View File

@ -1,3 +1,3 @@
<?php
$plugin->version = 2010021800;
$plugin->version = 2010071300;

View File

@ -300,7 +300,7 @@ class enrolment_plugin_mnet {
if ($userrecord == false) {
$userrecord = mnet_strip_user((object)$user, mnet_fields_to_import($remoteclient));
/* there used to be a setting in auth/mnet called auto_create_users
/* there used to be a setting in auth_mnet called auto_add_remote_users
* which we should have been checking here (but weren't).
* this setting has now been removed. See MDL-21327
*/