Subversion Repositories ALCASAR

Rev

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