Project

General

Profile

« Previous | Next » 

Revision 9cda2fa5

Added by Stephen Beaver over 9 years ago

Revised to use print_input_errors() for consistency

View differences:

src/usr/local/www/wizards/setup_wizard.xml
128 128
		<![CDATA[
129 129
		if(empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) {
130 130
			include("head.inc");
131
			print_info_box("Hostname is invalid. Please press back in your browser window and correct.", 'danger');
131
			$input_errors[] = "Hostname is invalid. Please press back in your browser window and correct.";
132
			print_input_errors($input_errors);
132 133
			include("foot.inc");
133 134
			die;
134 135
		}
135 136
		if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
136 137
			include("head.inc");
137
			print_info_box("Domain is invalid. Please press back in your browser window and correct.", 'danger');
138
			$input_errors[] = "Domain is invalid. Please press back in your browser window and correct.";
139
			print_input_errors($input_errors);
138 140
			include("foot.inc");
139 141
			die;
140 142
		}
141 143
		if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
142 144
			include("head.inc");
143
			print_info_box("Primary DNS server is invalid. Please press back in your browser window and correct.", 'danger');
145
			$input_errors[] = "Primary DNS server is invalid. Please press back in your browser window and correct.";
146
			print_input_errors($input_errors);
144 147
			include("foot.inc");
145 148
			die;
146 149
		}
147 150
		if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
148 151
			include("head.inc");
149
			print_info_box("Second DNS server is invalid. Please press back in your browser window and correct.", 'danger');
152
			$input_errors[] = "Second DNS server is invalid. Please press back in your browser window and correct.";
153
			print_input_errors($input_errors);
150 154
			include("foot.inc");
151 155
			die;
152 156
		}
......
178 182
		<![CDATA[
179 183
		foreach (explode(' ', $_POST['timeserverhostname']) as $ts) {
180 184
			if (!is_domain($ts)) {
181
				print_info_box_np(gettext("NTP Time Server names may only contain the characters a-z, 0-9, '-' and '.'. Entries may be separated by spaces. Please press back in your browser window and correct."));
185
				$input_errors[] = gettext("NTP Time Server names may only contain the characters a-z, 0-9, '-' and '.'. Entries may be separated by spaces. Please press back in your browser window and correct.";
186
				print_input_errors($input_errors);
187
				include("foot.inc");
182 188
				die;
183 189
			}
184 190
		}
......
433 439
		<![CDATA[
434 440
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
435 441
			include("head.inc");
436
			print_info_box("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.", 'danger');
442
			$input_errors[] = "MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.";
443
			print_input_errors($input_errors);
437 444
			include("foot.inc");
438 445
			die;
439 446
		}
440 447
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
441 448
			include("head.inc");
442
			print_info_box("Invalid MAC Address. Please press back in your browser window and correct.", 'danger');
449
			$input_errors[] = "Invalid MAC Address. Please press back in your browser window and correct.";
450
			print_input_errors($input_errors);
443 451
			include("foot.inc");
444 452
			die;
445 453
		}
446 454
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
447 455
			if (!is_ipaddr($_POST['ipaddress'])) {
448 456
				include("head.inc");
449
				print_info_box("Invalid WAN IP Address. Please press back in your browser window and correct.", 'danger');
457
				$input_errors[] = "Invalid WAN IP Address. Please press back in your browser window and correct.";
458
				print_input_errors($input_errors);
450 459
				include("foot.inc");
451 460
				die;
452 461
			}
......
454 463
			    ($_POST['ipaddress'] == gen_subnet($_POST['ipaddress'], $_POST['subnetmask']) ||
455 464
			     $_POST['ipaddress'] == gen_subnet_max($_POST['ipaddress'], $_POST['subnetmask']))) {
456 465
			    include("head.inc"); 
457
				print_info_box("Invalid WAN IP Address. Please press back in your browser window and correct.", 'danger');
466
				$input_errors[] = "Invalid WAN IP Address. Please press back in your browser window and correct.";
467
				print_input_errors($input_errors);
458 468
				include("foot.inc");
459 469
				die;
460 470
			}
461 471
		}
462 472
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
463 473
			include("head.inc");
464
			print_info_box("Invalid DHCP Hostname. Please press back in your browser window and correct.", 'danger');
474
			$input_errors[] = "Invalid DHCP Hostname. Please press back in your browser window and correct.";
475
			print_input_errors($input_errors);
465 476
			include("foot.inc");
466 477
			die;
467 478
		}
468 479
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
469 480
		    include("head.inc");
470
			print_info_box("Invalid PPTP Local IP Address. Please press back in your browser window and correct.", 'danger');
481
			$input_errors[] = "Invalid PPTP Local IP Address. Please press back in your browser window and correct.";
482
			print_input_errors($input_errors);
471 483
			include("foot.inc");
472 484
			die;
473 485
		}
474 486
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
475 487
			include("head.inc");
476
			print_info_box("Invalid PPTP Remote IP Address. Please press back in your browser window and correct.", 'danger');
488
			$input_errors[] = "Invalid PPTP Remote IP Address. Please press back in your browser window and correct.";
489
			print_input_errors($input_errors);
477 490
			include("foot.inc");
478 491
			die;
479 492
		}
......
568 581
		if ($_POST['subnetmask'] < 31) {
569 582
			if ($_POST['lanipaddress'] == $lowestip) {
570 583
				include("head.inc");
571
				print_info_box("LAN IP Address equals subnet network address. This is not allowed. Please press back in your browser window and correct.", 'danger');
584
				$input_errors[] = "LAN IP Address equals subnet network address. This is not allowed. Please press back in your browser window and correct.";
585
				print_input_errors($input_errors);
572 586
				include("foot.inc");
573 587
				die;
574 588
			}
575 589
			if ($_POST['lanipaddress'] == $highestip) {
576 590
				include("head.inc");
577
				print_info_box("LAN IP Address equals subnet broadcast address. This is not allowed. Please press back in your browser window and correct.", 'danger');
591
				$input_errors[] = "LAN IP Address equals subnet broadcast address. This is not allowed. Please press back in your browser window and correct.";
592
				print_input_errors($input_errors);
578 593
				include("foot.inc");
579 594
				die;
580 595
			}
581 596
		} else {
582 597
			include("head.inc");
583
			print_info_box("Invalid subnet mask, choose a mask less than 31. Please press back in your browser window and correct.", 'danger');
598
			$input_errors[] = "Invalid subnet mask, choose a mask less than 31. Please press back in your browser window and correct.";
599
			print_input_errors($input_errors);
584 600
			include("foot.inc");
585 601
			die;
586 602
		}

Also available in: Unified diff