Subversion Repositories ALCASAR

Rev

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

Rev 2226 Rev 2312
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
# $Id: user_new.php 2312 2017-06-26 15:56:20Z tom.houdayer $
2
 
3
 
3
//update Filter-Id for protocol filtering
-
 
4
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id']))
-
 
5
{
-
 
6
	$upId = (int)$_POST['Filter-Proto'];
-
 
7
	$downId = (int)$_POST['Filter-Id'];
-
 
8
	$upId = $upId+$downId;
-
 
9
	$upId = str_pad($upId, 8, '0', STR_PAD_LEFT);
-
 
10
	$_POST['Filter-Id'] = $upId;
-
 
11
}
-
 
12
 
-
 
13
if (!isset ($create)) $create=0;
-
 
14
if (!isset ($show)) $show=0;
-
 
15
// ticket d'impression (thank's to Geoffroy MUSITELLI)
-
 
16
//gestion de la langue
4
//gestion de la langue
17
if (is_file("../lib/langues.php"))
5
if (is_file("../lib/langues.php"))
18
	include("../lib/langues.php");
6
	include("../lib/langues.php");
19
 
7
 
-
 
8
require('../lib/operators.php');
-
 
9
 
-
 
10
if(!isset($create)) $create=0;
-
 
11
if(!isset($show)) $show=0;
20
if(!isset($login)) $login = '';
12
if(!isset($login)) $login = '';
21
if(!isset($cn)) $cn = '';
13
if(!isset($cn)) $cn = '';
22
if(!isset($mail)) $mail = '';
14
if(!isset($mail)) $mail = '';
23
if(!isset($langue_imp)) $langue_imp = '';
15
if(!isset($langue_imp)) $langue_imp = '';
-
 
16
if(!isset($selected)) $selected = array();
-
 
17
if(!isset($selected['='])) $selected['='] = '';
24
 
18
 
25
require('/etc/freeradius-web/config.php');
19
//update Filter-Id for protocol filtering
26
if($show == 2)
20
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id']))
27
{
21
{
28
	header("Location: user_new2.php");
22
	$upId = (int)$_POST['Filter-Proto'];
-
 
23
	$downId = (int)$_POST['Filter-Id'];
29
	exit;
24
	$upId = $upId+$downId;
-
 
25
	$upId = str_pad($upId, 8, '0', STR_PAD_LEFT);
-
 
26
	$_POST['Filter-Id'] = $upId;
30
}
27
}
-
 
28
 
-
 
29
require('/etc/freeradius-web/config.php');
31
require('../lib/attrshow.php');
30
require('../lib/attrshow.php');
32
require('../lib/defaults.php');
31
require('../lib/defaults.php');
-
 
32
 
33
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){
33
if (false && /* Hide operator column */ $config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true') {
34
	$colspan=2;
34
	$colspan = 2;
35
	$show_ops=1;
35
	$show_ops = 1;
36
}else{
36
} else {
37
	$show_ops = 0;
37
	$show_ops = 0;
38
	$colspan=1;
38
	$colspan = 1;
39
}
39
}
40
?>
40
?>
41
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
41
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
 
42
<html>
42
<head>
43
<head>
43
<title>Voucher creation</title>
44
<title>User creation</title>
44
<meta http-equiv="Content-Type" content="text/html; charset=<?php  echo $config['general_charset']?>">
45
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
45
<link rel="stylesheet" href="/css/style.css">
46
<link rel="stylesheet" href="/css/style.css">
46
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css">
47
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css">
47
<script type="text/javascript" src="/js/epoch_classes.js"></script>
48
<script type="text/javascript" src="/js/epoch_classes.js"></script>
48
<script type="text/javascript" src="/js/fonctions.js"></script>
49
<script type="text/javascript" src="/js/fonctions.js"></script>
49
<script language="javascript" type="text/javascript">
50
<script language="javascript" type="text/javascript">
50
 
51
 
51
/*Insert a calendar */
52
/*Insertion du calendrier */
52
	var dp_cal;
53
	var dp_cal;
53
window.onload = function () {
54
window.onload = function () {
54
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
55
	dp_cal  = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
55
};
56
};
-
 
57
/*Fin calendrier*/
-
 
58
 
56
</script>
59
</script>
-
 
60
<script type="text/javascript">
-
 
61
	function showAdvancedFields(show) {
-
 
62
		var form = document.forms['newuser'];
-
 
63
		var btn_show = document.getElementById('show-advanced-fields');
-
 
64
		var btn_hide = document.getElementById('hide-advanced-fields');
-
 
65
 
-
 
66
		if (show) {
-
 
67
			btn_hide.style.display = null;
-
 
68
			btn_show.style.display = 'none';
-
 
69
			form.className += ' hide-advanced-fields';
-
 
70
		} else {
-
 
71
			btn_show.style.display = null;
-
 
72
			btn_hide.style.display = 'none';
-
 
73
			form.className = form.className.replace(' hide-advanced-fields', '');
-
 
74
 
-
 
75
		}
-
 
76
	}
-
 
77
</script>
-
 
78
<style type="text/css">
-
 
79
	.hide-advanced-fields .advanced-field {
-
 
80
		display: none;
-
 
81
	}
-
 
82
</style>
57
</head>
83
</head>
58
<body>
84
<body>
59
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
85
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
60
	<tr><th><?php  echo"$l_users_managment"; ?></th></tr>
86
	<tr><th><?php echo "$l_users_managment"; ?></th></tr>
61
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
87
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
62
</TABLE>
88
</TABLE>
63
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
89
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
64
	<tr bgcolor="#666666"><td>
90
	<tr bgcolor="#666666"><td>
65
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
91
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
Line 67... Line 93...
67
<center>
93
<center>
68
<table border=0 width=620 cellpadding=1 cellspacing=1>
94
<table border=0 width=620 cellpadding=1 cellspacing=1>
69
<tr valign=top>
95
<tr valign=top>
70
<td width=400></td>
96
<td width=400></td>
71
<td bgcolor="black">
97
<td bgcolor="black">
72
	<table border=0 width=100% cellpadding=2 cellspacing=0>
98
	<table border="0" width="100%" cellpadding="2" cellspacing="0">
73
	<tr bgcolor="#907030" align=right valign=top><th>
99
	<tr bgcolor="#907030" align="right" valign="top"><th>
74
	<font color="white"><?php  echo "$l_user_create"; ?></font>
100
	<font color="white"><? echo "$l_user_create"; ?></font>
75
	</th></tr>
101
	</th></tr>
76
	</table>
102
	</table>
77
</td></tr>
103
</td></tr>
78
<tr bgcolor="black" valign=top><td colspan=2>
104
<tr bgcolor="black" valign="top"><td colspan="2">
79
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
105
	<table border="0" width="100%" cellpadding="12" cellspacing="0" bgcolor="#ffffd0" valign="top">
80
	<tr><td>
106
	<tr><td>
81
<?php
107
<?php
82
function sec_imp($time)
108
function sec_imp($time)
83
/* Formatage des secondes avant l'impression */
109
/*Formatage des secondes avant l'impression */
84
{
110
{
85
	$result = '';
111
	$result = '';
86
	$jour = 0;$heure = 0;$minute = 0;$seconde = 0;
112
	$jour = 0;$heure = 0;$minute = 0;$seconde = 0;
87
	$jour = floor($time/86400);
113
	$jour = floor($time/86400);
88
	$reste = $time%86400;
114
	$reste = $time%86400;
Line 109... Line 135...
109
		/*création de l'utilisateur*/
135
		/*création de l'utilisateur*/
110
		if (is_file("../lib/$config[general_lib_type]/create_user.php"))
136
		if (is_file("../lib/$config[general_lib_type]/create_user.php"))
111
			include("../lib/$config[general_lib_type]/create_user.php");
137
			include("../lib/$config[general_lib_type]/create_user.php");
112
		/*  Petit traitement pré-impression pour la lisibilité */
138
		/*  Petit traitement pré-impression pour la lisibilité */
113
		/*  Récupération des attributs du groupe le cas échéant */
139
		/*  Récupération des attributs du groupe le cas échéant */
114
		if (isset($_POST['Fgroup']) && $_POST['Fgroup']!=''){
140
		if (isset($group) && $group!=''){
115
			$group = $_POST['Fgroup'];
-
 
116
			$Fgroup = $_POST['Fgroup'];
-
 
117
			$saved_login = $login;
141
			$saved_login = $login;
118
			$login = $group;
142
			$login = $group;
119
			if (is_file("../lib/sql/group_info.php"))
143
			if (is_file("../lib/sql/group_info.php"))
120
				include("../lib/sql/group_info.php");
144
				include("../lib/sql/group_info.php");
121
			$login = $saved_login;}
145
			$login = $saved_login;}
122
		
-
 
123
		/*  Si les valeurs de durée sont vide remplissage avec la valeur 'Illimitée'*/
146
		/*  Si les valeurs de durée sont vide remplissage avec la valeur 'Illimitée'*/
124
		/*  et formatage des secondes sous le format Heure min ses*/
147
		/*  et formatage des secondes sous le format Heure min ses*/
125
		if ($sto_imp==''){ $sto_imp='-';}
148
		if ($sto_imp==''){ $sto_imp='-';}
126
			else { $sto_imp=sec_imp($sto_imp);}
149
			else { $sto_imp=sec_imp($sto_imp);}
127
		if ($mas_imp==''){ $mas_imp='-';}
150
		if ($mas_imp==''){ $mas_imp='-';}
Line 144... Line 167...
144
					<input type="hidden" name="mas_imp"    value="'.$mas_imp.'">
167
					<input type="hidden" name="mas_imp"    value="'.$mas_imp.'">
145
					<input type="hidden" name="mds_imp"    value="'.$mds_imp.'">
168
					<input type="hidden" name="mds_imp"    value="'.$mds_imp.'">
146
					<input type="hidden" name="mms_imp"    value="'.$mms_imp.'">
169
					<input type="hidden" name="mms_imp"    value="'.$mms_imp.'">
147
					<input type="hidden" name="exp_imp"    value="'.$Expiration.'">
170
					<input type="hidden" name="exp_imp"    value="'.$Expiration.'">
148
				</form>';
171
				</form>';
149
			echo'	<a href="#" onclick="document.forms[\'impression\'].submit();">';echo "$l_create_ticket</a>";
172
			echo'	<a href="#" onclick="document.forms[\'impression\'].submit();">'.$l_create_ticket.'</a>';
150
			//fin ticket impression
173
			//fin ticket impression
151
		}
174
		}
152
		else //utilisateur = adresse mac
175
		else //utilisateur = adresse mac
153
		{
176
		{
154
			exec("sudo /usr/bin/systemctl reload chilli.service");
177
			exec("sudo /usr/bin/systemctl reload chilli.service");
Line 157... Line 180...
157
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
180
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
158
			include("../lib/$config[general_lib_type]/user_info.php");
181
			include("../lib/$config[general_lib_type]/user_info.php");
159
	}
182
	}
160
}
183
}
161
?>
184
?>
162
   <form name="newuser" method=post>
185
   <form name="newuser" method="post" class=" hide-advanced-fields">
163
      <input type=hidden name=create value="0">
186
      <input type=hidden name=create value="0">
164
      <input type=hidden name=show value="0">
187
      <input type=hidden name=show value="0">
165
	  <input type=hidden name=langue_imp value='fr'>
188
	  <input type=hidden name=langue_imp value='fr'>
-
 
189
	<table border="1" bordercolordark="#ffffe0" bordercolorlight="#000000" width="100%" cellpadding="2" cellspacing="0" bgcolor="#ffffe0" valign="top">
166
<?php
190
<?php
167
if($create==0){
191
if($create==0){
168
	echo <<<EOM
192
	echo <<<EOM
169
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
-
 
170
	<tr>
193
	<tr>
171
		<td class="etiquette" colspan=$colspan>
194
		<td class="etiquette" colspan="$colspan">
172
		$l_login
195
		$l_login
173
		</td><td>
196
		</td><td>
174
		<input type=text name="login" value="$login" size=20>
197
		<input type=text name="login" value="$login" size=20>
175
		</td>
198
		</td>
176
	</tr>
199
	</tr>
177
	<tr>
200
	<tr>
178
		<td class="etiquette" colspan=$colspan>
201
		<td class="etiquette" colspan="$colspan">
179
		$l_password
202
		$l_password
180
		</td><td>
203
		</td><td>
181
		<input type=password name="passwd" size=20>
204
		<input type=password name="passwd" size=20>
182
		<br><input type="button" value="$l_passwd_gen" onclick="password(8,'newuser')">
205
		<br><input type="button" value="$l_passwd_gen" onclick="password(8,'newuser')">
183
		<input type="text" value="" name="pwdgene" size=10 readonly>
206
		<input type="text" value="" name="pwdgene" size=10 readonly>
Line 187... Line 210...
187
	if ($config['general_lib_type'] == 'sql'){
210
	if ($config['general_lib_type'] == 'sql'){
188
		if (isset($member_groups))
211
		if (isset($member_groups))
189
			$selected[$member_groups[0]] = 'selected';
212
			$selected[$member_groups[0]] = 'selected';
190
		echo <<<EOM
213
		echo <<<EOM
191
	<tr>
214
	<tr>
192
		<td class="etiquette" colspan=$colspan>
215
		<td class="etiquette" colspan="$colspan">
193
		$l_group
216
		$l_group
194
		</td><td>
217
		</td><td>
195
EOM;
218
EOM;
196
		include_once("../lib/$config[general_lib_type]/group_info.php");
219
		include_once("../lib/$config[general_lib_type]/group_info.php");
197
		if (isset($existing_groups)){
220
		if (isset($existing_groups)){
198
			echo "<select name=\"Fgroup\">";
221
			echo "<select name=\"Fgroup\">";
199
			echo "<option value=\"\" selected>";
222
			echo "<option value=\"\" selected></option>";
200
			foreach ($member_groups as $group)
223
			foreach ($member_groups as $group)
201
				echo "<option value=\"$group\">$group\n";
224
				echo "<option value=\"$group\">$group</option>\n";
202
			echo " </select>";
225
			echo " </select>";
203
			}
226
			}
204
		else echo "$l_group_empty";
227
		else echo "$l_group_empty";
205
	echo "</td></tr>";
228
	echo "</td></tr>";
206
	}
229
	}
207
	if ($config['general_lib_type'] == 'ldap' ||
230
	if ($config['general_lib_type'] == 'ldap' ||
208
	($config['general_lib_type'] == 'sql' && $config['sql_use_user_info_table'] == 'true')){
231
	($config['general_lib_type'] == 'sql' && $config['sql_use_user_info_table'] == 'true')){
209
		echo <<<EOM
232
		echo <<<EOM
210
	<tr>
233
	<tr>
211
		<td class="etiquette" colspan=$colspan>
234
		<td class="etiquette" colspan="$colspan">
212
		$l_name
235
		$l_name
213
		</td><td>
236
		</td><td>
214
		<input type=text name="Fcn" value="$cn" size=20>
237
		<input type=text name="Fcn" value="$cn" size=20>
215
		</td>
238
		</td>
216
	</tr>
239
	</tr>
217
	<tr>
240
	<tr>
218
		<td class="etiquette" colspan=$colspan>
241
		<td class="etiquette" colspan="$colspan">
219
		$l_email
242
		$l_email
220
		</td><td>
243
		</td><td>
221
		<input type=text name="Fmail" value="$mail" size=20>
244
		<input type=text name="Fmail" value="$mail" size=20>
222
		</td>
245
		</td>
223
	</tr>
246
	</tr>
224
EOM;
247
EOM;
225
	}
248
	}
226
	foreach($show_attrs as $key => $desc){
249
	foreach ($show_attrs as $key => $desc) {
227
		$name = $attrmap["$key"];
250
		$name = $attrmap["$key"];
228
		if ($name == 'none')
251
		if ($name == 'none')
229
			continue;
252
			continue;
230
		$oper_name = $name . '_op';
253
		$oper_name = $name . '_op';
231
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){
254
		if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != '') {
232
			$val = $item_vals["$key"][0];
255
			$val = $item_vals["$key"][0];
233
		} else if(isset($default_vals["$key"][0])) {
256
		} else if(isset($default_vals["$key"][0])){
234
			$val = $default_vals["$key"][0];
257
			$val = $default_vals["$key"][0];
235
		} else {
258
		} else{
236
			$val = '';
259
			$val = '';
237
		}
260
		}
238
		/*
-
 
239
		Gestion d'un mode simple ou d'un mode avancé
-
 
240
		Définition du mode avancé: les attributs concernant la gestion des octets, de la bande passante
-
 
241
		*/
-
 
242
		switch ($key)
261
		switch ($key)
243
		{
262
		{
244
			case 'ChilliSpot-Max-Input-Octets' :
-
 
245
			case 'ChilliSpot-Max-Output-Octets' :
-
 
246
			case 'ChilliSpot-Max-Total-Octets' :
-
 
247
			case 'ChilliSpot-Bandwidth-Max-Up' :
-
 
248
			case 'ChilliSpot-Bandwidth-Max-Down' :
-
 
249
			case 'WISPr-Redirection-URL' :
-
 
250
			case 'Login-Time' :
-
 
251
			case 'Session-Timeout' :
-
 
252
			case 'Max-Daily-Session' :
-
 
253
			case 'Max-Monthly-Session' :
-
 
254
				$advanced=0; //<-- attribut non-affiché
263
		// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
255
				break;
-
 
256
			case 'Simultaneous-Use' :
264
			case 'Simultaneous-Use' :
257
				$advanced=1;
265
				$advanced=false;
258
				$help_link="help/simultaneous_use_help.html";
266
				$help_link="help/simultaneous_use_help.html";
259
				$desc=$l_simultaneous_use;
267
				$desc=$l_simultaneous_use;
260
				break;
268
				break;
261
			case 'Max-All-Session' :
269
			case 'Max-All-Session' :
262
				$advanced=1;
270
				$advanced=false;
263
				$help_link="help/max_all_session_help.html";
271
				$help_link="help/max_all_session_help.html";
264
				$desc=$l_max_all_session;
272
				$desc=$l_max_all_session;
265
				break;
273
				break;
-
 
274
			case 'Session-Timeout' :
-
 
275
				$advanced=true;
-
 
276
				$help_link="help/session_timeout_help.html";
-
 
277
				$desc=$l_session_timeout;
-
 
278
				break;
-
 
279
			case 'Max-Daily-Session' :
-
 
280
				$advanced=true;
-
 
281
				$help_link="help/session_timeout_help.html";
-
 
282
				$desc=$l_daily_timeout;
-
 
283
				break;
-
 
284
			case 'Max-Monthly-Session' :
-
 
285
				$advanced=true;
-
 
286
				$help_link="help/session_timeout_help.html";
-
 
287
				$desc=$l_monthly_timeout;
-
 
288
				break;
-
 
289
			case 'Login-Time' :
-
 
290
				$advanced=true;
-
 
291
				$help_link="help/login_time_help.html";
-
 
292
				$desc=$l_login_time;
-
 
293
				break;
266
			case 'Expiration' :
294
			case 'Expiration' :
267
				$advanced=1;
295
				$advanced=false;
268
				$help_link="help/expiration_help.html";
296
				$help_link="help/expiration_help.html";
269
				$desc=$l_expiration;
297
				$desc=$l_expiration;
270
				break;
298
				break;
-
 
299
			case 'ChilliSpot-Max-Input-Octets' :
-
 
300
				$advanced=true;
-
 
301
				$help_link="help/chillispot_max_input_octets_help.html";
-
 
302
				$desc=$l_max_input_octets;
-
 
303
				break;
-
 
304
			case 'ChilliSpot-Max-Output-Octets' :
-
 
305
				$advanced=true;
-
 
306
				$help_link="help/chillispot_max_output_octets_help.html";
-
 
307
				$desc=$l_max_output_octets;
-
 
308
				break;
-
 
309
			case 'ChilliSpot-Max-Total-Octets' :
-
 
310
				$advanced=true;
-
 
311
				$help_link="help/chillispot_max_total_octets_help.html";
-
 
312
				$desc=$l_max_total_octets;
-
 
313
				break;
-
 
314
			case 'ChilliSpot-Bandwidth-Max-Up' :
-
 
315
				$advanced=true;
-
 
316
				$help_link="help/chillispot_bandwidth_max_up_help.html";
-
 
317
				$desc=$l_max_bandwidth_up;
-
 
318
				break;
-
 
319
			case 'ChilliSpot-Bandwidth-Max-Down' :
-
 
320
				$advanced=true;
-
 
321
				$help_link="help/chillispot_bandwidth_max_down_help.html";
-
 
322
				$desc=$l_max_bandwidth_down;
-
 
323
				break;
-
 
324
			case 'WISPr-Redirection-URL' :
-
 
325
				$advanced=true;
-
 
326
				$help_link="help/wispr_redirection_url_help.html";
-
 
327
				$desc=$l_wispr_redirection;
-
 
328
				break;
271
			case 'Filter-Id' :
329
			case 'Filter-Id' :
272
				$advanced=1;
330
				$advanced=false;
273
				$help_link="help/filtering_help.html";
331
				$help_link="help/filtering_help.html";
274
				$desc=$l_filtering;
332
				$desc=$l_filtering;
275
				break;
333
				break;
276
			default:
334
			default:
277
				$advanced=1;
335
				$advanced=1;
278
				break;
336
				break;
279
		}
337
		}
-
 
338
 
-
 
339
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
-
 
340
 
280
		if ($show_ops && $advanced){
341
		if ($show_ops) {
281
		print <<<EOM
342
			print <<<EOM
282
			<tr>
343
				<tr$advancedField>
283
			<td class="etiquette" colspan=$colspan>
344
				<td class="etiquette">
284
			<a href="$help_link" target="help" onclick="window.open('$help_link','help','width=600,height=350,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$desc</font></a>
345
				<a href="$help_link" target="help" onclick="window.open('$help_link','help','width=600,height=350,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$desc</font></a>
285
			</td>
346
				</td>
286
EOM;
347
EOM;
287
			switch ($key){
348
			switch ($key){
288
				case 'Simultaneous-Use' :
349
				case 'Simultaneous-Use' :
289
				case 'Max-All-Session' :
350
				case 'Max-All-Session' :
290
				case 'Max-Daily-Session' :
351
				case 'Max-Daily-Session' :
291
				case 'Max-Weekly-Session' :
352
				case 'Max-Weekly-Session' :
292
				case 'Max-Monthly-Session' :
353
				case 'Max-Monthly-Session' :
293
				case 'Login-Time' :
354
				case 'Login-Time' :
294
				case 'Expiration' :
355
				case 'Expiration' :
295
					echo "<input type=\"hidden\" name=$oper_name value=\":=\">";
356
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
296
					break;
357
					break;
297
				case 'Filter-Id' :
358
				case 'Filter-Id' :
298
					echo "<input type=\"hidden\" name=$oper_name value=\":=\">";
359
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
299
					break;
360
					break;
300
				case 'Session-Timeout' :
361
				case 'Session-Timeout' :
301
				case 'ChilliSpot-Max-Input-Octets' :
362
				case 'ChilliSpot-Max-Input-Octets' :
302
				case 'ChilliSpot-Max-Output-Octets' :
363
				case 'ChilliSpot-Max-Output-Octets' :
303
				case 'ChilliSpot-Max-Total-Octets' :
364
				case 'ChilliSpot-Max-Total-Octets' :
304
				case 'ChilliSpot-Bandwidth-Max-Up' :
365
				case 'ChilliSpot-Bandwidth-Max-Up' :
305
				case 'ChilliSpot-Bandwidth-Max-Down' :
366
				case 'ChilliSpot-Bandwidth-Max-Down' :
306
				case 'WISPr-Redirection-URL' :
367
				case 'WISPr-Redirection-URL' :
307
					echo "<input type=\"hidden\" name=$oper_name value=\"=\">";
368
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=</option></select></td>";
308
					break;
369
					break;
309
				default :
370
				default :
310
					print <<<EOM
371
					print <<<EOM
311
		<td>
372
						<td>
-
 
373
							<select name=\"$oper_name\">
-
 
374
								<option $selected[$op_eq] value="=">=</option>
-
 
375
								<option $selected[$op_set] value=":=">:=</option>
-
 
376
								<option $selected[$op_add] value="+=">+=</option>
-
 
377
								<option $selected[$op_eq2] value="==">==</option>
-
 
378
								<option $selected[$op_ne] value="!=">!=</option>
-
 
379
								<option $selected[$op_gt] value=">">&gt;</option>
-
 
380
								<option $selected[$op_ge] value=">=">&gt;=</option>
-
 
381
								<option $selected[$op_lt] value="<">&lt;</option>
-
 
382
								<option $selected[$op_le] value="<=">&lt;=</option>
-
 
383
								<option $selected[$op_regeq] value="=~">=~</option>
-
 
384
								<option $selected[$op_regne] value="!~">!~</option>
-
 
385
								<option $selected[$op_exst] value="=*">=*</option>
-
 
386
								<option $selected[$op_nexst] value="!*">!*</option>
-
 
387
							</select>
-
 
388
						</td>
-
 
389
EOM;
-
 
390
					break;
-
 
391
			}
-
 
392
		} else {
-
 
393
			print <<<EOM
-
 
394
				<tr$advancedField>
-
 
395
				<td class="etiquette" colspan="$colspan">
-
 
396
				<a href="$help_link" target="help" onclick="window.open('$help_link','help','width=600,height=350,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$desc</font></a>
-
 
397
EOM;
-
 
398
			switch ($key) {
-
 
399
				case 'Simultaneous-Use' :
-
 
400
				case 'Max-All-Session' :
-
 
401
				case 'Max-Daily-Session' :
-
 
402
				case 'Max-Weekly-Session' :
-
 
403
				case 'Max-Monthly-Session' :
-
 
404
				case 'Login-Time' :
-
 
405
				case 'Expiration' :
-
 
406
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
-
 
407
					break;
-
 
408
				case 'Filter-Id' :
-
 
409
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
-
 
410
					break;
-
 
411
				case 'Session-Timeout' :
-
 
412
				case 'ChilliSpot-Max-Input-Octets' :
-
 
413
				case 'ChilliSpot-Max-Output-Octets' :
-
 
414
				case 'ChilliSpot-Max-Total-Octets' :
-
 
415
				case 'ChilliSpot-Bandwidth-Max-Up' :
-
 
416
				case 'ChilliSpot-Bandwidth-Max-Down' :
-
 
417
				case 'WISPr-Redirection-URL' :
-
 
418
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
-
 
419
					break;
-
 
420
				default :
-
 
421
					print <<<EOM
312
						<select name=$oper_name>
422
						<select name=\"$oper_name\">
313
							<option $selected[$op_eq] value="=">=
423
							<option $selected[$op_eq] value="=">=</option>
314
							<option $selected[$op_set] value=":=">:=
424
							<option $selected[$op_set] value=":=">:=</option>
315
							<option $selected[$op_add] value="+=">+=
425
							<option $selected[$op_add] value="+=">+=</option>
316
							<option $selected[$op_eq2] value="==">==
426
							<option $selected[$op_eq2] value="==">==</option>
317
							<option $selected[$op_ne] value="!=">!=
427
							<option $selected[$op_ne] value="!=">!=</option>
318
							<option $selected[$op_gt] value=">">&gt;
428
							<option $selected[$op_gt] value=">">&gt;</option>
319
							<option $selected[$op_ge] value=">=">&gt;=
429
							<option $selected[$op_ge] value=">=">&gt;=</option>
320
							<option $selected[$op_lt] value="<">&lt;
430
							<option $selected[$op_lt] value="<">&lt;</option>
321
							<option $selected[$op_le] value="<=">&lt;=
431
							<option $selected[$op_le] value="<=">&lt;=</option>
322
							<option $selected[$op_regeq] value="=~">=~
432
							<option $selected[$op_regeq] value="=~">=~</option>
323
							<option $selected[$op_regne] value="!~">!~
433
							<option $selected[$op_regne] value="!~">!~</option>
324
							<option $selected[$op_exst] value="=*">=*
434
							<option $selected[$op_exst] value="=*">=*</option>
325
							<option $selected[$op_nexst] value="!*">!*
435
							<option $selected[$op_nexst] value="!*">!*</option>
326
						</select>
436
						</select>
327
					</td>
-
 
328
EOM;
437
EOM;
329
					break;
438
					break;
330
			}
439
			}
-
 
440
			echo '</td>';
331
		}
441
		}
332
/*
442
/*
333
Ajout du pré-remplissage de cellule
-
 
334
du choix d'unité (pour les durées limites de session,journée et de mois)
443
Ajout du choix d'unité (pour les durées limites de session,journée et de mois)
335
et d'un calendrier pour la date d'expiration
444
et d'un calendrier pour la date d'expiration
336
Sauf dans le cas de la visualisation
445
Sauf dans le cas de la visualisation
337
*/
446
*/
338
		if ($advanced){echo "<td>";}
447
		echo '<td>';
339
		if ($create==0 && $advanced){
448
		if ($create === 0){
340
			switch ($name){
449
			switch ($name){
341
				case 'Simultaneous-Use' :
-
 
342
					/*Pré-remplissage avec la valeur '1' pour empécher plusieurs connexions silmutanées*/
-
 
343
					$val=1;//<--cette valeur correspond au nombre de session simultanée en commentant cette ligne la valeur n'est plus pré-remplie
-
 
344
					echo"<input type=text name=\"$name\" value=\"$val\" size=20>";
-
 
345
					break;
-
 
346
				/*
450
				/*
347
				Choix de l'unité heures, minutes ou secondes
451
				Choix de l'unité jour, heures, minutes ou secondes
348
				pour les durées limites de session,journée et de mois
452
				pour les durées limites max, de session,de journée et de mois
349
				*/
453
				*/
350
				case 'Session-Timeout' :
454
				case 'Session-Timeout' :
351
				case 'Max-Daily-Session' :
455
				case 'Max-Daily-Session' :
352
					/*valeur d'origine de durée limite */
456
					/*valeur d'origine de durée limite */
353
					echo"<input type=text name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=20>";
457
					echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
354
					/* Choix d'unité*/
458
					/* Choix d'unité*/
355
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
459
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
356
							<option value=\"s\" selected>s</option>
460
							<option value=\"s\" selected>s</option>
357
							<option value=\"m\" >m</option>
461
							<option value=\"m\" >m</option>
358
							<option value=\"H\" >H</option>
462
							<option value=\"H\" >H</option>
359
						</select>";
463
						</select>";
360
					break;
464
					break;
361
				case 'Max-All-Session' :
-
 
362
				case 'Max-Monthly-Session' :
465
				case 'Max-Monthly-Session' :
-
 
466
				case 'Max-All-Session' :
363
					/*valeur d'origine de durée limite */
467
					/*valeur d'origine de durée limite */
364
					echo"<input type=text name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=20>";
468
					echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
365
					/* Choix d'unité*/
469
					/* Choix d'unité*/
366
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
470
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
367
							<option value=\"s\" selected>s</option>
471
							<option value=\"s\" selected>s</option>
368
							<option value=\"m\" >m</option>
472
							<option value=\"m\" >m</option>
369
							<option value=\"H\" >H</option>
473
							<option value=\"H\" >H</option>
370
							<option value=\"J\" >J</option>
474
							<option value=\"J\" >J</option>
371
						</select>";
475
						</select>";
372
					break;
476
					break;
373
				case 'Expiration' :
477
				case 'Expiration' :
374
					/*Pré-remplissage avec la date du lendemain*/
-
 
375
/*					$val=date("d F Y",strtotime("+1 day"));//<--en commentant cette ligne la valeur n'est plus pré-remplie
-
 
376
					/*Ajout du calendrier pour choisir la date*/
478
					/*Ajout du calendrier pour choisir la date*/
377
					echo"<input id=\"popup_container\" type=text name=\"$name\" value=\"$val\" size=20>";
479
					echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
378
					break;
480
					break;
379
				case 'Filter-Id' :
481
				case 'Filter-Id' :
380
					echo "<select name='Filter-Id'>";
482
					echo "<select name='Filter-Id'>";
381
					echo "<option value=\"00000000\">$l_filtering_none</option>";
483
					echo "<option value=\"\">$l_filtering_none</option>";
382
					echo "<option value=\"00000001\">$l_filtering_havp</option>";
484
					echo "<option value=\"00000001\">$l_filtering_havp</option>";
383
					echo "<option value=\"00000011\">$l_filtering_havp_bl</option>";
485
					echo "<option value=\"00000011\">$l_filtering_havp_bl</option>";
384
					echo "<option value=\"00000101\">$l_filtering_havp_wl</option>";
486
					echo "<option value=\"00000101\">$l_filtering_havp_wl</option>";
385
					echo "</select>";
487
					echo "</select>";
386
					break;
488
					break;
387
				default :
489
				default :
388
					if ($advanced) echo"<input type=text name=\"$name\" value=\"$val\" size=20>";
490
					echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
389
					break;
491
					break;
390
			}
492
			}
391
		}
493
		}
-
 
494
		echo '</td>';
392
	}
495
	}
393
	
496
 
394
	/*Network protocole filtering*/
497
	/*Network protocole filtering*/
395
	print <<<EOM
498
	print <<<EOM
396
	<tr>
499
	<tr>
397
		<td class="etiquette" colspan=$colspan>
500
		<td class="etiquette" colspan="$colspan">
398
		<a href="help/protocols_help.html" target=help onclick=window.open("help/protocols_help.html","help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="$l_click_for_help"><font color="blue">$l_proto</font></a>
501
		<a href="help/protocols_help.html" target="help" onclick="window.open('help/protocols_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_proto</font></a>
399
		</td>
502
		</td>
400
		<td width=20>
503
		<td width=20>
401
EOM;
504
EOM;
402
	echo" <select name='Filter-Proto'>
505
	echo" <select name='Filter-Proto'>
403
			<option value=\"00000000\" selected>$l_proto_0</option>
506
			<option value=\"00000000\" selected>$l_proto_0</option>
404
			<option value=\"10000000\" >$l_proto_1</option>
507
			<option value=\"10000000\" >$l_proto_1</option>
405
			<option value=\"01000000\" >$l_proto_2</option>
508
			<option value=\"01000000\" >$l_proto_2</option>
406
			<option value=\"00100000\" >$l_proto_3</option>
509
			<option value=\"00100000\" >$l_proto_3</option>
407
		</select></td></tr>";
510
		</select></td></tr>";
-
 
511
		
408
	print <<<EOM
512
	print <<<EOM
409
	<tr>
513
	<tr>
410
		<td class="etiquette" colspan=$colspan>
514
		<td class="etiquette" colspan="$colspan">
411
			$l_lang_ticket
515
			$l_lang_ticket
412
		</td>
516
		</td>
413
		<td width=20>
517
		<td width=20>
414
EOM;
518
EOM;
415
/*Voucher language*/
519
/*Choix de la langue du ticket d'impression*/
416
	echo" <select name=\"$langue_imp\" onchange=\"lang_imp(this,'newuser')\">
520
	echo" <select name=\"$langue_imp\" onchange=\"lang_imp(this,'newuser')\">
417
			<option value=\"fr\" selected>Fran&ccedil;ais</option>
521
			<option value=\"fr\" selected>Fran&ccedil;ais</option>
418
			<option value=\"en\" >English</option>
522
			<option value=\"en\" >English</option>
419
			<option value=\"nl\" >Nederlandse</option>
523
			<option value=\"nl\" >Nederlandse</option>
420
			<option value=\"de\" >Deutsch</option>
524
			<option value=\"de\" >Deutsch</option>
421
			<option value=\"es\" >Espa&ntilde;ol</option>
525
			<option value=\"es\" >Espa&ntilde;ol</option>
422
			<option value=\"it\" >Italiano</option>
526
			<option value=\"it\" >Italiano</option>
423
			<option value=\"pt\" >Portugês</option>
527
			<option value=\"pt\" >Portugês</option>
424
			<option value=\"ar\" >العربية</option>
-
 
425
		</select></td></tr>";
528
		</select></td></tr>";
-
 
529
	}
426
	echo "</table>";
530
echo "</table><br>";
427
}
-
 
428
if($create == 1)
531
if($create == 1)
429
{
532
{
430
	echo "<a href=\"user_admin.php?login=$login\">$l_show_profile</a>";
533
	echo "<center><a href=\"user_admin.php?login=$login\">$l_show_profile</a></center>";
431
}
534
}
432
else
535
else
433
{
536
{
434
	echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newuser');\">";
537
	echo "<input type=\"submit\" class=button value=\"$l_create\" OnClick=\"return formControl('newuser');\">";
435
	echo "<input type='hidden' name='nbtickets' value=''>";
538
	echo "<input type=\"hidden\" name=\"nbtickets\" value=\"\">";
436
	echo "<input type=submit class=button value=\"$l_advanced_menu\" style=\"float: right;\" OnClick=\"this.form.show.value=2\">";
539
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right; display: none;\">$l_simple_menu</button>";
-
 
540
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right;\">$l_advanced_menu</button>";
437
	echo "<br>$l_or :<br>";
541
	echo "<br>$l_or :<br>";
438
	echo "<input type=button class=button value=\"$l_create_multiple\" OnClick=\"return createTickets(this.form, '$l_createTicketsMSG');\">";
542
	echo "<input type=\"button\" class=button value=\"$l_create_multiple\" OnClick=\"return createTickets(this.form, '$l_createTicketsMSG');\">";
439
	echo $l_create_multiple_comment;
543
	echo $l_create_multiple_comment;
440
}
544
}
441
?>
545
?>
442
</form>
546
</form>
-
 
547
 
443
</td></tr>
548
	</td></tr>
444
</table>
549
</table>
-
 
550
</tr>
-
 
551
</table>
-
 
552
</center>
445
</td></tr>
553
</TD></TR>
446
</TABLE>
554
</TABLE>
447
</td></tr>
555
</td></tr>
448
</TABLE>
556
</TABLE>
449
</body>
557
</body>
450
</html>
558
</html>