Subversion Repositories ALCASAR

Rev

Rev 2319 | Rev 2402 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

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