Skip to content

Instantly share code, notes, and snippets.

@juque
Created January 29, 2012 01:41
Show Gist options
  • Select an option

  • Save juque/1696639 to your computer and use it in GitHub Desktop.

Select an option

Save juque/1696639 to your computer and use it in GitHub Desktop.
<?php
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$options = array(
'host' => '10.181.132.100',
'baseDn' => 'OU=usuarios,DC=localhost',
'bindRequiresDn' => true
);
$ldap = new Zend_Ldap($options);
$ldap->bind();
$result = $ldap->search('sn=*','ou=usuarios,dc=localhost');
foreach ($result as $item) {
print_r($item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment