Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.0.7, 3.1, 3.1.3
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MDL-57193-master-notest -
-
Easy
-
Description
On line 307 in /auth/db/auth.php We chunk the users up into groups of 10,000. Apparently to stop some databases from crashing.
The issue is if you have remove users setup (suspend or delete) it will catch every user if you have more than 10,000 users...
If there are 11,000 users it will get the first 10,000 and say "if the user in moodle isn't in this list add them to the remove user list" - there go the 1,000 users who should be left in the system. Then on the second loop it will grab the last 1,000 users and say "if the users in the db are not in this list remove them" - obviously the 1,000 users in the list got deleted in the previous loop and the ones that were found in the first pass were deleted in the second pass...
For people with this issue the first thing to do immediately is change 10000 on line 307 to a number far higher than the number of users you currently have, until this is fixed.