简单的ldap浏览器php版

这是用php写的ldap浏览器,您可以从这个程序中了解到如何用php来访问ldap. if(!isset($host)) $host = localhost; if(!isset($port)) $port = 389; if(!isset($dn)) $dn = dc=my-domain,dc=com; if(!isset($filter)) $filter = objectclass=*; $con = ldap_connect($host,$port) or die(ldap_connect error); echo .chr(13); //read this object $rst = ldap_read($con,$dn,$filter) or die(ldap_read error); $entry = ldap_first_entry($con,$rst) or die(ldap_first_entry error); echo $dn.:.chr(13); $attrs = ldap_get_attributes($con,$entry); $attrs_count = $attrs[count]; for($i=0;$i

Posted in 未分类

发表评论