Avatar

Warning: Non-US characters in user name (General)

by Auge ⌂ @, Thursday, May 04, 2017, 06:28 (20 days ago) @ danielb987

Hello

Very good. But I think that the SQL query that changes the user_name field to utf8_bin should be run before the duplicate test. By doing that, Daniel and Däniel would be different usernames.

*grmpf* Yes, you are right.

Second, the user_name field needs to have a UNIQUE index.

The operation would fail, if there are (for wich reason ever) duplicates. Therefore the check has to be performed before the unique index take place. One step after the other. :-)

If we find duplicates, we should show a list of all the duplicates and a link to the administrator control panel to edit the user name:
http://www.example.com/forum/index.php?mode=admin&edit_user=18

That's, what the prototype adumbrates. If there are rows in the result (if (mysqli_num_rows($connid, $resCountNames) > 0)) the script will render a list of the non-unique names. At the moment it lacks a link to the admin interface for user handling (by the way: a good idea).

This list should show the user id, user name and email address, since the user id is the only thing that is guaranteed unique and the email address is usefull if the administrator wants to contact the user. In order to do this, we need to do a second SQL query for each duplicate user name.

This might be doable in a single query. If we create a list, we can enrich this one list with all necessary informations.

Thank you so far for your useful input.

Tschö, Auge

--
further development of mlf1


Complete thread:

 RSS Feed of thread

powered by my little forum