From 54b7cd7c605e34143a79ee08b15d99a338144970 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 10 Jun 2003 15:42:51 +0000 Subject: [PATCH] Changed get_records (every field) in user_check_backup to get_records (only id). Possible memory shortage when a lot of users (3999) are retrieved. --- backup/backuplib.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backup/backuplib.php b/backup/backuplib.php index 54d6c41476..6697f482c4 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -38,18 +38,16 @@ 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."
"; - $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."
"; $info[0][0] = get_string("users"); $info[0][1] = $count_users; -$db->debug=false; return $info; } -- 2.39.5