mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-30610 remove outdated auth upgrade code
This commit is contained in:
parent
2117dcb591
commit
5ea41be1b3
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
@ -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'));
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user