Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Duplicate usernames issue still happening which creates a SQL Error For New OAuth users #1054

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

Had the following error below in the log file. Username "Karīna" already exists in the database and that is why "Karina" username could not be created . It is an issue with accents in the username (which I thought I fixed before) with #931 )

Note: I tested and the regular user account creation does work for this (accents) so it is just an OAUTH user account creation issue.

Sat 04 Apr 2020 06:27:33 EDT - 105.112.97.239 - 1062: Duplicate entry 'Karina' for key 'users_username' in /system/lib-user.php:297. SQL in question: INSERT INTO gl_users (username,email,regdate,cookietimeout,fullname,remoteusername,remoteservice) VALUES ('Karina','karinado@test.com','2020-04-04 06:27:33','28800','Karina','115786203662210706048','oauth.google')  
Sat 04 Apr 2020 06:27:33 EDT - 105.112.97.239 - E_USER_ERROR(256) - An SQL error has occurred. Please see error.log for details. @ /system/databases/mysqli.class.php line 468  
eSilverStrike commented 4 years ago

Also trims username now if larger than 16 characters (since that is all the room we have) and then check for duplicates. Tested using a Facebook OAuth account and it seems to work.