Skip to content

Commit

Permalink
MDL-30610 remove outdated auth upgrade code
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Dec 23, 2011
1 parent 2117dcb commit 5ea41be
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 125 deletions.
18 changes: 0 additions & 18 deletions auth/cas/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,4 @@
function xmldb_auth_cas_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'cas'));

// We kept the LDAP version used to connect to the server in
// $config->version. In 2.0, $config->version is overwritten with
// the plugin version number, so we need to change the setting
// name. Let's call it 'ldap_version' and remove the old setting.
//
// This works by pure luck, as the plugin version number is stored in
// config_plugins table before we get called. The good news is the new
// version number is stored for 'auth_cas' plugin name, while the old ldap
// version setting is stored for 'auth/cas' plugin name. Yay!
if ($ldap_version = get_config('auth/cas', 'version')) {
set_config('ldap_version', $ldap_version, 'auth/cas');
unset_config('version', 'auth/cas');
}
}
8 changes: 0 additions & 8 deletions auth/db/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,4 @@
function xmldb_auth_db_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin, but only if internal
$type = get_config('auth/db', 'passtype');
if ($type and $type !== 'internal') {
$DB->set_field('user', 'password', 'not cached', array('auth'=>'db'));
}

}
5 changes: 0 additions & 5 deletions auth/fc/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_fc_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'fc'));

}
5 changes: 0 additions & 5 deletions auth/imap/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_imap_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'imap'));

}
20 changes: 0 additions & 20 deletions auth/ldap/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,4 @@
function xmldb_auth_ldap_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin, but only if internal
if (get_config('auth/ldap', 'preventpassindb')) {
$DB->set_field('user', 'password', 'not cached', array('auth'=>'ldap'));
}

// We kept the LDAP version used to connect to the server in
// $config->version. In 2.0, $config->version is overwritten with
// the plugin version number, so we need to change the setting
// name. Let's call it 'ldap_version' and remove the old setting.
//
// This works by pure luck, as the plugin version number is stored in
// config_plugins table before we get called. The good news is the new
// version number is stored for 'auth_ldap' plugin name, while the old ldap
// version setting is stored for 'auth/ldap' plugin name. Yay!
if ($ldap_version = get_config('auth/ldap', 'version')) {
set_config('ldap_version', $ldap_version, 'auth/ldap');
unset_config('version', 'auth/ldap');
}
}
21 changes: 0 additions & 21 deletions auth/manual/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,5 @@
function xmldb_auth_manual_upgrade($oldversion) {
global $CFG, $DB, $OUTPUT;

if ($oldversion < 2011022700) {
// force creation of missing passwords
$createpassword = hash_internal_user_password('');
$rs = $DB->get_recordset('user', array('password'=>$createpassword, 'auth'=>'manual'));
foreach ($rs as $user) {
if (validate_email($user->email)) {
$DB->set_field('user', 'password', 'to be created', array('id'=>$user->id));
unset_user_preference('auth_forcepasswordchange', $user);
set_user_preference('create_password', 1, $user);
}
}
$rs->close();
upgrade_plugin_savepoint(true, 2011022700, 'auth', 'manual');
}

// Moodle v2.1.0 release upgrade line
// Put any upgrade step following this

// Moodle v2.2.0 release upgrade line
// Put any upgrade step following this

return true;
}
5 changes: 0 additions & 5 deletions auth/mnet/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_mnet_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'mnet'));

}
18 changes: 0 additions & 18 deletions auth/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,5 @@
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');
}

// Moodle v2.1.0 release upgrade line
// Put any upgrade step following this

// Moodle v2.2.0 release upgrade line
// Put any upgrade step following this

return true;
}
5 changes: 0 additions & 5 deletions auth/nntp/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_nntp_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'nntp'));

}
5 changes: 0 additions & 5 deletions auth/pam/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_pam_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'pam'));

}
5 changes: 0 additions & 5 deletions auth/pop3/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_pop3_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'pop3'));

}
5 changes: 0 additions & 5 deletions auth/radius/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_radius_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'radius'));

}
5 changes: 0 additions & 5 deletions auth/shibboleth/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
function xmldb_auth_shibboleth_install() {
global $CFG, $DB;

// upgrade from 1.9.x, introducing version.php

// remove cached passwords, we do not need them for this plugin
$DB->set_field('user', 'password', 'not cached', array('auth'=>'shibboleth'));

}

0 comments on commit 5ea41be

Please sign in to comment.