| 841 | | // $LCAS_users est maintenant un tableau associatif où la clé est le compte tel qu'enregistré en DB, |
| 842 | | // et la valeur est ce même compte, écrit selon LCAS_change_case() pour la règle en cours |
| 843 | | |
| 844 | | $user_found = array_search($username, $LCAS_users); |
| 845 | | // $user_found vaut false si le username actuellement testé ne fait pas partie des valeurs de $LCAS_users ; |
| 846 | | // sinon $user_found vaut la clé dans $LCAS_users, correspondant au compte trouvé. |
| 847 | | // Donc le compte tel qu'écrit en DB, mais reconnu tel qu'écrit selon LCAS_change_case() pour la règle en cours |
| 848 | | |
| 849 | | $username = ($user_found === false) ? $username : $user_found; |
| 850 | | |
| 851 | | return isset($username) ? $username : ''; |
| | 839 | // $LCAS_users is now an associative table where the key is the account as |
| | 840 | // registered in the DB, and the value is this same account, in lower case |
| | 841 | |
| | 842 | $users_found = array_keys($LCAS_users, $username_c); |
| | 843 | // $users_found is now a table of which the values are all the accounts |
| | 844 | // which can be written in lowercase the same way as $username |
| | 845 | if (count($users_found) != 1) // If ambiguous, don't allow lowercase writing |
| | 846 | return $username; // but normal writing will work |
| | 847 | else |
| | 848 | return $users_found[0]; |