Subversion Repositories ALCASAR

Rev

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