Project

General

Profile

« Previous | Next » 

Revision bfbd2610

Added by Carlos Eduardo Ramos almost 15 years ago

Implement gettext() calls on vpn_ipsec_mobile.php

View differences:

usr/local/www/vpn_ipsec_mobile.php
121 121
	/* input validation */
122 122

  
123 123
	$reqdfields = explode(" ", "user_source group_source");
124
	$reqdfieldsn =  explode(",", "User Authentication Source,Group Authentication Source");
124
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
125 125

  
126 126
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
127 127

  
128 128
	if ($pconfig['pool_enable'])
129 129
		if (!is_ipaddr($pconfig['pool_address']))
130
			$input_errors[] = "A valid IP address for 'Virtual Address Pool Network' must be specified.";
130
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
131 131

  
132 132
	if ($pconfig['dns_domain_enable'])
133 133
		if (!is_domain($pconfig['dns_domain']))
134
			$input_errors[] = "A valid value for 'DNS Default Domain' must be specified.";
134
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
135 135

  
136 136
	if ($pconfig['dns_server_enable']) {
137 137
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
138 138
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
139
			$input_errors[] = "At least one DNS server must be specified to enable the DNS Server option.";
139
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
140 140
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
141
			$input_errors[] = "A valid IP address for 'DNS Server #1' must be specified.";
141
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
142 142
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
143
			$input_errors[] = "A valid IP address for 'DNS Server #2' must be specified.";
143
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
144 144
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
145
			$input_errors[] = "A valid IP address for 'DNS Server #3' must be specified.";
145
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
146 146
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
147
			$input_errors[] = "A valid IP address for 'DNS Server #4' must be specified.";
147
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
148 148
	}
149 149

  
150 150
	if ($pconfig['wins_server_enable']) {
151 151
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
152
			$input_errors[] = "At least one WINS server must be specified to enable the DNS Server option.";
152
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
153 153
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
154
			$input_errors[] = "A valid IP address for 'WINS Server #1' must be specified.";
154
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
155 155
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
156
			$input_errors[] = "A valid IP address for 'WINS Server #2' must be specified.";
156
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
157 157
	}
158 158

  
159 159
	if ($pconfig['login_banner_enable'])
160 160
		if (!strlen($pconfig['login_banner']))
161
			$input_errors[] = "A valid value for 'Login Banner' must be specified.";
161
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
162 162

  
163 163
	if (!$input_errors) {
164 164
		$client = array();
......
210 210
	}
211 211
}
212 212

  
213
$pgtitle = array("VPN","IPsec","Mobile");
213
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
214 214
$statusurl = "diag_ipsec.php";
215 215
$logurl = "diag_logs_ipsec.php";
216 216

  
......
293 293
	if ($savemsg)
294 294
		print_info_box($savemsg);
295 295
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
296
		print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect.");
296
		print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));
297 297
	foreach ($a_phase1 as $ph1ent)
298 298
		if (isset($ph1ent['mobile']))
299 299
			$ph1found = true;
300 300
	if ($pconfig['enable'] && !$ph1found)
301
		print_info_box_np("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found.<br>Please click Create to define one.","create","Create Phase1");
301
		print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br>" . gettext("Please click Create to define one."),gettext("create"),gettext("Create Phase1"));
302 302
	if ($input_errors)
303 303
		print_input_errors($input_errors);
304 304
?>
......
308 308
		<td class="tabnavtbl">
309 309
			<?php
310 310
				$tab_array = array();
311
				$tab_array[0] = array("Tunnels", false, "vpn_ipsec.php");
312
				$tab_array[1] = array("Mobile clients", true, "vpn_ipsec_mobile.php");
313
				$tab_array[2] = array("Pre-shared keys", false, "vpn_ipsec_keys.php");
311
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
312
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
313
				$tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php");
314 314
				display_top_tabs($tab_array);
315 315
			?>
316 316
		</td>
......
320 320
			<div class="tabcont">
321 321
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
322 322
					<tr>
323
						<td width="22%" valign="top" class="vncellreq">IKE Extensions</td>
323
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
324 324
						<td width="78%" class="vtable">
325 325
							<table border="0" cellspacing="2" cellpadding="0">
326 326
								<tr>
......
329 329
										<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?>>
330 330
									</td>
331 331
									<td>
332
										<strong>Enable IPsec Mobile Client Support</strong>
332
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
333 333
									</td>
334 334
								</tr>
335 335
							</table>
......
340 340
					</tr>
341 341
					<tr>
342 342
						<td colspan="2" valign="top" class="listtopic">
343
							Extended Authentication (Xauth)
343
							<?=gettext("Extended Authentication (Xauth)"); ?>
344 344
						</td>
345 345
					</tr>
346 346
					<tr>
347
						<td width="22%" valign="top" class="vncellreq">User Authentication</td>
347
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
348 348
						<td width="78%" class="vtable">
349
							Source:&nbsp;&nbsp;
349
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
350 350
							<select name="user_source" class="formselect" id="user_source">
351
								<option value="system">system</option>
351
								<option value="system"><?=gettext("system"); ?></option>
352 352
							</select>
353 353
						</td>
354 354
					</tr>
355 355
					<tr>
356
						<td width="22%" valign="top" class="vncellreq">Group Authentication</td>
356
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
357 357
						<td width="78%" class="vtable">
358
							Source:&nbsp;&nbsp;
358
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
359 359
							<select name="group_source" class="formselect" id="group_source">
360
								<option value="system">system</option>
360
								<option value="system"><?=gettext("system"); ?></option>
361 361
							</select>
362 362
						</td>
363 363
					</tr>
......
366 366
					</tr>
367 367
					<tr> 
368 368
						<td colspan="2" valign="top" class="listtopic">
369
							Client Configuration (mode-cfg)
369
							<?=gettext("Client Configuration (mode-cfg)"); ?>
370 370
						</td>
371 371
					</tr>
372 372
					<tr> 
373
						<td width="22%" valign="top" class="vncell">Virtual Address Pool</td>
373
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
374 374
						<td width="78%" class="vtable">
375 375
							<table border="0" cellspacing="2" cellpadding="0">
376 376
								<tr>
......
379 379
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()">
380 380
									</td>
381 381
									<td>
382
										Provide a vitual IP address to clients<br>
382
										<?=gettext("Provide a vitual IP address to clients"); ?><br>
383 383
									</td>
384 384
								</tr>
385 385
							</table>
386 386
							<table border="0" cellspacing="2" cellpadding="0">
387 387
								<tr>
388 388
									<td>
389
										Network:&nbsp;
389
										<?=gettext("Network"); ?>:&nbsp;
390 390
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=$pconfig['pool_address'];?>">
391 391
										/
392 392
										<select name="pool_netbits" class="formselect" id="pool_netbits">
......
402 402
						</td>
403 403
					</tr>
404 404
					<tr>
405
						<td width="22%" valign="top" class="vncell">Network List</td>
405
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
406 406
						<td width="78%" class="vtable">
407 407
							<table border="0" cellspacing="2" cellpadding="0">
408 408
								<tr>
......
411 411
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>>
412 412
									</td>
413 413
									<td>
414
										Provide a list of accessible networks to clients<br>
414
										<?=gettext("Provide a list of accessible networks to clients"); ?><br>
415 415
									</td>
416 416
								</tr>
417 417
							</table>
418 418
						</td>
419 419
					</tr>
420 420
					<tr> 
421
						<td width="22%" valign="top" class="vncell">DNS Default Domain</td>
421
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
422 422
						<td width="78%" class="vtable">
423 423
							<table border="0" cellspacing="2" cellpadding="0">
424 424
								<tr>
......
427 427
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
428 428
									</td>
429 429
									<td>
430
										Provide a default domain name to clients<br>
430
										<?=gettext("Provide a default domain name to clients"); ?><br>
431 431
									</td>
432 432
								</tr>
433 433
							</table>
......
441 441
						</td>
442 442
					</tr>
443 443
					<tr> 
444
						<td width="22%" valign="top" class="vncell">DNS Servers</td>
444
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
445 445
						<td width="78%" class="vtable">
446 446
							<table border="0" cellspacing="2" cellpadding="0">
447 447
								<tr>
......
450 450
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
451 451
									</td>
452 452
									<td>
453
										Provide a DNS server list to clients<br>
453
										<?=gettext("Provide a DNS server list to clients"); ?><br>
454 454
									</td>
455 455
								</tr>
456 456
							</table>
457 457
							<table border="0" cellspacing="2" cellpadding="0">
458 458
								<tr>
459 459
									<td>
460
										Server #1:&nbsp;
460
										<?=gettext("Server"); ?> #1:&nbsp;
461 461
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
462 462
									</td>
463 463
								</tr>
464 464
								<tr>
465 465
									<td>
466
										Server #2:&nbsp;
466
										<?=gettext("Server"); ?> #2:&nbsp;
467 467
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
468 468
									</td>
469 469
								</tr>
470 470
								<tr>
471 471
									<td>
472
										Server #3:&nbsp;
472
										<?=gettext("Server"); ?> #3:&nbsp;
473 473
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
474 474
									</td>
475 475
								</tr>
476 476
								<tr>
477 477
									<td>
478
										Server #4:&nbsp;
478
										<?=gettext("Server"); ?> #4:&nbsp;
479 479
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>">
480 480
									</td>
481 481
								</tr>
......
483 483
						</td>
484 484
					</tr>
485 485
					<tr> 
486
						<td width="22%" valign="top" class="vncell">WINS Servers</td>
486
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
487 487
						<td width="78%" class="vtable">
488 488
							<table border="0" cellspacing="2" cellpadding="0">
489 489
								<tr>
......
492 492
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
493 493
									</td>
494 494
									<td>
495
										Provide a WINS server list to clients<br>
495
										<?=gettext("Provide a WINS server list to clients"); ?><br>
496 496
									</td>
497 497
								</tr>
498 498
							</table>
499 499
							<table border="0" cellspacing="2" cellpadding="0">
500 500
								<tr>
501 501
									<td>
502
										Server #1:&nbsp;
502
										<?=gettext("Server"); ?> #1:&nbsp;
503 503
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>">
504 504
									</td>
505 505
								</tr>
506 506
								<tr>
507 507
									<td>
508
										Server #2:&nbsp;
508
										<?=gettext("Server"); ?> #2:&nbsp;
509 509
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>">
510 510
									</td>
511 511
								</tr>
......
513 513
						</td>
514 514
					</tr>
515 515
					<tr>
516
						<td width="22%" valign="top" class="vncell">Phase2 PFS Group</td>
516
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
517 517
						<td width="78%" class="vtable">
518 518
							<table border="0" cellspacing="2" cellpadding="0">
519 519
								<tr>
......
522 522
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()">
523 523
									</td>
524 524
									<td>
525
										Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )<br>
525
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br>
526 526
									</td>
527 527
								</tr>
528 528
							</table>
529 529
							<table border="0" cellspacing="2" cellpadding="0">
530 530
								<tr>
531 531
									<td>
532
										Group:&nbsp;&nbsp;
532
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
533 533
										<select name="pfs_group" class="formselect" id="pfs_group">
534 534
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
535 535
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>>
......
543 543
						</td>
544 544
					</tr>
545 545
					<tr> 
546
						<td width="22%" valign="top" class="vncell">Login Banner</td>
546
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
547 547
						<td width="78%" class="vtable">
548 548
							<table border="0" cellspacing="2" cellpadding="0">
549 549
								<tr>
......
552 552
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()">
553 553
									</td>
554 554
									<td>
555
										Provide a login banner to clients<br>
555
										<?=gettext("Provide a login banner to clients"); ?><br>
556 556
									</td>
557 557
								</tr>
558 558
							</table>
......
569 569
					<tr>
570 570
						<td width="22%" valign="top">&nbsp;</td>
571 571
						<td width="78%">
572
							<input name="submit" type="submit" class="formbtn" value="Save">
572
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
573 573
						</td>
574 574
					</tr>
575 575
				</table>

Also available in: Unified diff