Unable to create AD users via API

This support forum board is for questions relating to Nagios Fusion.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Unable to create AD users via API

Post by hbouma »

Thank you.

Unfortunately, we cannot allow users to have any way to log in locally, so the work around will not work for us. I guess I will have to manually add the few hundred users myself.
jwilli89
Posts: 1
Joined: Mon Mar 26, 2018 3:36 pm

Re: Unable to create AD users via API

Post by jwilli89 »

When is the next release of Fusion expected - that will include fix for this issue?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to create AD users via API

Post by lmiltchev »

The next release of Fusion should be released soon, but you won't need to wait. I have a workaround for you (for the second issue). Create a backup of the /usr/local/nagiosfusion/html/includes/utils/users.inc.php file. Open the original file in a text editor and change the following section of code (around line 160) from this:

Code: Select all

// check if this user is set to skip_local auth
    $skip_local = (bool) get_user_attr('skip_local', $user_id);

    // always allow nagiosadmin to login via local
    if ($skip_local && /*$user_id != 1 &&*/ $username != 'nagiosadmin') {
        $debug[] = CHECKCRED_FAILED_SKIPLOCAL;
        $error = $default_error;
        return false;
    }
to this:

Code: Select all

// check if this user is set to skip_local auth
    $skip_local = (bool) get_user_attr('skip_local', $user_id);
    $allow_local = get_user_meta('allow_local', $user_id, 0);

    // always allow nagiosadmin to login via local
    if (($skip_local || !$allow_local) && $username != 'nagiosadmin') {
        $debug[] = CHECKCRED_FAILED_SKIPLOCAL;
        $error = $default_error;
        return false;
    }
Basically, you will be adding one line and modifying another one.

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked