简体   繁体   English

比较LDAP GUID与LDAP,获得ldap_get_entries的GUID?

[英]Comparing the LDAP GUID with LDAP, getting GUID with ldap_get_entries?

I want to use the GUID from LDAP accounts to identify these accounts in an application. 我想使用LDAP帐户中的GUID在应用程序中标识这些帐户。 I don't get it binary safe. 我没有二进制安全。 If I compare these GUIDs with PHP with == , the result is true; 如果我将这些GUID与带有== PHP进行比较,则结果为true; if I use === , the result is false. 如果我使用=== ,则结果为false。

I thought this is the reason that I get no result. 我以为这是我没有结果的原因。 If I search which phpldap after the GUID. 如果我在GUID之后搜索哪个phpldap。

I got the GUID with this code: 我得到了带有以下代码的GUID:

$justthese = array("ou", "sn", "givenname", "mail", "pager","objectGUID");            
$sr=ldap_search($ad, $basedn, $filter, $justthese);            
$info = ldap_get_entries($ad, $sr);

After that, I save the vars in a MySQL database. 之后,我将vars保存在MySQL数据库中。 I've read that I should use ldap_get_values_len , but I don't know how to implement this in a query with multiple results. 我读过我应该使用ldap_get_values_len ,但是我不知道如何在具有多个结果的查询中实现这一点。

The output looks similar to the from ldap_get_entries . 输出看起来与ldap_get_entries相似。

Am I only able to transform the result from ldap_get_entries (guid) , and am I able to compare these with LDAP? 我只能转换ldap_get_entries (guid)的结果,并且可以将它们与LDAP进行比较吗? Or, do I have to use ldap_get_values_len , and how do I do that? 或者,我必须使用ldap_get_values_len ,该怎么做?

Consider comparing LDAP attribute values with matching rules instead of language comparison operators. 考虑将LDAP属性值与匹配规则而不是语言比较运算符进行比较。

see also 也可以看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM