From 73553ddbaaaada9d9d9524aab5bbd5629a0e1034 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 7 Dec 2011 09:14:44 +0100 Subject: [PATCH] MDL-30623 fix password upgrade path from 1.9 --- enrol/guest/db/install.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 enrol/guest/db/install.php diff --git a/enrol/guest/db/install.php b/enrol/guest/db/install.php new file mode 100644 index 00000000000..c5e8c68d8f4 --- /dev/null +++ b/enrol/guest/db/install.php @@ -0,0 +1,35 @@ +. + +/** + * Guest enrol plugin installation. + * + * @package enrol + * @subpackage guest + * @copyright 2011 Petr Skoda {@link http://skodak.org} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +function xmldb_enrol_guest_install() { + global $CFG, $DB; + + // migrate settings during 2.0 upgrade + + // convert all null passwords to empty strings + $DB->set_field('enrol', 'password', '', array('enrol'=>'guest', 'password'=>null)); +}