Subversion Repositories ALCASAR

Rev

Rev 2975 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

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