phpldapadmin/lib/search_form_advanced.php

124 lines
4.3 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 11:51:50 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.26.2.2 2008/01/13 05:37:02 wurley Exp $
2009-06-30 09:29:51 +00:00
/**
* @package phpLDAPadmin
*/
2009-06-30 08:07:14 +00:00
?>
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
<script type="text/javascript" language="javascript">
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
<?php
foreach ($server_info_list as $i => $ignore) {
foreach ($server_info_list[$i]['base_dns'] as $base_dn) { ?>
addToServersList(new server(<?php echo $i; ?>,"<?php echo $server_info_list[$i]['name']; ?>","<?php echo $base_dn; ?>"));
<?php
}
} ?>
2009-06-30 09:29:51 +00:00
function focus_filter() {
2009-06-30 10:46:00 +00:00
document.advanced_search_form.filter.focus();
2009-06-30 09:29:51 +00:00
}
2009-06-30 08:07:14 +00:00
</script>
2009-06-30 11:51:50 +00:00
<h3 class="title"><?php echo _('Advanced Search Form'); ?></h3>
<br />
<form action="cmd.php" name="advanced_search_form">
2009-06-30 10:46:00 +00:00
<input type="hidden" name="cmd" value="search" />
2009-06-30 08:05:37 +00:00
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="advanced" />
2009-06-30 10:46:00 +00:00
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />
2009-06-30 08:05:37 +00:00
2009-06-30 11:51:50 +00:00
<table class="forminput" border=0>
2009-06-30 08:05:37 +00:00
2009-06-30 10:46:00 +00:00
<?php
2009-06-30 11:46:44 +00:00
$ss = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'simple_search');
$ps = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'predefined_search');
2009-06-30 10:46:00 +00:00
if ($ss | $ps) {
echo '<tr><td class="subtitle" colspan=2>(';
if ($ss) {
echo '<a href="cmd.php?cmd=search&amp;server_id=';
echo $ldapserver->server_id;
echo '&amp;form=simple">';
echo _('Simple Search Form');
echo '</a>';
if ($ps) echo ' | ';
}
if ($ps) {
echo '<a href="cmd.php?cmd=search&amp;server_id=';
echo $ldapserver->server_id;
echo '&amp;form=predefined">';
echo _('Predefined Searches');
echo '</a>';
}
echo ')</td></tr>';
}
?>
<tr><td colspan=2>&nbsp;</td></tr>
2009-06-30 11:51:50 +00:00
<tr><td><?php echo _('Server'); ?></td><td><?php echo $server_menu_html; ?></td></tr>
2009-06-30 08:05:37 +00:00
<tr>
2009-06-30 11:51:50 +00:00
<td><?php echo _('Base DN'); ?></td>
2009-06-30 09:29:51 +00:00
<td><input type="text" name="base_dn" value="<?php echo count($base_dns) == 1 ? $base_dns[0] : '' ?>" style="width: 200px" id="base_dn" />
2009-06-30 10:46:00 +00:00
<?php
draw_chooser_link('advanced_search_form.base_dn');
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
if (isset($entry['base_dn']['invalid']) && $entry['base_dn']['invalid'])
2009-06-30 11:51:50 +00:00
printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This is not a valid DN.'));
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
if (isset($entry['base_dn']['exist']) && $entry['base_dn']['exist'])
2009-06-30 11:51:50 +00:00
printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This entry does not exist.'));
2009-06-30 10:46:00 +00:00
?>
</td>
2009-06-30 08:05:37 +00:00
</tr>
<tr>
2009-06-30 11:51:50 +00:00
<td><acronym title="<?php echo _('The scope in which to search'); ?>"><?php echo _('Search Scope'); ?></acronym></td>
2009-06-30 08:05:37 +00:00
<td>
2009-06-30 09:22:30 +00:00
<select name="scope" style="width: 200px">
2009-06-30 10:46:00 +00:00
<option<?php echo $entry['scope']=='sub'?' selected':''; ?> value="sub">
2009-06-30 10:26:08 +00:00
<?php echo _('Sub (entire subtree)'); ?>
2009-06-30 08:09:20 +00:00
</option>
2009-06-30 10:46:00 +00:00
<option<?php echo $entry['scope']=='one'?' selected':''; ?> value="one">
2009-06-30 10:26:08 +00:00
<?php echo _('One (one level beneath base)'); ?>
2009-06-30 08:09:20 +00:00
</option>
2009-06-30 10:46:00 +00:00
<option<?php echo $entry['scope']=='base'?' selected':''; ?> value="base">
2009-06-30 10:26:08 +00:00
<?php echo _('Base (base dn only)'); ?>
2009-06-30 08:09:20 +00:00
</option>
2009-06-30 08:05:37 +00:00
</select>
</td>
</tr>
<tr>
2009-06-30 11:51:50 +00:00
<td><acronym title="<?php echo htmlspecialchars(_('Standard LDAP search filter. Example: (&(sn=Smith)(givenname=David))')); ?>">
<?php echo _('Search Filter'); ?></acronym></td>
2009-06-30 10:46:00 +00:00
<td><input type="text" name="filter" id="filter" style="width: 200px" value="<?php echo $entry['filter']['clean'] ? htmlspecialchars($entry['filter']['clean']) : 'objectClass=*'; ?>" /></td>
2009-06-30 08:05:37 +00:00
</tr>
<tr>
2009-06-30 11:51:50 +00:00
<td><acronym title="<?php echo _('A list of attributes to display in the results (comma-separated)'); ?>">
<?php echo _('Show Attributtes'); ?></acronym></td>
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
<td><input type="text" name="display_attrs" style="width: 200px" value="<?php
echo $entry['display']['string'] ? htmlspecialchars($entry['display']['string']) :
2009-06-30 11:46:44 +00:00
join(', ',$_SESSION[APPCONFIG]->GetValue('search','result_attributes')); ?>" /></td>
2009-06-30 09:29:51 +00:00
</tr>
2009-06-30 10:41:18 +00:00
2009-06-30 08:05:37 +00:00
<tr>
2009-06-30 11:51:50 +00:00
<td><acronym title="<?php echo htmlspecialchars(_('Order by').'...'); ?>"><?php echo _('Order by'); ?></acronym></td>
2009-06-30 10:46:00 +00:00
<td><input type="text" name="orderby" id="orderby" style="width: 200px" value="<?php echo htmlspecialchars($entry['orderby']['string']) ?>" /></td>
2009-06-30 08:05:37 +00:00
</tr>
2009-06-30 10:46:00 +00:00
<tr><td colspan="2"><br /><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td></tr>
2009-06-30 08:05:37 +00:00
</table>
</form>
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
<script type="text/javascript" language="javascript">
2009-06-30 10:46:00 +00:00
// Move the cursor to the filter field
focus_filter();
2009-06-30 09:22:30 +00:00
</script>