phpldapadmin/lib/search_results_list.php

74 lines
1.8 KiB
PHP
Raw Normal View History

2009-06-30 09:29:51 +00:00
<?php
2009-06-30 10:26:08 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.5.4.4 2005/12/09 14:31:27 wurley Exp $
2009-06-30 09:29:51 +00:00
/**
* @package phpLDAPadmin
*/
2009-06-30 09:22:30 +00:00
$friendly_attrs = process_friendly_attr_table();
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:26:08 +00:00
echo '<div class="search_result">';
echo '<table><tr>';
printf('<td><img src="images/%s" /></td>',get_icon($ldapserver,$dn));
printf('<td><a href="template_engine.php?server_id=%s&amp;dn=%s">%s</a></td>',
$ldapserver->server_id,rawurlencode(dn_unescape($dn)),htmlspecialchars(get_rdn($dn)));
echo '</tr></table>';
echo '</div>';
echo '<table class="attrs">';
printf('<tr><td class="attr" valign="top">dn</td><td>%s</td></tr>',htmlspecialchars(dn_unescape($dn)));
# 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)');
if (isset($friendly_attrs[strtolower($attr)]))
$attr = sprintf('<acronym title="Alias for $attr">%s</acronym>',
htmlspecialchars($friendly_attrs[strtolower($attr)]));
2009-06-30 09:29:51 +00:00
else
2009-06-30 10:26:08 +00:00
$attr = htmlspecialchars($attr);
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
echo '<tr>';
printf('<td class="attr" valign="top">%s</td>',$attr);
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 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
# Flush every 5th entry (speeds things up a bit)
if ($i % 5 == 0)
2009-06-30 09:29:51 +00:00
flush();
2009-06-30 10:26:08 +00:00
}
2009-06-30 09:29:51 +00:00
?>