File: search_form_advanced.php

package info (click to toggle)
phpldapadmin 1.1.0.5-6%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,008 kB
  • ctags: 3,949
  • sloc: php: 17,735; xml: 1,532; sh: 388; makefile: 46
file content (123 lines) | stat: -rw-r--r-- 4,388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_advanced.php,v 1.26.2.2 2008/01/13 05:37:02 wurley Exp $

/**
 * @package phpLDAPadmin
 */

?>

<script type="text/javascript" language="javascript">

<?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
	}
} ?>

function focus_filter() {
	document.advanced_search_form.filter.focus();
}
</script>

<h3 class="title"><?php echo _('Advanced Search Form'); ?></h3>
<br />
<form action="cmd.php" name="advanced_search_form">
<input type="hidden" name="cmd" value="search" />
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="advanced" />
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />

<table class="forminput" border=0>

<?php
	$ss = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'simple_search');
	$ps = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'predefined_search');
	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>

	<tr><td><?php echo _('Server'); ?></td><td><?php echo $server_menu_html; ?></td></tr>

	<tr>
		<td><?php echo _('Base DN'); ?></td>
		<td><input type="text" name="base_dn" value="<?php echo count($base_dns) == 1 ? $base_dns[0] : '' ?>" style="width: 200px" id="base_dn" />

<?php
draw_chooser_link('advanced_search_form.base_dn');

if (isset($entry['base_dn']['invalid']) && $entry['base_dn']['invalid'])
	printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This is not a valid DN.'));

if (isset($entry['base_dn']['exist']) && $entry['base_dn']['exist'])
	printf('<tr><td>&nbsp;</td><td><small style="color:red; white-space: nowrap">%s</small></td></tr>',_('This entry does not exist.'));
?>
		</td>
	</tr>

	<tr>
		<td><acronym title="<?php echo _('The scope in which to search'); ?>"><?php echo _('Search Scope'); ?></acronym></td>
		<td>
			<select name="scope" style="width: 200px">
				<option<?php echo $entry['scope']=='sub'?' selected':''; ?> value="sub">
					<?php echo _('Sub (entire subtree)'); ?>
				</option>
				<option<?php echo $entry['scope']=='one'?' selected':''; ?> value="one">
					<?php echo _('One (one level beneath base)'); ?>
				</option>
				<option<?php echo $entry['scope']=='base'?' selected':''; ?> value="base">
					<?php echo _('Base (base dn only)'); ?>
				</option>
			</select>
		</td>
	</tr>

	<tr>
		<td><acronym title="<?php echo htmlspecialchars(_('Standard LDAP search filter. Example: (&(sn=Smith)(givenname=David))')); ?>">
			<?php echo _('Search Filter'); ?></acronym></td>
		<td><input type="text" name="filter" id="filter" style="width: 200px" value="<?php echo $entry['filter']['clean'] ? htmlspecialchars($entry['filter']['clean']) : 'objectClass=*'; ?>" /></td>
	</tr>

	<tr>
		<td><acronym title="<?php echo _('A list of attributes to display in the results (comma-separated)'); ?>">
			<?php echo _('Show Attributtes'); ?></acronym></td>

		 <td><input type="text" name="display_attrs" style="width: 200px" value="<?php
			echo $entry['display']['string'] ? htmlspecialchars($entry['display']['string']) :
					join(', ',$_SESSION[APPCONFIG]->GetValue('search','result_attributes')); ?>" /></td>
	</tr>

	<tr>
		<td><acronym title="<?php echo htmlspecialchars(_('Order by').'...'); ?>"><?php echo _('Order by'); ?></acronym></td>
		<td><input type="text" name="orderby" id="orderby" style="width: 200px" value="<?php echo htmlspecialchars($entry['orderby']['string']) ?>" /></td>
	</tr>

	<tr><td colspan="2"><br /><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td></tr>
</table>
</form>

<script type="text/javascript" language="javascript">
	// Move the cursor to the filter field
	focus_filter();
</script>