PHP:为什么 LDAP 过滤器不适用于 "_"符号?

标签 php ldap

关于从 ldap 服务器获取信息,我需要你的建议。 我的过滤器很简单,但不起作用!

'filter' => "(u_someinfo=*)"

我发现过滤器名称中的符号“_”会生成错误“Bad search filter”。 如果我写这样的代码:

'filter' => "(usomeinfo=*)"

即使 usomedata 在 ldap 中不存在,它也能正常工作! 可能必须有一些方法来解决它,但我不能做什么? 那么,有什么想法吗?

最佳答案

我从未在属性名称中看到过下划线;我认为属性中不允许使用下划线。

我发现了这个... https://www.rfc-editor.org/rfc/rfc2251#section-4.1.4

从阅读的角度来看,我认为只允许使用字母、数字和连字符。我也不记得曾经见过连字符。我个人只使用字母和数字来创建属性名称。

A specification may also assign one or more textual names for an attribute type. These names MUST begin with a letter, and only contain ASCII letters, digit characters and hyphens. They are case insensitive.

关于PHP:为什么 LDAP 过滤器不适用于 "_"符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28575719/

相关文章:

ldap - 使用UNBoundID SDK重置AD密码

php - Laravel 5 - 更新模型不会立即更新关系

shell - 如何在非交互模式下配置 pam-auth-update?

PHPExcel - 如何舍入值?

php - 这个 if 语句的含义 [if (condition) : something; endif;]

ruby - Heroku 上的 LDAP 服务器?

php - Symfony:针对 LDAP 服务器对用户进行身份验证,但仅当用户名位于自定义数据库表中时才允许登录

c++ - Qt定义类似于-D的变量

php - 错误: Unknown column in 'where clause'

javascript - 使用ajax控制复选框 Action