Loading...
 
LDAP / Active directory

LDAP / Active directory


Re: LDAP Tracker Field: How does it work?

Looking for more data on this also.

Using lib/ldap/ldaplib.php as an example, I have created the following test script:

Copy to clipboard
require_once ('lib/adodb/adodb.inc.php'); $user = 'aduser'; $dsn = 'ldap://ldap-user:ldap-password@ldap.contoso.com/ou=Domain Users,DC=contoso,DC=com'; $filter = "(|(CN=$user*)(sn=$user*)(givenname=$user*)(uid=$user*))"; $field = 'sn'; // Try to connect $ldaplink = ADONewConnection($dsn); $return = null; if (!$ldaplink) { // Wrong DSN $return = "BAD DSN"; } $ldaplink->SetFetchMode(ADODB_FETCH_ASSOC); $rs = $ldaplink->Execute($filter); if ($rs) { while ($arr = $rs->FetchRow()) { if (isset($arr[$field])) { $return = $arr[$field]; break; } } } $ldaplink->Close(); echo "VALUE: [" . $return . "]";


The script runs (on Tiki server) as expected, returning the users last name.

DSN has been created in Tiki to match LDAP DSN above.
Created tracker with LDAP field and set 'Filter' and 'Field' as above.

Not sure on the syntax used to replace '$user' with the user field from the tracker but correct value is not displayed even if the user id is hardcoded into the Filter.

LDAP authentication is enabled and works correctly.

Currently running Tiki 10.2

There are no comments at this time.

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting