Domains Plugin Problems

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
finnsen
Posts: 1
Joined: Mon Jan 17, 2011 6:05 am

Domains Plugin Problems

Post by finnsen »

Hello,

i´m trying to authenticate a lot of Users which are in different Ldap Groups against Cacti.
Without the Domains Plugin everything works fine for me but i need the multiple Domains.

Unfortunately i´m not able to authenticate with the same Configuration i use in the default Ldap Authentication settings.
It seems that the authenticaction is still using the default ldap authentication settings because if i left the configuration untouched, i can choose any Ldap Domain from the Plugin but he still tries to authenticact against the default one.

If i delete the default Configuration i don´t see any Traffic to the ldap server neither.

I am using Cacti 0.8.7.g with PIA 2.8 on an RH EL5 x64 with Apache 2.2.3

Hope anyone has experience with this Problem.
Thanks in Advance
User avatar
alphp
Posts: 3
Joined: Sun Feb 27, 2011 11:52 am

Re: Domains Plugin Problems

Post by alphp »

Modify setup.php
In function domains_ldap_auth have to comment the following line (#263):

Code: Select all

if (!empty($ld["dn"]))                $ldap->dn                = $ld["dn"];
A better solution, reorder some lines:

Code: Select all

function domains_ldap_auth($username, $password = "", $dn = "", $realm) {
    $ld = db_fetch_row("SELECT * FROM plugin_domains_ldap WHERE domain_id=" . ($realm-1000));

    if (sizeof($ld)) {
        $ldap = new Ldap;

        if (!empty($username))                $ldap->username          = $username;
        if (!empty($password))                $ldap->password          = $password;
        if (!empty($ld["dn"]))                $ldap->dn                = $ld["dn"];
        if (!empty($dn))                      $ldap->dn                = $dn;
        if (!empty($ld["server"]))            $ldap->host              = $ld["server"];
        if (!empty($ld["port"]))              $ldap->port              = $ld["port"];
        if (!empty($ld["port_ssl"]))          $ldap->port_ssl          = $ld["port_ssl"];
        if (!empty($ld["proto_version"]))     $ldap->version           = $ld["proto_version"];
        if (!empty($ld["encryption"]))        $ldap->encryption        = $ld["encryption"];
        if (!empty($ld["referrals"]))         $ldap->referrals         = $ld["referrals"];
        if (!empty($ld["group_require"]))     $ldap->group_require     = $ld["group_require"];
        if (!empty($ld["group_dn"]))          $ldap->group_dn          = $ld["group_dn"];
        if (!empty($ld["group_attrib"]))      $ldap->group_attrib      = $ld["group_attrib"];
        if (!empty($ld["group_member_type"])) $ldap->group_member_type = $ld["group_member_type"];

        return $ldap->Authenticate();
    }else{
        return false;
    }
}
Attachments
domains-v0.1-1patch.diff.gz
A patch file, in domains plugin dir: patch -p1 < /path/to/domains-v0.1-1patch.diff
(475 Bytes) Downloaded 131 times
User avatar
alphp
Posts: 3
Joined: Sun Feb 27, 2011 11:52 am

Re: Domains Plugin Problems

Post by alphp »

The setup.php contains some bug's.

I have fixed it, tomorrow I'm post a patch.
hinchoi
Posts: 2
Joined: Wed Sep 10, 2014 2:26 am

Re: Domains Plugin Problems

Post by hinchoi »

Hi Alphp,

I need to do the multi group authenticaiton, in cacti system, I had tried your patch file to setup.php, but still can't work. it is still get the default ldap one. please assist. thanks in advance :-? :-?
hinchoi
Posts: 2
Joined: Wed Sep 10, 2014 2:26 am

Re: Domains Plugin Problems

Post by hinchoi »

HI

Who else can help me !!!!! please ...... thank you....
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests