Subversion Repositories ALCASAR

Rev

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