Subversion Repositories ALCASAR

Rev

Rev 1805 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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