Usernames may only contain....

This support forum board is for questions relating to Nagios Fusion.
Locked
TBT
Posts: 609
Joined: Wed May 18, 2011 1:26 pm

Usernames may only contain....

Post 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?
Nagios XI 5.7.5 (9 Servers)
Nagios Fusion 4.1.9
cnorell
Developer
Posts: 54
Joined: Mon Nov 27, 2017 3:08 pm

Re: Usernames may only contain....

Post 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.
TBT
Posts: 609
Joined: Wed May 18, 2011 1:26 pm

Re: Usernames may only contain....

Post by TBT »

Understood. Thank you.
Nagios XI 5.7.5 (9 Servers)
Nagios Fusion 4.1.9
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Usernames may only contain....

Post by lmiltchev »

@TBT, is it safe to lock this topic? Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 609
Joined: Wed May 18, 2011 1:26 pm

Re: Usernames may only contain....

Post by TBT »

lmiltchev wrote:@TBT, is it safe to lock this topic? Thanks!
Yes, thanks.
Nagios XI 5.7.5 (9 Servers)
Nagios Fusion 4.1.9
Locked