chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Edit user information: valid ldap uid with minus not editable

Open jderriks opened this issue 9 years ago • 2 comments

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. afbeelding

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

jderriks avatar May 12 '17 21:05 jderriks

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

jderriks avatar Feb 26 '18 19:02 jderriks

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/

ywarnier avatar Mar 09 '18 14:03 ywarnier