Subversion Repositories ALCASAR

Rev

Rev 971 | Rev 1805 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
324 richard 1
<?php
910 richard 2
//gestion de la langue
3
if (is_file("../lib/langues.php"))
4
	include("../lib/langues.php");
324 richard 5
require('/etc/freeradius-web/config.php');
6
if (isset($search_IN)) $selected[$search_IN] = 'selected';
7
if (isset ($radius_attr)) $selected[$radius_attr] = 'selected';
8
if (isset ($max_results)){ $max = ($max_results) ? $max_results : 40;}
9
?>
10
<html>
11
<head>
911 richard 12
<title>Find a user</title>
324 richard 13
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
14
<link rel="stylesheet" href="/css/style.css">
15
</head>
16
<body>
17
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
911 richard 18
<tr><th><?php echo "$l_users_managment";?></th></tr>
324 richard 19
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
20
height="2"></td></tr>
21
</TABLE>
22
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
23
	<tr bgcolor="#666666"><td>
24
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
25
		<tr><td valign="middle" align="left">
26
<center>
1667 richard 27
<table border=0 width=800 cellpadding=1 cellspacing=1>
324 richard 28
<tr valign=top>
29
<td width=340></td>
30
<td bgcolor="black" width=200>
31
	<table border=0 width=100% cellpadding=2 cellspacing=0>
32
	<tr bgcolor="#907030" align=right valign=top><th>
910 richard 33
	<font color="white"><?php echo "$l_search_filter";?></font>
324 richard 34
	</th></tr>
35
	</table>
36
</td></tr>
37
<tr bgcolor="black" valign=top><td colspan=2>
38
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
39
	<tr><td>
40
 
41
<?php
42
if (isset($find_user)){
43
if ($find_user == 1){
44
	unset($found_users);
45
	if (is_file("../lib/$config[general_lib_type]/find.php"))
46
		include("../lib/$config[general_lib_type]/find.php");
47
	if (isset($found_users)){
48
		$num = 0;
49
		$msg .= <<<EOM
50
 
51
        <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
52
        <tr bgcolor="#d0ddb0">
910 richard 53
        <th>#</th><th>$l_user</th><th>Actions</th><th>$l_group_member</th>
324 richard 54
        </tr>
55
EOM;
56
		foreach ($found_users as $user){
971 richard 57
			if ($user == '') {$user = '-';}
58
			else {
59
				$login = $user;
60
				if (is_file("../lib/sql/defaults.php")) //retrieve user groups
61
					include("../lib/sql/defaults.php");
62
				if (is_file("../lib/sql/user_info.php")) //retrieve user info
63
					include("../lib/sql/user_info.php");
64
			}
324 richard 65
			$User = urlencode($user);
66
			$num++;
685 richard 67
			$msg .= "<tr align=center><td>$num</td><td>$user";
971 richard 68
		        if ($cn != '-') {$msg .= " ($cn)";}
324 richard 69
			$msg .= <<<EOM
910 richard 70
				</td><td><a href="user_admin.php?login=$User" title="$l_status"><img src=/images/info.gif></a>
71
				<a href="user_edit.php?login=$User" title="$l_attributes"><img src=/images/create.gif></a>
72
				<a href="user_info.php?login=$User" title="$l_personal_info"><img src=/images/tpf.gif></a>
73
				<a href="user_accounting.php?login=$User" title="$l_connections"><img src=/images/graph.gif></a>
74
				<a href="clear_opensessions.php?login=$User" title="$l_open_sessions"><img src=/images/state_ok.gif></a>
75
				<a href="user_delete.php?login=$User" title="$l_remove"><img src=/images/state_error.gif></a></td><td>
324 richard 76
EOM;
685 richard 77
			if (isset($member_groups)) foreach ($member_groups as $group) { $msg .= "$group";}
78
			else $msg .= "&nbsp"; 
79
		$msg .= "</td>";
324 richard 80
		}
685 richard 81
		$msg .= "</tr></table>\n";
324 richard 82
	}
83
	else
910 richard 84
		$msg = "<b>$l_no_user_found</b><br>\n";
324 richard 85
}
86
}
87
?>
88
   <form method=post>
89
      <input type=hidden name=find_user value="0">
90
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
91
<tr>
92
<td align=right bgcolor="#d0ddb0">
910 richard 93
<?php
94
echo <<<EOM
95
$l_search_criteria
324 richard 96
</td>
97
<td>
98
<select name="search_IN" editable onChange="this.form.submit();">
910 richard 99
<option $selected[username] value="username">$l_login
100
<option $selected[name]  value="name">$l_name
324 richard 101
<option $selected[department] value="department">Service
910 richard 102
<option $selected[radius] value="radius">$l_special_attribute
324 richard 103
EOM;
104
?>
105
 
106
</select>
107
</td>
108
</tr>
109
<?php
110
if (isset($search_IN)){
111
	if ($search_IN == 'radius'){
112
		require('../lib/attrshow.php');
113
		echo <<<EOM
114
<tr>
115
<td align=right bgcolor="#d0ddb0">
910 richard 116
$l_attribute
324 richard 117
</td>
118
<td>
119
<select name="radius_attr" editable>
120
EOM;
121
		foreach($show_attrs as $key => $desc)
910 richard 122
		switch ($key)
123
		{
124
			case 'Simultaneous-Use' : 
125
				$desc=$l_simultaneous_use;
126
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
127
				break;
128
			case 'Max-All-Session' :
129
				$desc=$l_max_all_session;
130
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
131
				break;
132
			case 'Session-Timeout' : 
133
				$desc=$l_session_timeout;
134
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
135
				break;
136
			case 'Max-Daily-Session' :
137
				$desc=$l_daily_timeout;
138
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
139
				break;
140
			case 'Max-Monthly-Session' :
141
				$desc=$l_monthly_timeout;
142
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
143
				break;
144
			case 'Login-Time' : 
145
				$desc=$l_login_time;
146
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
147
				break;
148
			case 'Expiration' :
149
				$desc=$l_expiration;
150
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
151
				break;
152
			case 'ChilliSpot-Max-Input-Octets' :
153
				$desc=$l_max_input_octets;
154
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
155
				break;
156
			case 'ChilliSpot-Max-Output-Octets' :
157
				$desc=$l_max_output_octets;
158
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
159
				break;
160
			case 'ChilliSpot-Max-Total-Octets' :
161
				$desc=$l_max_total_octets;
162
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
163
				break;
164
			case 'ChilliSpot-Bandwidth-Max-Up' :
165
				$desc=$l_max_bandwidth_up;
166
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
167
				break;
168
			case 'ChilliSpot-Bandwidth-Max-Down' :
169
				$desc=$l_max_bandwidth_down;
170
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
171
				break;
172
			case 'WISPr-Redirection-URL' :
173
				$desc=$l_wispr_redirection;
174
				echo "<option $selected[$key] value=\"$key\">$desc\n";		
175
				break;
176
		}
324 richard 177
		echo <<<EOM
178
</select>
179
</td>
180
</tr>
181
EOM;
182
	}
183
}
184
?>
185
<tr>
186
<td align=right bgcolor="#d0ddb0">
910 richard 187
<?php echo "$l_value";?>
324 richard 188
</td>
189
<td>
190
<input type=text name="search" value="<?php if (isset($search)) echo $search ;?>" size=25>
191
</td>
192
</tr>
193
<!--<tr>
194
<td align=right bgcolor="#d0ddb0">
195
Nombre de r&eacute;sultats Max.
196
</td>
197
<td>
198
<input type=text name="max_results" value="<?php echo $max ?>" size=25>
199
</td>
200
</tr> --> 
201
</table>
202
<br>
910 richard 203
<input type=submit class=button value="<?php echo"$l_search";?>" OnClick="this.form.find_user.value=1">
324 richard 204
</form>
205
<?php
206
if (isset($find_user)){
207
	if ($find_user == 1){ echo $msg ;}}
208
?>
209
</td></tr>
210
</table>
211
</td></tr>
212
</table>
213
</td></tr>
214
</TABLE>
215
</td></tr>
216
</TABLE>
217
</body>
218
</html>