Spaces:
Sleeping
Sleeping
File size: 996 Bytes
07c3cdd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <?php
require_once('../../../../config/dmsDefaults.php');
require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php');
require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php');
require_once('Net/LDAP.php');
$oKTConfig =& KTConfig::getSingleton();
$oAuthenticator = KTAuthenticationUtil::getAuthenticatorForSource(2);
$config = array(
'dn' => $oAuthenticator->sSearchUser,
'password' => $oAuthenticator->sSearchPassword,
'host' => $oAuthenticator->sLdapServer,
'base' => $oAuthenticator->sBaseDN,
);
$oLdap =& Net_LDAP::connect($config);
if (PEAR::isError($oLdap)) {
var_dump($oLdap);
exit(0);
}
$aParams = array(
'scope' => 'sub',
'attributes' => array('cn', 'dn', 'displayClass'),
);
$rootDn = $oAuthenticator->sBaseDN;
if (is_array($rootDn)) {
$rootDn = join(",", $rootDn);
}
$oResults = $oLdap->search($rootDn, '(objectClass=group)', $aParams);
foreach ($oResults->entries() as $oEntry) {
var_dump($oEntry->dn());
}
|