Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Using email addresses as agent user names


When upgrading to 1.9.15 a while ago I imported all of our existing users from our original 1.6 installation. These all had their email addresses as their usernames. However, when adding new users or editing existing ones, email addresses are no longer allowed as usernames. I could alter the code but, without doing so, is there a way that we can?




  • This does not appear to be a suggestion or feedback. Moving to Troubleshooting and Problems.

    I honestly don't know what you mean.  When i import users I dont set a username (note: I'm using the LDAP/AD plugin), but when i click create new users I don't even have a username field.  People can use their email address (or you can edit the user after the fact and add a username which they could then also use to log in).  It sounds to me like you are making things more difficult than they need to be.
  • My apologies if my initial post was not clear.

    In version 1.6 all agents' user names were their email addresses: the validation process had no issues with that.

    When I upgraded from 1.6 to 1.9.15 (via 1.7.5) these user names were imported into the MySQL database table:


    However, in 1.9.15, when I come to edit one of these agent accounts the edit fails because the validation of the username fails: it fails the check in the Validator::is_username() function.

    I was assuming that this should not be so - i.e. that email addresses are valid user names) - and was hoping that there would be a configuration setting that would allow email addresses to be used for agents' user names. I have fixed the problem by modifying the Validator::is_username() function (in class.validator.php) to check for a valid email address before checking for invalid characters.

    if (filter_var($username, FILTER_VALIDATE_EMAIL)) {
      // Do nothing
    } elseif (!preg_match('/^[\p{L}\d._-]+$/u', $username)) {
       $error = __('Username is an invalid email address or it contains invalid characters');

    however, I thought that I shouldn't have to do this.

Sign In or Register to comment.