2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-06-30 10:46:00 +00:00
|
|
|
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.16 2007/12/15 07:50:33 wurley Exp $
|
2009-06-30 09:29:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @package phpLDAPadmin
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
<script type="text/javascript" language="javascript">
|
2009-06-30 10:46:00 +00:00
|
|
|
function focus_filter() {
|
|
|
|
document.simple_search_form.filter.focus();
|
|
|
|
}
|
2009-06-30 09:22:30 +00:00
|
|
|
</script>
|
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
<form action="cmd.php" method="get" class="search" name="simple_search_form">
|
|
|
|
<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="simple" />
|
|
|
|
<input type="hidden" name="scope" value="sub" />
|
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 10:46:00 +00:00
|
|
|
<table class="search" border=0>
|
|
|
|
<tr><td class="title"><?php echo _('Simple Search Form'); ?></td></tr>
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
<?php
|
|
|
|
$as = $_SESSION['plaConfig']->isCommandAvailable('search', 'advanced_search');
|
|
|
|
$ps = $_SESSION['plaConfig']->isCommandAvailable('search', 'predefined_search');
|
|
|
|
if ($as | $ps) {
|
|
|
|
echo '<tr><td class="subtitle">(';
|
|
|
|
if ($as) {
|
|
|
|
echo '<a href="cmd.php?cmd=search&server_id=';
|
|
|
|
echo $ldapserver->server_id;
|
|
|
|
echo '&form=advanced">';
|
|
|
|
echo _('Advanced Search Form');
|
|
|
|
echo '</a>';
|
|
|
|
if ($ps) echo ' | ';
|
|
|
|
}
|
|
|
|
if ($ps) {
|
|
|
|
echo '<a href="cmd.php?cmd=search&server_id=';
|
|
|
|
echo $ldapserver->server_id;
|
|
|
|
echo '&form=predefined">';
|
|
|
|
echo _('Predefined Searches');
|
|
|
|
echo '</a>';
|
|
|
|
}
|
|
|
|
echo ')</td></tr>';
|
|
|
|
}
|
|
|
|
?>
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
<tr><td> </td></tr>
|
|
|
|
<tr><td><small><b><?php echo _('Server'); ?></b></small><br /> <?php echo $server_menu_html; ?><br /></td></tr>
|
|
|
|
<tr><td> </td></tr>
|
|
|
|
<tr><td><small><b><?php echo _('Search for entries whose'); ?></b></small></td></tr>
|
|
|
|
<tr><td>
|
2009-06-30 09:29:51 +00:00
|
|
|
<select name="attribute">
|
2009-06-30 10:46:00 +00:00
|
|
|
<?php foreach ($_SESSION['plaConfig']->GetValue('search','attributes') as $id => $attribute) { ?>
|
|
|
|
<option value="<?php echo rawurlencode($attribute); ?>"<?php echo $attribute==$entry['attr']?' selected="true"':''; ?>>
|
2009-06-30 10:26:08 +00:00
|
|
|
<?php echo htmlspecialchars($ldapserver->showFriendlyAttr($attribute)); ?>
|
2009-06-30 09:29:51 +00:00
|
|
|
</option>
|
|
|
|
<?php } ?>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select name="criterion">
|
2009-06-30 10:26:08 +00:00
|
|
|
<?php
|
2009-06-30 10:46:00 +00:00
|
|
|
foreach ($_SESSION['plaConfig']->GetValue('search','criteria_options') as $c) { ?>
|
|
|
|
<option value="<?php echo $c; ?>"<?php echo $c==$entry['criterion']?' selected="true"':''; ?>>
|
2009-06-30 10:26:08 +00:00
|
|
|
<?php echo htmlspecialchars(_($c)); ?>
|
2009-06-30 09:29:51 +00:00
|
|
|
</option>
|
2009-06-30 10:46:00 +00:00
|
|
|
<?php } ?>
|
2009-06-30 09:29:51 +00:00
|
|
|
</select>
|
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
<input type="text" name="filter" id="filter" size="20" value="<?php echo htmlspecialchars($entry['filter']['clean']); ?>" />
|
|
|
|
</td></tr>
|
|
|
|
<tr><td> </td></tr>
|
|
|
|
<tr><td><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>
|