Edit user information: valid ldap uid with minus not editable
Current behavior / Resultado actual / Résultat actuel
An LDAP user with uid test-account is registered (including the dash - character) The chamilo admin wants to edit the user data to make him teacher (or add picture)
Expected behavior / Resultado esperado / Résultat attendu
Should work but chamilo now says: only letters and digits allowed.

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire
Use an ldap user with a minus-character in the uid and try it. Or edit login in mysql to add a special char that is allowed in ldap but not in Chamilo. Then try editing it.
Chamilo Version / Versión de Chamilo / Version de Chamilo
1.11.4 and newer
Fix it by adding the dash to the allowed USERNAME_PURIFIER regex in main/inc/lib/api.lib.php
define('USERNAME_PURIFIER', '/[^0-9A-Za-z_.-]/'); // added - to allow dash in usernames
This depends on your policy for usernames in LDAP. We're not too keen on adding the possibility for usernames in Chamilo to include a dash. Thank to your feedback, I think this issue can be closed and remain as a type of documentation on the process. Feel free to contribute this additional help to the Chamilo documentation at https://github.com/chamilo/docs/tree/1.11.x (you can see it as a manual on https://docs.chamilo.org/