2009-06-30 09:29:51 +00:00
|
|
|
<?php
|
2009-06-30 11:51:50 +00:00
|
|
|
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_results_list.php,v 1.7.2.3 2008/01/13 05:37:02 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 11:51:50 +00:00
|
|
|
echo '<table class="result" border=0>';
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-06-30 11:51:50 +00:00
|
|
|
echo '<tr class="list_title">';
|
2009-06-30 10:46:00 +00:00
|
|
|
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);
|
2009-06-30 11:46:44 +00:00
|
|
|
if (!$_SESSION[APPCONFIG]->isCommandAvailable('schema')) {
|
2009-06-30 10:46:00 +00:00
|
|
|
$formatted_dn = explode('=', $formatted_dn, 2);
|
|
|
|
$formatted_dn = $formatted_dn[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
printf('<td colspan=2><a href="cmd.php?cmd=template_engine&server_id=%s&dn=%s">%s</a></td>',
|
|
|
|
$ldapserver->server_id,rawurlencode(dn_unescape($dn)),htmlspecialchars($formatted_dn));
|
|
|
|
echo '</tr>';
|
|
|
|
|
2009-06-30 11:46:44 +00:00
|
|
|
if ($_SESSION[APPCONFIG]->isCommandAvailable('schema')) {
|
2009-06-30 11:51:50 +00:00
|
|
|
printf('<tr class="list_item"><td class="blank"> </td><td class="heading">dn</td><td class="value">%s</td></tr>',htmlspecialchars(dn_unescape($dn)));
|
2009-06-30 10:46:00 +00:00
|
|
|
}
|
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 11:51:50 +00:00
|
|
|
echo '<tr class="list_item">';
|
2009-06-30 10:46:00 +00:00
|
|
|
echo '<td class="blank"> </td>';
|
2009-06-30 11:51:50 +00:00
|
|
|
printf('<td class="heading" valign="top">%s</td>',$_SESSION[APPCONFIG]->getFriendlyHTML($attr));
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-06-30 11:51:50 +00:00
|
|
|
echo '<td class="value">';
|
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(' ',' ',htmlspecialchars($value)).'<br />';
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
else
|
|
|
|
echo str_replace(' ',' ',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
|
|
|
?>
|