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