RELEASE 0.9.8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.26.2.1 2005/10/09 09:07:21 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.27.2.4 2005/12/31 03:13:48 wurley Exp $
|
||||
|
||||
/**
|
||||
* Display a selection (popup window) to pick a DN.
|
||||
@@ -17,12 +17,12 @@ $rdn = isset($_GET['rdn']) ? htmlspecialchars($_GET['rdn']) : null;
|
||||
|
||||
include "./header.php";
|
||||
|
||||
printf('<h3 class="subtitle">%s</h3>',$lang['entry_chooser_title']);
|
||||
printf('<h3 class="subtitle">%s</h3>',_('Entry Chooser'));
|
||||
flush();
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
function returnDN( dn ) {
|
||||
<script type="text/javascript" language="javascript">
|
||||
function returnDN(dn) {
|
||||
opener.document.<?php echo $return_form_element; ?>.value = dn;
|
||||
close();
|
||||
}
|
||||
@@ -30,53 +30,53 @@ flush();
|
||||
|
||||
<?php
|
||||
if ($container) {
|
||||
printf('%s<b>%s</b>',$lang['server_colon_pare'],htmlspecialchars($ldapserver->name));
|
||||
print '<br />';
|
||||
printf('%s<b>%s</b>',$lang['look_in'],htmlspecialchars($container));
|
||||
print '<br />';
|
||||
printf('%s<b>%s</b>',_('Server: '),htmlspecialchars($ldapserver->name));
|
||||
echo '<br />';
|
||||
printf('%s<b>%s</b>',_('Looking in: '),htmlspecialchars($container));
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
/* Has the use already begun to descend into a specific server tree? */
|
||||
if (isset($ldapserver) && $container !== false) {
|
||||
|
||||
if (! $ldapserver->haveAuthInfo())
|
||||
pla_error($lang['not_enough_login_info']);
|
||||
pla_error(_('Not enough information to login to server. Please check your configuration.'));
|
||||
|
||||
$dn_list = get_container_contents($ldapserver,$container,0,'(objectClass=*)',$config->GetValue('deref','tree'));
|
||||
$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]',9,$base_dn,$container);
|
||||
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);
|
||||
$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',
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
print ' ';
|
||||
printf('<a href="%s" style="text-decoration:none"><img src="images/up.png"> %s</a>',$up_href,$lang['back_up_p']);
|
||||
print '<br />';
|
||||
echo ' ';
|
||||
printf('<a href="%s" style="text-decoration:none"><img src="images/up.png" /> %s</a>',$up_href,_('Back Up...'));
|
||||
echo '<br />';
|
||||
|
||||
if (! count($dn_list))
|
||||
printf(' (%s)<br />',$lang['no_entries']);
|
||||
printf(' (%s)<br />',_('no entries'));
|
||||
|
||||
else
|
||||
foreach ($dn_list as $dn) {
|
||||
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
|
||||
print ' ';
|
||||
printf('<a href="entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s"><img src="images/plus.png" /></a>',
|
||||
echo ' ';
|
||||
printf('<a href="entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s"><img src="images/plus.png" /></a>',
|
||||
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
|
||||
|
||||
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
|
||||
print '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
/* draw the root of the selection tree (ie, list all the servers) */
|
||||
@@ -92,20 +92,20 @@ if (isset($ldapserver) && $container !== false) {
|
||||
|
||||
else {
|
||||
printf('<b>%s</b>',htmlspecialchars($ldapserver->name));
|
||||
print '<br />';
|
||||
echo '<br />';
|
||||
foreach ($ldapserver->getBaseDN() as $dn) {
|
||||
if (! $dn) {
|
||||
printf('<small> (%s)</small><br />',$lang['could_not_det_base_dn']);
|
||||
printf('<small> (%s)</small><br />',_('Could not determine base DN'));
|
||||
|
||||
} else {
|
||||
$href = sprintf("javascript:returnDN('%s%s')",($rdn ? "$rdn," : ''),$dn);
|
||||
|
||||
print ' ';
|
||||
printf('<a href="entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s"><img src="images/plus.png" /></a> ',
|
||||
echo ' ';
|
||||
printf('<a href="entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s"><img src="images/plus.png" /></a> ',
|
||||
$ldapserver->server_id,$return_form_element,$rdn,rawurlencode($dn));
|
||||
|
||||
printf('<a href="%s">%s</a>',$href,htmlspecialchars($dn));
|
||||
print '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user