Sorry to open up an older thread, but I have a similar situation, where a php search gives back fewer attributes, than when i do the same search in command line.
I have read about the ports and double checked that. I feel certain there is a difference in the searches, but don’t know what exactly the problem is. I have removed my actual server name, basedn and username.
univention-ldapsearch -h ldaps://my.ser.ver -p 7636 uid=username gives back what I am searching for, for example the attribute “mailAlternativeAddress”
Note: Command line
univention-ldapsearch -h ldaps://my.ser.ver -p 7636 cn=username returns no result.
In php, I have tested with this code now. It returns 38 attributes, but for example not “mailAlternativeAddress”:
$ldap_conn = ldap_connect( 'ldaps://my.ser.ver', '7636' ) or die("Sorry! Could not connect to LDAP server");
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0 );
$result = ldap_bind( $ldap_conn, 'Administrator@ser.ver', 'PasswordHere' ) or die(" Error: Couldn't bind to server using provided credentials");
$result = ldap_search($ldap_conn,"dc=ser,dc=ver", "(cn=username)"); //WHY cn
// $result = ldap_search($ldap_conn,"dc=ser,dc=ver", "(uid=username)"); NO RESULT
$info = ldap_get_entries($ldap_conn,$result);
Would be great if anyone can shed a light upon this. Thank you in advance.
EDIT: I don’t think it will make any difference, but the scripts are running (in a mixed environment) on as member with UCS 4.4, querying a primary with UCS 5.