Skip to content

Commit

Permalink
MDL-23245 Fixed plugin type of auth_mnet in config_plugins table
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Jul 13, 2010
1 parent 6ad4b78 commit 94cf0a1
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 7 deletions.
2 changes: 1 addition & 1 deletion admin/mnet/access_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$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)) {
Expand Down
8 changes: 4 additions & 4 deletions auth/mnet/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -154,7 +154,7 @@ function start_jump_session($mnethostid, $wantsurl, $wantsurlbackhere=false) {
// 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
Expand Down Expand Up @@ -679,11 +679,11 @@ function process_config($config) {
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;
}
Expand Down
47 changes: 47 additions & 0 deletions auth/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @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;
}
2 changes: 1 addition & 1 deletion auth/mnet/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

$plugin->version = 2010021800;
$plugin->version = 2010071300;
2 changes: 1 addition & 1 deletion enrol/mnet/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function enrol_user($user, $courseid) {

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
*/
Expand Down

0 comments on commit 94cf0a1

Please sign in to comment.