|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 function xmldb_auth_cas_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 00009 $DB->set_field('user', 'password', 'not cached', array('auth'=>'cas')); 00010 00011 // We kept the LDAP version used to connect to the server in 00012 // $config->version. In 2.0, $config->version is overwritten with 00013 // the plugin version number, so we need to change the setting 00014 // name. Let's call it 'ldap_version' and remove the old setting. 00015 // 00016 // This works by pure luck, as the plugin version number is stored in 00017 // config_plugins table before we get called. The good news is the new 00018 // version number is stored for 'auth_cas' plugin name, while the old ldap 00019 // version setting is stored for 'auth/cas' plugin name. Yay! 00020 if ($ldap_version = get_config('auth/cas', 'version')) { 00021 set_config('ldap_version', $ldap_version, 'auth/cas'); 00022 unset_config('version', 'auth/cas'); 00023 } 00024 }