Is there admin toggle that will prevent new users from being created with a duplicate idnumber in the mdl_users table.
Before going off and customizing our code it would be nice to know if something like this already exists or if it could be added.
We have many returning graduate students who take time off and then return. To prevent duplicate records it would be nice if the index of the mdl_user table could block the creation of duplicate users.
Here is my sql code to find duplicates in this table:
# Users with Duplicate ID in the mdl_user table.
SELECT
username, idnumber, email, deleted, suspended, lastname, firstname
FROM
mdl_user
WHERE
idnumber
IN
(
SELECT
idnumber
FROM
(
SELECT
idnumber,
COUNT
(*) cnt
FROM
mdl_user
GROUP
BY
idnumber
HAVING
cnt > 1
and
cnt < 20 )
AS
DUPS
)
ORDER
BY
idnumber;