]> git.mjollnir.org Git - moodle.git/commitdiff
Changed get_records (every field) in user_check_backup to
authorstronk7 <stronk7>
Tue, 10 Jun 2003 15:42:51 +0000 (15:42 +0000)
committerstronk7 <stronk7>
Tue, 10 Jun 2003 15:42:51 +0000 (15:42 +0000)
get_records (only id). Possible memory shortage when a lot
of users (3999) are retrieved.

backup/backuplib.php

index 54d6c41476263e3ab069bf228c080a71f77f4773..6697f482c45ed80387c4338cc1098d25ed22c81e 100644 (file)
         global $CFG;
         global $db;
 
-$db->debug=true;
-
         $count_users = 0;
         
-        //Select all users from user
-        $users = get_records ("user");
+        //Select all users from user (only id)
+        //If there are a lot of users and we retrieve all the info->memory shortage !!
+        $users = get_records ("user","","","","id,id");
         //If we have users
         if ($users) {
             //Iterate over users putting their roles
             foreach ($users as $user) {
-echo $user->id."<br>";
-                   $user->info = "";
+                $user->info = "";
                 //Is Admin in tables (not is_admin()) !!
                 if (record_exists("user_admins","userid",$user->id)) {
                     $user->info .= "admin";
@@ -97,7 +95,6 @@ echo $user->id."<br>";
         $info[0][0] = get_string("users");
         $info[0][1] = $count_users;
 
-$db->debug=false;
         return $info;
     }