Subversion Repositories ALCASAR

Rev

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