Subversion Repositories ALCASAR

Rev

Rev 2512 | Rev 2565 | 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 2513 2018-03-11 16:13:17Z 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;
2512 tom.houday 298
			case 'CoovaChilli-Max-Input-Octets' :
2319 tom.houday 299
				$advanced = true;
2512 tom.houday 300
				$help_link = "help/coovachilli_max_input_octets_help.html";
2319 tom.houday 301
				$desc = $l_max_input_octets;
2312 tom.houday 302
				break;
2512 tom.houday 303
			case 'CoovaChilli-Max-Output-Octets' :
2319 tom.houday 304
				$advanced = true;
2512 tom.houday 305
				$help_link = "help/coovachilli_max_output_octets_help.html";
2319 tom.houday 306
				$desc = $l_max_output_octets;
2312 tom.houday 307
				break;
2512 tom.houday 308
			case 'CoovaChilli-Max-Total-Octets' :
2319 tom.houday 309
				$advanced = true;
2512 tom.houday 310
				$help_link = "help/coovachilli_max_total_octets_help.html";
2319 tom.houday 311
				$desc = $l_max_total_octets;
2312 tom.houday 312
				break;
2513 tom.houday 313
			case 'CoovaChilli-Max-Total-Octets-Daily' :
314
				$advanced = true;
315
				$help_link = "help/coovachilli_max_total_octets_help.html";
316
				$desc = $l_max_total_octets_daily;
317
				break;
318
			case 'CoovaChilli-Max-Total-Octets-Monthly' :
319
				$advanced = true;
320
				$help_link = "help/coovachilli_max_total_octets_help.html";
321
				$desc = $l_max_total_octets_monthly;
322
				break;
2512 tom.houday 323
			case 'CoovaChilli-Bandwidth-Max-Up' :
2319 tom.houday 324
				$advanced = true;
2512 tom.houday 325
				$help_link = "help/coovachilli_bandwidth_max_up_help.html";
2319 tom.houday 326
				$desc = $l_max_bandwidth_up;
2312 tom.houday 327
				break;
2512 tom.houday 328
			case 'CoovaChilli-Bandwidth-Max-Down' :
2319 tom.houday 329
				$advanced = true;
2512 tom.houday 330
				$help_link = "help/coovachilli_bandwidth_max_down_help.html";
2319 tom.houday 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;
2501 tom.houday 338
			case 'Alcasar-Filter' :
2319 tom.houday 339
				$advanced = false;
340
				$help_link = "help/filtering_help.html";
341
				$desc = $l_filtering;
1377 richard 342
				break;
2505 tom.houday 343
			case 'Alcasar-Protocols-Filter' :
2501 tom.houday 344
				$advanced = false;
345
				$help_link = "help/protocols_help.html";
346
				$desc = $l_proto;
347
				break;
2505 tom.houday 348
			case 'Alcasar-Status-Page-Must-Stay-Open' :
2501 tom.houday 349
				$advanced = false;
350
				$help_link = "help/statusOpenRequired_help.html";
351
				$desc = $l_statusOpenRequired;
352
				break;
2510 tom.houday 353
			case 'Alcasar-Expire-After' :
354
				$advanced = false;
355
				$help_link = "help/max_all_session_help.html";
356
				$desc = $l_max_all_session;
357
				break;
1326 richard 358
			default:
2319 tom.houday 359
				$advanced = true;
1326 richard 360
				break;
361
		}
2312 tom.houday 362
 
363
		$advancedField = ($advanced) ? ' class="advanced-field"' : '';
364
 
365
		if ($show_ops) {
366
			print <<<EOM
367
				<tr$advancedField>
368
				<td class="etiquette">
369
				<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>
370
				</td>
1326 richard 371
EOM;
372
			switch ($key){
1805 clement.si 373
				case 'Simultaneous-Use' :
1326 richard 374
				case 'Max-All-Session' :
375
				case 'Max-Daily-Session' :
376
				case 'Max-Weekly-Session' :
377
				case 'Max-Monthly-Session' :
1805 clement.si 378
				case 'Login-Time' :
1326 richard 379
				case 'Expiration' :
2510 tom.houday 380
				case 'Alcasar-Expire-After' :
2513 tom.houday 381
				case 'CoovaChilli-Max-Total-Octets-Daily' :
382
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
2312 tom.houday 383
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\":=\">:=</option></select></td>";
1326 richard 384
					break;
385
				case 'Session-Timeout' :
2512 tom.houday 386
				case 'CoovaChilli-Max-Input-Octets' :
387
				case 'CoovaChilli-Max-Output-Octets' :
388
				case 'CoovaChilli-Max-Total-Octets' :
389
				case 'CoovaChilli-Bandwidth-Max-Up' :
390
				case 'CoovaChilli-Bandwidth-Max-Down' :
1326 richard 391
				case 'WISPr-Redirection-URL' :
2501 tom.houday 392
				case 'Alcasar-Filter' :
2505 tom.houday 393
				case 'Alcasar-Protocols-Filter' :
394
				case 'Alcasar-Status-Page-Must-Stay-Open' :
2312 tom.houday 395
					echo "<td><select name=\"$oper_name\"><option $selected[$op_eq] value=\"=\">=</option></select></td>";
1326 richard 396
					break;
397
				default :
398
					print <<<EOM
2312 tom.houday 399
						<td>
400
							<select name=\"$oper_name\">
401
								<option $selected[$op_eq] value="=">=</option>
402
								<option $selected[$op_set] value=":=">:=</option>
403
								<option $selected[$op_add] value="+=">+=</option>
404
								<option $selected[$op_eq2] value="==">==</option>
405
								<option $selected[$op_ne] value="!=">!=</option>
406
								<option $selected[$op_gt] value=">">&gt;</option>
407
								<option $selected[$op_ge] value=">=">&gt;=</option>
408
								<option $selected[$op_lt] value="<">&lt;</option>
409
								<option $selected[$op_le] value="<=">&lt;=</option>
410
								<option $selected[$op_regeq] value="=~">=~</option>
411
								<option $selected[$op_regne] value="!~">!~</option>
412
								<option $selected[$op_exst] value="=*">=*</option>
413
								<option $selected[$op_nexst] value="!*">!*</option>
414
							</select>
415
						</td>
416
EOM;
417
					break;
418
			}
419
		} else {
420
			print <<<EOM
421
				<tr$advancedField>
422
				<td class="etiquette" colspan="$colspan">
423
				<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>
424
EOM;
425
			switch ($key) {
426
				case 'Simultaneous-Use' :
427
				case 'Max-All-Session' :
428
				case 'Max-Daily-Session' :
429
				case 'Max-Weekly-Session' :
430
				case 'Max-Monthly-Session' :
431
				case 'Login-Time' :
432
				case 'Expiration' :
2510 tom.houday 433
				case 'Alcasar-Expire-After' :
2513 tom.houday 434
				case 'CoovaChilli-Max-Total-Octets-Daily' :
435
				case 'CoovaChilli-Max-Total-Octets-Monthly' :
2312 tom.houday 436
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\":=\">";
437
					break;
438
				case 'Session-Timeout' :
2512 tom.houday 439
				case 'CoovaChilli-Max-Input-Octets' :
440
				case 'CoovaChilli-Max-Output-Octets' :
441
				case 'CoovaChilli-Max-Total-Octets' :
442
				case 'CoovaChilli-Bandwidth-Max-Up' :
443
				case 'CoovaChilli-Bandwidth-Max-Down' :
2312 tom.houday 444
				case 'WISPr-Redirection-URL' :
2501 tom.houday 445
				case 'Alcasar-Filter' :
2505 tom.houday 446
				case 'Alcasar-Protocols-Filter' :
447
				case 'Alcasar-Status-Page-Must-Stay-Open' :
2312 tom.houday 448
					echo "<input type=\"hidden\" name=\"$oper_name\" value=\"=\">";
449
					break;
450
				default :
451
					print <<<EOM
452
						<select name=\"$oper_name\">
453
							<option $selected[$op_eq] value="=">=</option>
454
							<option $selected[$op_set] value=":=">:=</option>
455
							<option $selected[$op_add] value="+=">+=</option>
456
							<option $selected[$op_eq2] value="==">==</option>
457
							<option $selected[$op_ne] value="!=">!=</option>
458
							<option $selected[$op_gt] value=">">&gt;</option>
459
							<option $selected[$op_ge] value=">=">&gt;=</option>
460
							<option $selected[$op_lt] value="<">&lt;</option>
461
							<option $selected[$op_le] value="<=">&lt;=</option>
462
							<option $selected[$op_regeq] value="=~">=~</option>
463
							<option $selected[$op_regne] value="!~">!~</option>
464
							<option $selected[$op_exst] value="=*">=*</option>
465
							<option $selected[$op_nexst] value="!*">!*</option>
1326 richard 466
						</select>
467
EOM;
468
					break;
469
			}
2312 tom.houday 470
			echo '</td>';
1326 richard 471
		}
1805 clement.si 472
/*
2312 tom.houday 473
Ajout du choix d'unité (pour les durées limites de session,journée et de mois)
1326 richard 474
et d'un calendrier pour la date d'expiration
475
Sauf dans le cas de la visualisation
476
*/
2312 tom.houday 477
		echo '<td>';
478
		if ($create === 0){
1326 richard 479
			switch ($name){
480
				/*
2312 tom.houday 481
				Choix de l'unité jour, heures, minutes ou secondes
482
				pour les durées limites max, de session,de journée et de mois
1805 clement.si 483
				*/
1326 richard 484
				case 'Session-Timeout' :
485
				case 'Max-Daily-Session' :
486
					/*valeur d'origine de durée limite */
2312 tom.houday 487
					echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
1326 richard 488
					/* Choix d'unité*/
489
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
490
							<option value=\"s\" selected>s</option>
491
							<option value=\"m\" >m</option>
492
							<option value=\"H\" >H</option>
493
						</select>";
494
					break;
2312 tom.houday 495
				case 'Max-Monthly-Session' :
1326 richard 496
				case 'Max-All-Session' :
2510 tom.houday 497
				case 'Alcasar-Expire-After' :
1326 richard 498
					/*valeur d'origine de durée limite */
2312 tom.houday 499
					echo"<input type=\"text\" name=\"$name\" onfocus=\"this.value=''\" value=\"$val\" size=10>";
1326 richard 500
					/* Choix d'unité*/
501
					echo" <select name=\"$name"."_opt"."\" onchange=\"temps(this,'$name','newuser')\">
502
							<option value=\"s\" selected>s</option>
503
							<option value=\"m\" >m</option>
504
							<option value=\"H\" >H</option>
505
							<option value=\"J\" >J</option>
506
						</select>";
507
					break;
1566 richard 508
				case 'Expiration' :
1326 richard 509
					/*Ajout du calendrier pour choisir la date*/
2312 tom.houday 510
					echo"<input id=\"popup_container\" type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
1326 richard 511
					break;
2501 tom.houday 512
				case 'Alcasar-Filter' :
513
					echo "<select name=\"$name\">";
514
					echo "<option value=\"\"></option>";
515
					echo "<option value=\"1\">$l_filtering_none</option>";
516
					echo "<option value=\"2\">$l_filtering_havp</option>";
517
					echo "<option value=\"3\">$l_filtering_havp_bl</option>";
518
					echo "<option value=\"4\">$l_filtering_havp_wl</option>";
1377 richard 519
					echo "</select>";
520
					break;
2505 tom.houday 521
				case 'Alcasar-Protocols-Filter' :
2501 tom.houday 522
					echo "<select name=\"$name\">";
523
					echo "<option value=\"\"></option>";
524
					echo "<option value=\"1\">$l_proto_0</option>";
525
					echo "<option value=\"2\">$l_proto_1</option>";
526
					echo "<option value=\"3\">$l_proto_2</option>";
527
					echo "<option value=\"4\">$l_proto_3</option>";
528
					echo "</select>";
529
					break;
2505 tom.houday 530
				case 'Alcasar-Status-Page-Must-Stay-Open' :
2501 tom.houday 531
					echo "<label><input type=\"radio\" name=\"$name\" value=\"\" checked>$l_yes</label>
532
						<label><input type=\"radio\" name=\"$name\" value=\"2\">$l_no</label>";
533
					break;
1326 richard 534
				default :
2312 tom.houday 535
					echo "<input type=\"text\" name=\"$name\" value=\"$val\" size=\"20\">";
1326 richard 536
					break;
537
			}
538
		}
2312 tom.houday 539
		echo '</td>';
1326 richard 540
	}
2312 tom.houday 541
 
2394 tom.houday 542
 
2006 raphael.pi 543
	print <<<EOM
2424 tom.houday 544
	<tr>
2312 tom.houday 545
		<td class="etiquette" colspan="$colspan">
1326 richard 546
			$l_lang_ticket
547
		</td>
548
		<td width=20>
549
EOM;
2312 tom.houday 550
/*Choix de la langue du ticket d'impression*/
1326 richard 551
	echo" <select name=\"$langue_imp\" onchange=\"lang_imp(this,'newuser')\">
552
			<option value=\"fr\" selected>Fran&ccedil;ais</option>
553
			<option value=\"en\" >English</option>
554
			<option value=\"nl\" >Nederlandse</option>
555
			<option value=\"de\" >Deutsch</option>
556
			<option value=\"es\" >Espa&ntilde;ol</option>
557
			<option value=\"it\" >Italiano</option>
558
			<option value=\"pt\" >Portugês</option>
1805 clement.si 559
		</select></td></tr>";
2312 tom.houday 560
	}
561
echo "</table><br>";
1326 richard 562
if($create == 1)
563
{
2312 tom.houday 564
	echo "<center><a href=\"user_admin.php?login=$login\">$l_show_profile</a></center>";
1326 richard 565
}
566
else
567
{
2312 tom.houday 568
	echo "<input type=\"submit\" class=button value=\"$l_create\" OnClick=\"return formControl('newuser');\">";
569
	echo "<input type=\"hidden\" name=\"nbtickets\" value=\"\">";
570
	echo "<button type=\"button\" id =\"show-advanced-fields\" onclick=\"showAdvancedFields(true)\" style=\"float: right; display: none;\">$l_simple_menu</button>";
571
	echo "<button type=\"button\" id =\"hide-advanced-fields\" onclick=\"showAdvancedFields(false)\" style=\"float: right;\">$l_advanced_menu</button>";
1326 richard 572
	echo "<br>$l_or :<br>";
2312 tom.houday 573
	echo "<input type=\"button\" class=button value=\"$l_create_multiple\" OnClick=\"return createTickets(this.form, '$l_createTicketsMSG');\">";
1326 richard 574
	echo $l_create_multiple_comment;
575
}
576
?>
577
</form>
2312 tom.houday 578
 
579
	</td></tr>
1326 richard 580
</table>
2312 tom.houday 581
</tr>
582
</table>
583
</center>
584
</TD></TR>
1326 richard 585
</TABLE>
586
</td></tr>
587
</TABLE>
588
</body>
589
</html>