]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed bug 1801
authorpaca70 <paca70>
Thu, 26 Aug 2004 13:45:26 +0000 (13:45 +0000)
committerpaca70 <paca70>
Thu, 26 Aug 2004 13:45:26 +0000 (13:45 +0000)
Untested on mysql, but should work with out problems.

lib/db/mysql.php
lib/db/postgres7.php
version.php

index cfc0648cc562517adf0f92f84802123a9360fee0..8c6d438810c3746fc849e746d8c3c6f381f37ef5 100644 (file)
@@ -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;
 
 }
index 1ad354a2a3252df07a70470084ceb953e3ccc0b0..146f5fb6b0a2d96530e57db91ea2e7b2792ea0b8 100644 (file)
@@ -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;
 
 }
index c87869ad656425e5f77da576090678dd8a1a7adb..3970e83353607022dbf6262430bd32ac4f7f2e61 100644 (file)
@@ -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