Subversion Repositories ALCASAR

Rev

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