草庐IT

ldap_search

全部标签

PHP imap_search 未检测到 gmail 收件箱中的所有邮件

当我在我的GMail收件箱上运行一个非常简单的imap_search时,搜索返回的邮件少于应有的邮件。这是任何拥有GMail帐户的人都可以运行的脚本。$host='{imap.gmail.com:993/imap/ssl}';$user='foo';$pass='bar';$imapStream=imap_open($host,$user,$pass)ordie(imap_last_error());$messages=imap_search($imapStream,"ALL");echocount($messages);imap_close($imapStream);这将返回39条消

php - 外来字符和 LDAP。 LDAP 期望什么编码/字符集?

我正在使用simplexml_load_string()解析XML,并使用其中的数据通过LDAP更新ActiveDirectory(AD)对象。示例XML(简化):BìlböBággįnšGãńdåłfThêGręâtŚāmWīšë我首先运行ldap_search()来查找单个用户,然后继续更改他们的属性。使用LDAP将上述值直接输入AD会导致出现一些非常困惑的字符。例如:BìlböBággįnÅ¡我尝试了以下功能,但无济于事:utf8_encode($str);utf8_decode($str);iconv("UTF-8","ISO-8859-1//TRANSLIT",$st

php array_search 具有多个命中的单个数组

我正在做一个日历,每天可能有超过1个事件与日期匹配。目前我很困惑如何发现比array_search的第一个匹配项更多的内容。这是我现在正在做的事情。if(array_search($date_today,$event_start)!==FALSE){$date_match=array_search($date_today,$event_start);$name=$event_name[$date_match];}我能否使用“while”或“foreach”语句推进array_search以查找多个匹配项?如果它很重要,我的日期变量是像1368680400这样的日期。

php - 专有名称的 ldap 过滤器

我正在使用以下代码成功查询我们的ActiveDirectory以查找用户:$filter=(&(objectCategory=person)(samaccountname=someusername));$fields=array("samaccountname","mail","manager","department","displayname","objectGUID");$user=ldap_search($ldapconnection,$baseDn,$filter,$fields);结果数组为manager属性提供了这个值:CN=McBossy\,Boss,OU=Users,

php - ldap_mod_replace() [function.ldap-mod-replace] : Modify: Server is unwilling to perform

出现错误:Serverisunwillingtoperform同时通过PHP在AD中更改unicodePwd。但是,我能够搜索、添加、删除和修改用户的任何属性。使用Administrator账号绑定(bind),admin拥有修改任何用户密码的全部权限。这是我使用的代码: 最佳答案 要通过LDAP在AD中设置密码,您需要做很多事情才能完全正确。您需要使用SSL连接(ldaps://)密码需要用引号括起来(引用的)密码需要以16位unicode(UTF-16LE)编码假设你试图设置的密码是普通的ascii字符,unicode转换可以通

PHP array_search 始终返回数组的第一个键

这个问题在这里已经有了答案:PHPin_array()/array_search()oddbehaviour(2个答案)关闭6年前。我最近注意到在我的代码中使用array_search函数时出现问题。我在数组“$allcraftatts”中搜索值“sharp”。我试图通过设置两行实验来隔离问题:$testcopy=$allcraftatts;$testsharp=array_search("sharp",$testcopy);使用“print_r(get_defined_vars());”稍后,我得到了这个结果:[testcopy]=>Array([0]=>0[1]=>0[2]=>0[

php - PHP 中的 LDAP 身份验证 - 在不提供密码的情况下进行身份验证

我的LDAP身份验证出现奇怪的行为,我需要这个来使用他们的AD凭据对用户进行身份验证,这就是我所拥有的:session_start();$adServer="MYIP";$ldapconn=ldap_connect($adServer)or$this->msg="CouldnotconnecttoLDAPserver.";$ldaprdn="DOMAIN\\".$_POST["username"];$ldapbind=ldap_bind($ldapconn,$ldaprdn,$_POST["password"]);if($ldapbind){//$msg="SuccessfullyAu

php - httpd libphp5.so ldap错误

SolvedbyJulzThankyou!$brewuninstallphp56$brewinstallphp56--without-ldap所以,我需要一些帮助,我环顾四周,但找不到任何解决问题的方法。我已经通过Homebrew安装了Apache和PHP,但由于某些原因它们似乎不能一起工作。Apache通过Homebrew/apachetap安装httpd24--enable-rewrite--enable-ssl--with-privileged-ports--with-http2PHP通过Homebrew/homebrew-phptapphp56--with-homebrew-a

php - 仅使用 SamAccountName 和密码从 PHP 使用 LDAP 验证用户?

当我只有SamAccountName和密码时,如何使用LDAP从PHP进行身份验证?有没有一种方法可以只绑定(bind)SamAccountName和密码而不绑定(bind)专有名称。我发现的唯一示例假设您拥有DN:$server="XXX.XXX.XXX.XXX";$dn="cn=$username,";$basedn="ou=users,ou=accounts,dc=domain,dc=com";if(!($connect=ldap_connect($server))){die("CouldnotconnecttoLDAPserver");}if(!($bind=ldap_bind

php - 尝试获取用户数据时 LDAP 上的错误搜索过滤器

我刚开始使用LDAP,如果我以完全错误的方式进行此操作,请告诉我。我正在使用bhLDAPAuthPlugin插件使用Symfony1.4我正在使用LDAP验证用户登录。但是,我想使用用户名查询LDAP表中的更多数据。所以我正在编写这个搜索功能来根据用户名过滤结果:functionuser_values($username){if(!$username){die("Usernameisnotthereman!");}if(!$this->_conn){die("NoConnection.");}if(!$this->_base_dn){die("NoBase.");}$filter="s