%s',_('Entry Chooser'));
flush();
?>
%s',_('Server: '),htmlspecialchars($ldapserver->name));
echo '
';
printf('%s%s',_('Looking in: '),htmlspecialchars($container));
echo '
';
}
/* Has the use already begun to descend into a specific server tree? */
if (isset($ldapserver) && $container !== false) {
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
$dn_list = $ldapserver->getContainerContents($container,0,'(objectClass=*)',$config->GetValue('deref','tree'));
sort($dn_list);
foreach ($ldapserver->getBaseDN() as $base_dn) {
if (DEBUG_ENABLED)
debug_log('entry_chooser.php: Comparing BaseDN [%s] with container [%s]',64,$base_dn,$container);
if (! pla_compare_dns($container,$base_dn)) {
$parent_container = false;
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s',$return_form_element,$rdn);
break;
} else {
$parent_container = get_container($container);
$up_href = sprintf('entry_chooser.php?form_element=%s&rdn=%s&server_id=%s&container=%s',
$return_form_element,$rdn,$ldapserver->server_id,rawurlencode($parent_container));
}
}
echo ' ';
printf(' %s',$up_href,_('Back Up...'));
echo '
';
if (! count($dn_list))
printf(' (%s)
',_('no entries'));
else
foreach ($dn_list as $dn) {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
echo ' ';
printf('',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
printf('%s',$href,htmlspecialchars($dn));
echo '
';
}
/* draw the root of the selection tree (ie, list all the servers) */
} else {
foreach ($ldapservers->GetServerList() as $id) {
$ldapserver = $ldapservers->Instance($id);
if ($ldapserver->isVisible()) {
if (! $ldapserver->haveAuthInfo())
continue;
else {
printf('%s',htmlspecialchars($ldapserver->name));
echo '
';
foreach ($ldapserver->getBaseDN() as $dn) {
if (! $dn) {
printf(' (%s)
',_('Could not determine base DN'));
} else {
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
echo ' ';
printf(' ',
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
printf('%s',$href,htmlspecialchars($dn));
echo '
';
}
}
}
}
}
}
?>