Subversion Repositories ALCASAR

Rev

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