Skip to content

Commit

Permalink
MDL-23371 reverting last commit in this file, this was most probably …
Browse files Browse the repository at this point in the history
…unintentional copy/paste from cas plugin - we need to act quickly because this was breaking installs
  • Loading branch information
skodak committed Jul 26, 2010
1 parent 5605789 commit ab0c6f1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions auth/ldap/db/install.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php

function xmldb_auth_cas_install() {
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
$DB->set_field('user', 'password', 'not cached', array('auth'=>'cas'));
// 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
Expand All @@ -15,10 +17,10 @@ function xmldb_auth_cas_install() {
//
// 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');
// 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');
}
}

0 comments on commit ab0c6f1

Please sign in to comment.