|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 function xmldb_auth_ldap_install() { 00004 global $CFG, $DB; 00005 00006 // upgrade from 1.9.x, introducing version.php 00007 00008 // remove cached passwords, we do not need them for this plugin, but only if internal 00009 if (get_config('auth/ldap', 'preventpassindb')) { 00010 $DB->set_field('user', 'password', 'not cached', array('auth'=>'ldap')); 00011 } 00012 00013 // We kept the LDAP version used to connect to the server in 00014 // $config->version. In 2.0, $config->version is overwritten with 00015 // the plugin version number, so we need to change the setting 00016 // name. Let's call it 'ldap_version' and remove the old setting. 00017 // 00018 // This works by pure luck, as the plugin version number is stored in 00019 // config_plugins table before we get called. The good news is the new 00020 // version number is stored for 'auth_ldap' plugin name, while the old ldap 00021 // version setting is stored for 'auth/ldap' plugin name. Yay! 00022 if ($ldap_version = get_config('auth/ldap', 'version')) { 00023 set_config('ldap_version', $ldap_version, 'auth/ldap'); 00024 unset_config('version', 'auth/ldap'); 00025 } 00026 }