Page 1 of 1

Usernames may only contain....

Posted: Fri Apr 13, 2018 9:07 am
by TBT
Usernames may only contain alphanumeric characters, an underscore (_) or a hyphen (-) in Fusion 4.1.3, is there a way to allow "." in usernames?

Re: Usernames may only contain....

Posted: Fri Apr 13, 2018 10:08 am
by cnorell
Hey TBT,

If you would like to allow periods in usernames, you can modify the following file:

Code: Select all

/usr/local/nagiosfusion/html.admin.users.php
Go to line 276 and you should see the following code:

Code: Select all

    if (!empty($username) && !preg_match('/^[A-Za-z0-9\_\-]*$/', $username))
        $errmsg .= _('Usernames may only contain alphanumeric characters, an underscore (_) or a hyphen (-).');
To allow periods in usernames, change the above code to:

Code: Select all

    if (!empty($username) && !preg_match('/^[A-Za-z0-9\_\-\.]*$/', $username))
        $errmsg .= _('Usernames may only contain alphanumeric characters, an underscore (_), a period (.) or a hyphen (-).');
All of that being said, I have to give the disclaimer that these changes will be reverted on upgrade if that feature is not added on our end in the next release, so you will have to go back in and modify the file again.

I also cannot guarantee that nothing will be affected by that change. I don't foresee anything being broken by that change, but I also haven't tested it extensively.

Re: Usernames may only contain....

Posted: Fri Apr 13, 2018 10:11 am
by TBT
Understood. Thank you.

Re: Usernames may only contain....

Posted: Fri Apr 13, 2018 10:48 am
by lmiltchev
@TBT, is it safe to lock this topic? Thanks!

Re: Usernames may only contain....

Posted: Fri Apr 13, 2018 11:15 am
by TBT
lmiltchev wrote:@TBT, is it safe to lock this topic? Thanks!
Yes, thanks.