phpldapadmin/lib/search_results_list.php

82 lines
2.2 KiB
PHP
Raw Normal View History

2009-06-30 09:29:51 +00:00
<?php
2009-06-30 10:46:00 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.7 2007/12/15 07:50:33 wurley Exp $
2009-06-30 09:29:51 +00:00
/**
* @package phpLDAPadmin
*/
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
# Iterate over each entry
2009-06-30 09:22:30 +00:00
$i = 0;
2009-06-30 10:26:08 +00:00
foreach ($results as $dn => $dndetails) {
2009-06-30 09:29:51 +00:00
$i++;
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
if ($i <= $start_entry)
2009-06-30 09:29:51 +00:00
continue;
2009-06-30 10:26:08 +00:00
if ($i >= $end_entry)
2009-06-30 09:29:51 +00:00
break;
2009-06-30 10:46:00 +00:00
echo '<table class="search_result" border=0>';
echo '<tr class="list_dn">';
printf('<td class="icon"><img src="images/%s" alt="icon" /></td>',get_icon($ldapserver,$dn));
2009-06-30 10:26:08 +00:00
2009-06-30 10:46:00 +00:00
$formatted_dn = get_rdn($dn);
if (!$_SESSION['plaConfig']->isCommandAvailable('schema')) {
$formatted_dn = explode('=', $formatted_dn, 2);
$formatted_dn = $formatted_dn[1];
}
printf('<td colspan=2><a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s">%s</a></td>',
$ldapserver->server_id,rawurlencode(dn_unescape($dn)),htmlspecialchars($formatted_dn));
echo '</tr>';
if ($_SESSION['plaConfig']->isCommandAvailable('schema')) {
printf('<tr class="list_attr"><td class="blank">&nbsp;</td><td class="attr">dn</td><td class="val">%s</td></tr>',htmlspecialchars(dn_unescape($dn)));
}
2009-06-30 10:26:08 +00:00
# Iterate over each attribute for this entry
foreach ($dndetails as $attr => $values) {
# Ignore DN, we've already displayed it.
if ($attr == 'dn')
continue;
if ($ldapserver->isAttrBinary($attr))
$values = array('(binary)');
2009-06-30 10:46:00 +00:00
if (isset($_SESSION['plaConfig']->friendly_attrs[strtolower($attr)])) {
$a = $attr;
$attr = htmlspecialchars($_SESSION['plaConfig']->friendly_attrs[strtolower($attr)]);
if ($_SESSION['plaConfig']->isCommandAvailable('schema')) {
$attr = sprintf('<acronym title="Alias for %s">%s</acronym>', $a, $attr);
}
} else
2009-06-30 10:26:08 +00:00
$attr = htmlspecialchars($attr);
2009-06-30 09:22:30 +00:00
2009-06-30 10:46:00 +00:00
echo '<tr class="list_attr">';
echo '<td class="blank">&nbsp;</td>';
2009-06-30 10:26:08 +00:00
printf('<td class="attr" valign="top">%s</td>',$attr);
2009-06-30 10:46:00 +00:00
2009-06-30 10:26:08 +00:00
echo '<td class="val">';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if ($ldapserver->isJpegPhoto($attr))
draw_jpeg_photos($ldapserver,$dn,$attr,false,false,'align="left"');
2009-06-30 09:29:51 +00:00
else
2009-06-30 10:26:08 +00:00
if (is_array($values))
foreach ($values as $value)
echo str_replace(' ','&nbsp;',htmlspecialchars($value)).'<br />';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
else
echo str_replace(' ','&nbsp;',htmlspecialchars($values)).'<br />';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
echo '</td>';
echo '</tr>';
}
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
echo '</table>';
2009-06-30 10:46:00 +00:00
echo '<br />';
2009-06-30 10:26:08 +00:00
}
2009-06-30 09:29:51 +00:00
?>