Extend Superfecta LDAP lookup

hidalgo

Member
Joined
Sep 13, 2011
Messages
50
Reaction score
0
I’m playing around with a PIAF purple and the Superfecta 2.2.5beta. Now I tried the LDAP source. I works fine but I’d like to have more infos than only the "cn". My LDAP server is Mac OS X 10.6 Server and I have attributes like: apple-company, sn, givenName.
If the caller has an entry in apple-company, i.e.. is a company not a person, I’d like to have shown something like apple-company - sn
How to do that?

Thanks a lot.
 
I’m playing around with a PIAF purple and the Superfecta 2.2.5beta. Now I tried the LDAP source. I works fine
Glad that it works for you, I have only bench tested this in my lab, so a working report from the wild is welcome news :D

...but I’d like to have more infos than only the "cn". My LDAP server is Mac OS X 10.6 Server and I have attributes like: apple-company, sn, givenName.
If the caller has an entry in apple-company, i.e.. is a company not a person, I’d like to have shown something like apple-company - sn
How to do that?

Thanks a lot.
Line 110 hard codes an array of elements to return e.g. "cn"

We could test for apple-company and return different results. Is apple-company only set for company records, or will it be on all records ?

To see what elements you have to play with, change the "cn" array to
Code:
array(debug ? '*' : 'cn')
 
@lgaetz

Thanks a lot. It would be nice to have the choice to choose the fields to show up. Also the search (ou=, dc= …) should be free to enter. Not all LDAP servers has ous. ;-)
 
Also the search (ou=, dc= …) should be free to enter. Not all LDAP servers has ous. ;-)
The OU is optional, just leave it blank if not required.

For v3.0 I have added a drop down list for different formats e.g.
  1. cn
  2. givenname sn
  3. sn, givenname
Are there any other formats you may require ?
 
Yes. ;-)
I would like to choose the fields depending the content of others.
In my case: if the field "apple-company" is not empty, show "apple-company - sn", else show "cn" or something like this.

Ok. I was wrong. The script contains the line:
Code:
$bd=@ldap_bind($ad, "cn={$run_param['LDAP_User']}, {$dc}", "{$run_param['LDAP_Password']}") or die ("Could not bind to {$scheme}://{$server}");
and I had to modify because of the hard coded "cn=", so I have now
Code:
$bd=@ldap_bind($ad, "{$run_param['LDAP_User']}","{$run_param['LDAP_Password']}") or die ("Could not bind to {$scheme}://{$server}");
This was the issue I talked about.
 
Yes. ;-)
I would like to choose the fields depending the content of others.
In my case: if the field "apple-company" is not empty, show "apple-company - sn", else show "cn" or something like this.
OK, I will look into that for you.

Ok. I was wrong. The script contains the line:
Code:
$bd=@ldap_bind($ad, "cn={$run_param['LDAP_User']}, {$dc}", "{$run_param['LDAP_Password']}") or die ("Could not bind to {$scheme}://{$server}");
and I had to modify because of the hard coded "cn=", so I have now
Code:
$bd=@ldap_bind($ad, "{$run_param['LDAP_User']}","{$run_param['LDAP_Password']}") or die ("Could not bind to {$scheme}://{$server}");
This was the issue I talked about.
After looking at the PHP function reference, could you try to bind with
Code:
$bd=@ldap_bind($ad, "uid={$run_param['LDAP_User']},cn=users, {$dc}", "{$run_param['LDAP_Password']}")
 
This works also.
I'm waiting thrilled about the coming version.
 
This works also.
I'm waiting thrilled about the coming version.
Thanks for the feedback, I have added an option in v3 to switch between "Open LDAP" and "Apple Open Directory" methods for connecting.

v3 also adds the a drop down list of formats to use including "apple-company - sn" and "o - sn" which should catch most business entries hopefully.
If there are any problems parsing results, the "cn" entry is returned.

If there is enough noise generated I could always backport to 2.2.5, but I would prefer to carry on trying to get v3 ready.
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top