Subversion Repositories ALCASAR

Rev

Rev 2818 | Rev 2854 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2818 Rev 2853
Line 2... Line 2...
2
<?php
2
<?php
3
require('/etc/freeradius-web/config.php');
3
require('/etc/freeradius-web/config.php');
4
require('../lib/functions.php');
4
require('../lib/functions.php');
5
require('../lib/sql/functions.php');
5
require('../lib/sql/functions.php');
6
require('../lib/acctshow.php');
6
require('../lib/acctshow.php');
-
 
7
$Language = 'en';
-
 
8
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-
 
9
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-
 
10
	$Language = strtolower(substr(chop($Langue[0]), 0, 2)); 
-
 
11
}
-
 
12
if ($Language === 'fr') {
-
 
13
	$l_title	= "Journal des connexions";
-
 
14
	$l_select_attributes	= "Sélectionnez les attributs à afficher";
-
 
15
	$l_ordered	= "Classé par :";
-
 
16
	$l_max_return	= "Nbr. max. de résultats retournés :";
-
 
17
	$l_criteria	= "Critère de sélection :";
-
 
18
	$l_not_valid =	"L'opération demandé n'est pas valide. Sortie anormale.";
-
 
19
	$l_delete =	"Supprimer";
-
 
20
	$l_edit_user	= "Éditer l'utilisateur :";
-
 
21
} else if($Language === 'es') {
-
 
22
	$l_title	= "Registro de conexión";
-
 
23
	$l_select_attributes	= "Seleccione los atributos que desea mostrar";
-
 
24
	$l_ordered	= "ordenada por :";
-
 
25
	$l_max_return	= "Máximo número de resultados devueltos :";
-
 
26
	$l_criteria	= "Criterios de selección :";
-
 
27
	$l_not_valid =	"La operación solicitada no es válida. Salida anormal.";
-
 
28
	$l_delete =	"Eliminar";
-
 
29
	$l_edit_user	= "Editar usuario :";
-
 
30
} else {
-
 
31
	$l_title	= "Connections log";
-
 
32
	$l_select_attributes	= "Select the attributes you want to display";
-
 
33
	$l_ordered	= "Ordered by :";
-
 
34
	$l_max_return	= "Max. no. of results returned :";
-
 
35
	$l_criteria	= "Selection Criteria :";
-
 
36
	$l_not_valid =	"The requested operation is not valid. Abnormal exit.";
-
 
37
	$l_delete =	"Delete";
-
 
38
	$l_edit_user	= "Edit user :";
-
 
39
}
7
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
40
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
8
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
41
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
9
else{
42
else{
10
	echo <<<EOM
43
	echo <<<EOM
11
<html>
44
<html>
Line 20... Line 53...
20
</body>
53
</body>
21
</html>
54
</html>
22
EOM;
55
EOM;
23
	exit();
56
	exit();
24
}
57
}
25
$Language = 'en';
-
 
26
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-
 
27
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-
 
28
	$Language = strtolower(substr(chop($Langue[0]), 0, 2)); 
-
 
29
}
-
 
30
if ($Language === 'fr') {
-
 
31
	$l_title	= "Journal des connexions";
-
 
32
} else {
-
 
33
	$l_title	= "Connections log";
-
 
34
}
-
 
35
 
58
 
36
$operators=array( '=','<', '>', '<=', '>=', 'regexp', 'like' );
59
$operators=array( '=','<', '>', '<=', '>=', 'regexp', 'like' );
37
if ($config['sql_type'] == 'pg'){
60
if ($config['sql_type'] == 'pg'){
38
	$operators=array( '=','<', '>', '<=', '>=', '~', 'like', '~*', '~~*', '<<=' );
61
	$operators=array( '=','<', '>', '<=', '>=', '~', 'like', '~*', '~~*', '<<=' );
39
}
62
}
Line 87... Line 110...
87
	</select>
110
	</select>
88
	</td><td align=left>
111
	</td><td align=left>
89
	<input name="value_of_$this->name" type=text value="$this->value">
112
	<input name="value_of_$this->name" type=text value="$this->value">
90
	</td><td align=left>
113
	</td><td align=left>
91
	<input type=hidden name="delete_$this->name" value=0>
114
	<input type=hidden name="delete_$this->name" value=0>
92
	<input type=submit class=button size=5 value=del onclick="this.form.delete_$this->name.value=1">
115
	<input type=submit class=button size=5 value="$l_delete" onclick="this.form.delete_$this->name.value=1">
93
	</td></tr>
116
	</td></tr>
94
EOM;
117
EOM;
95
	}
118
	}
96
 
119
 
97
	function get($designator) {  	global ${"item_of_$designator"};
120
	function get($designator) {  	global ${"item_of_$designator"};
Line 130... Line 153...
130
	echo <<<EOM
153
	echo <<<EOM
131
<form method=post>
154
<form method=post>
132
<table border=0 width=740 cellpadding=1 cellspacing=1>
155
<table border=0 width=740 cellpadding=1 cellspacing=1>
133
<tr>
156
<tr>
134
<td>
157
<td>
135
<b>Afficher les attributs suivants :</b><br>
158
<b>$l_select_attributes</b><br>
136
<select name="accounting_show_attrs[]" size=5 multiple>
159
<select name="accounting_show_attrs[]" size=5 multiple>
137
EOM;
160
EOM;
138
foreach($items as $key => $val)
161
foreach($items as $key => $val)
139
	echo <<<EOM
162
	echo <<<EOM
140
<option $selected[$key] value="$key">$val</option>
163
<option $selected[$key] value="$key">$val</option>
141
EOM;
164
EOM;
142
 
165
 
143
echo <<<EOM
166
echo <<<EOM
144
</select>
167
</select>
145
<br><br>
168
<br><br>
146
<b>Class&eacute; par :</b><br>
169
<b>$l_ordered</b><br>
147
<select name="order_by">
170
<select name="order_by">
148
EOM;
171
EOM;
149
 
172
 
150
foreach($items as $key => $val)
173
foreach($items as $key => $val)
151
	if ($val == 'username')
174
	if ($val == 'username')
Line 158... Line 181...
158
EOM;
181
EOM;
159
 
182
 
160
echo <<<EOM
183
echo <<<EOM
161
</select>
184
</select>
162
<br><br>
185
<br><br>
163
<b>Nbr. Max. de r&eacute;sultats retourn&eacute;s :</b><br>
186
<b>$l_max_return</b><br>
164
<input name=maxresults value=$config[sql_row_limit] size=5>
187
<input name=maxresults value=$config[sql_row_limit] size=5>
165
</td>
188
</td>
166
<td valign=top>
189
<td valign=top>
167
<input type=hidden name=add value=0>
190
<input type=hidden name=add value=0>
168
<table border=0 width=340 cellpadding=1 cellspacing=1>
191
<table border=0 width=340 cellpadding=1 cellspacing=1>
169
<tr><td>
192
<tr><td>
170
<b>Crit&egrave;re de s&eacute;lection :</b>
193
<b>$l_criteria</b>
171
</td></tr>
194
</td></tr>
172
<tr><td>
195
<tr><td>
173
<select name=item_name onchange="this.form.add.value=1;this.form.submit()">
196
<select name=item_name onchange="this.form.add.value=1;this.form.submit()">
174
<option>--Attribute--</option>
197
<option>--Attribute--</option>
175
EOM;
198
EOM;
Line 223... Line 246...
223
			$op_found = 1;
246
			$op_found = 1;
224
			break;
247
			break;
225
		}
248
		}
226
	}
249
	}
227
	if (!$op_found)
250
	if (!$op_found)
228
		die("L'op&eacute;ration demand&eacute; n'est pas valide. Sortie anormale.");
251
		die("$l_not_valid");
229
	${"item_of_w$i"} = preg_replace('/\s/','',${"item_of_w$i"});
252
	${"item_of_w$i"} = preg_replace('/\s/','',${"item_of_w$i"});
230
	${"value_of_w$i"} = da_sql_escape_string($link,${"value_of_w$i"});
253
	${"value_of_w$i"} = da_sql_escape_string($link,${"value_of_w$i"});
231
	$where .= ($i == 1) ? ' WHERE ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" :
254
	$where .= ($i == 1) ? ' WHERE ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" :
232
				' AND ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" ;
255
				' AND ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" ;
233
	$i++;
256
	$i++;
Line 294... Line 317...
294
					$info = time2strclock($info);
317
					$info = time2strclock($info);
295
				if ($info == '')
318
				if ($info == '')
296
					$info = '-';
319
					$info = '-';
297
				if ($val == 'username'){
320
				if ($val == 'username'){
298
					$Info = urlencode($info);
321
					$Info = urlencode($info);
299
					$info = "<a href=\"user_admin.php?login=$Info\" title=\"Edit user $info\">$info</a>";
322
					$info = "<a href=\"user_admin.php?login=$Info\" title=\"$l_edit_user $info\">$info</a>";
300
				}
323
				}
301
				echo <<<EOM
324
				echo <<<EOM
302
			<td>$info</td>
325
			<td>$info</td>
303
EOM;
326
EOM;
304
			}
327
			}