Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug 1801

Untested on mysql, but should work with out problems.
  • Loading branch information...
commit c14964b025c0a21c19f0b032559def933d9a71a1 1 parent 3fbffaf
paca70 authored
Showing with 26 additions and 2 deletions.
  1. +12 −0 lib/db/mysql.php
  2. +13 −1 lib/db/postgres7.php
  3. +1 −1  version.php
View
12 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;
}
View
14 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;
}
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.