mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-20948 proper removal of cached pasword hashes just in case upgrading from <1.9.7
This commit is contained in:
parent
bdebf74c76
commit
e79781f72e
7 changed files with 48 additions and 0 deletions
|
@ -576,6 +576,9 @@ class auth_plugin_db extends auth_plugin_base {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function is_internal() {
|
function is_internal() {
|
||||||
|
if (!isset($this->config->passtype)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ($this->config->passtype == 'internal');
|
return ($this->config->passtype == 'internal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
auth/db/db/install.php
Normal file
14
auth/db/db/install.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
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
auth/db/version.php
Normal file
3
auth/db/version.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$plugin->version = 2009112400;
|
11
auth/fc/db/install.php
Normal file
11
auth/fc/db/install.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
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
auth/fc/version.php
Normal file
3
auth/fc/version.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$plugin->version = 2009112400;
|
11
auth/imap/db/install.php
Normal file
11
auth/imap/db/install.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
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
auth/imap/version.php
Normal file
3
auth/imap/version.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$plugin->version = 2009112400;
|
Loading…
Add table
Add a link
Reference in a new issue