. /** * Upgrade script. * * @package auth_userkey * @copyright 2018 Dmitrii Metelkin (dmitriim@catalyst-au.net) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Upgrade hook. * * @param string $oldversion Old version of the plugin. * @return bool */ function xmldb_auth_userkey_upgrade($oldversion) { global $DB; if ($oldversion < 2018050200) { // Confirm all previously created users. $DB->execute("UPDATE {user} SET confirmed=? WHERE auth=?", array(1, 'userkey')); upgrade_plugin_savepoint(true, 2018050200, 'auth', 'userkey'); } return true; }