Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed bug 1801

Untested on mysql, but should work with out problems.
  • Loading branch information...
commit c14964b025c0a21c19f0b032559def933d9a71a1 1 parent 3fbffaf
authored
12  lib/db/mysql.php
@@ -830,6 +830,18 @@ function main_upgrade($oldversion=0) {
830 830
         }
831 831
     }
832 832
 
  833
+    if ($oldversion < 2004082600) {
  834
+        //update auth-fields for external users
  835
+        include_once ($CFG->dirroot."/auth/".$CFG->auth."/lib.php");
  836
+        if (function_exists('auth_get_userlist')) {
  837
+            $externalusers = auth_get_userlist();
  838
+            if (!empty($externalusers)){
  839
+                $externalusers = '\''. implode('\',\'',$externalusers).'\'';
  840
+                execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE username  IN ($externalusers)");
  841
+            }
  842
+        }
  843
+    }
  844
+
833 845
     return $result;
834 846
 
835 847
 }
14  lib/db/postgres7.php
@@ -563,7 +563,19 @@ function main_upgrade($oldversion=0) {
563 563
             execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE id NOT IN ($adminlist)");
564 564
         }
565 565
     }
566  
-
  566
+    
  567
+    if ($oldversion < 2004082600) {
  568
+        //update auth-fields for external users
  569
+        include_once ($CFG->dirroot."/auth/".$CFG->auth."/lib.php");
  570
+        if (function_exists('auth_get_userlist')) {
  571
+            $externalusers = auth_get_userlist();
  572
+            if (!empty($externalusers)){
  573
+                $externalusers = '\''. implode('\',\'',$externalusers).'\'';
  574
+                execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE username  IN ($externalusers)");
  575
+            }
  576
+        }
  577
+    }
  578
+        
567 579
     return $result;
568 580
 
569 581
 }
2  version.php
@@ -5,7 +5,7 @@
5 5
 // database to determine whether upgrades should
6 6
 // be performed (see lib/db/*.php)
7 7
 
8  
-$version = 2004082300;   // The current version is a date (YYYYMMDDXX)
  8
+$version = 2004082600;   // The current version is a date (YYYYMMDDXX)
9 9
 
10 10
 $release = "1.5 development";   // User-friendly version number
11 11
 

0 notes on commit c14964b

Please sign in to comment.
Something went wrong with that request. Please try again.