From: paca70 Date: Thu, 26 Aug 2004 13:45:26 +0000 (+0000) Subject: Fixed bug 1801 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c14964b025c0a21c19f0b032559def933d9a71a1;p=moodle.git Fixed bug 1801 Untested on mysql, but should work with out problems. --- diff --git a/lib/db/mysql.php b/lib/db/mysql.php index cfc0648cc5..8c6d438810 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -830,6 +830,18 @@ function main_upgrade($oldversion=0) { } } + if ($oldversion < 2004082600) { + //update auth-fields for external users + include_once ($CFG->dirroot."/auth/".$CFG->auth."/lib.php"); + if (function_exists('auth_get_userlist')) { + $externalusers = auth_get_userlist(); + if (!empty($externalusers)){ + $externalusers = '\''. implode('\',\'',$externalusers).'\''; + execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE username IN ($externalusers)"); + } + } + } + return $result; } diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 1ad354a2a3..146f5fb6b0 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -563,7 +563,19 @@ function main_upgrade($oldversion=0) { execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE id NOT IN ($adminlist)"); } } - + + if ($oldversion < 2004082600) { + //update auth-fields for external users + include_once ($CFG->dirroot."/auth/".$CFG->auth."/lib.php"); + if (function_exists('auth_get_userlist')) { + $externalusers = auth_get_userlist(); + if (!empty($externalusers)){ + $externalusers = '\''. implode('\',\'',$externalusers).'\''; + execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE username IN ($externalusers)"); + } + } + } + return $result; } diff --git a/version.php b/version.php index c87869ad65..3970e83353 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2004082300; // The current version is a date (YYYYMMDDXX) +$version = 2004082600; // The current version is a date (YYYYMMDDXX) $release = "1.5 development"; // User-friendly version number