From 5ea41be1b3891ecb89ba7843316b8c9b22a09dd3 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 6 Dec 2011 09:03:41 +0100 Subject: [PATCH] MDL-30610 remove outdated auth upgrade code --- auth/cas/db/install.php | 18 ------------------ auth/db/db/install.php | 8 -------- auth/fc/db/install.php | 5 ----- auth/imap/db/install.php | 5 ----- auth/ldap/db/install.php | 20 -------------------- auth/manual/db/upgrade.php | 21 --------------------- auth/mnet/db/install.php | 5 ----- auth/mnet/db/upgrade.php | 18 ------------------ auth/nntp/db/install.php | 5 ----- auth/pam/db/install.php | 5 ----- auth/pop3/db/install.php | 5 ----- auth/radius/db/install.php | 5 ----- auth/shibboleth/db/install.php | 5 ----- 13 files changed, 125 deletions(-) diff --git a/auth/cas/db/install.php b/auth/cas/db/install.php index 6fed36db4a9..f9f437850e1 100644 --- a/auth/cas/db/install.php +++ b/auth/cas/db/install.php @@ -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'); - } } diff --git a/auth/db/db/install.php b/auth/db/db/install.php index 93704bf696d..e5fdb345d6d 100644 --- a/auth/db/db/install.php +++ b/auth/db/db/install.php @@ -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')); - } - } diff --git a/auth/fc/db/install.php b/auth/fc/db/install.php index 53be4b4d213..543f4f0140d 100644 --- a/auth/fc/db/install.php +++ b/auth/fc/db/install.php @@ -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')); - } diff --git a/auth/imap/db/install.php b/auth/imap/db/install.php index 9f43278a0b4..37b3c09d9f8 100644 --- a/auth/imap/db/install.php +++ b/auth/imap/db/install.php @@ -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')); - } diff --git a/auth/ldap/db/install.php b/auth/ldap/db/install.php index 1f44cf227c1..cb914f7241f 100644 --- a/auth/ldap/db/install.php +++ b/auth/ldap/db/install.php @@ -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'); - } } diff --git a/auth/manual/db/upgrade.php b/auth/manual/db/upgrade.php index 21fead8086b..31fd9752440 100644 --- a/auth/manual/db/upgrade.php +++ b/auth/manual/db/upgrade.php @@ -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; } diff --git a/auth/mnet/db/install.php b/auth/mnet/db/install.php index 4f17f6d2bb0..236f7dda5b5 100644 --- a/auth/mnet/db/install.php +++ b/auth/mnet/db/install.php @@ -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')); - } diff --git a/auth/mnet/db/upgrade.php b/auth/mnet/db/upgrade.php index 43d279162c0..3d535e00bda 100644 --- a/auth/mnet/db/upgrade.php +++ b/auth/mnet/db/upgrade.php @@ -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; } diff --git a/auth/nntp/db/install.php b/auth/nntp/db/install.php index bfca5565125..18d66b9a14a 100644 --- a/auth/nntp/db/install.php +++ b/auth/nntp/db/install.php @@ -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')); - } diff --git a/auth/pam/db/install.php b/auth/pam/db/install.php index 1e94b9fb584..c519486c2a4 100644 --- a/auth/pam/db/install.php +++ b/auth/pam/db/install.php @@ -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')); - } diff --git a/auth/pop3/db/install.php b/auth/pop3/db/install.php index d5cc2dd6cac..0bd3df65fbc 100644 --- a/auth/pop3/db/install.php +++ b/auth/pop3/db/install.php @@ -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')); - } diff --git a/auth/radius/db/install.php b/auth/radius/db/install.php index 5387cef44f7..9423db7ea39 100644 --- a/auth/radius/db/install.php +++ b/auth/radius/db/install.php @@ -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')); - } diff --git a/auth/shibboleth/db/install.php b/auth/shibboleth/db/install.php index 3033583142b..2836b3b4195 100644 --- a/auth/shibboleth/db/install.php +++ b/auth/shibboleth/db/install.php @@ -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')); - }