Revision b9668e69
Added by Stephen Beaver over 9 years ago
src/usr/local/www/firewall_nat_edit.php | ||
---|---|---|
531 | 531 |
} |
532 | 532 |
|
533 | 533 |
function build_srctype_list() { |
534 |
global $pconfig, $ifdisp; |
|
534 |
global $pconfig, $ifdisp, $config;
|
|
535 | 535 |
|
536 | 536 |
$list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network'); |
537 | 537 |
|
... | ... | |
553 | 553 |
return($list); |
554 | 554 |
} |
555 | 555 |
|
556 |
function srctype_selected() { |
|
557 |
global $pconfig, $config; |
|
558 |
|
|
559 |
$selected = ""; |
|
560 |
|
|
561 |
$sel = is_specialnet($pconfig['src']); |
|
562 |
if (!$sel) { |
|
563 |
if ($pconfig['srcmask'] == 32) { |
|
564 |
$selected = 'single'; |
|
565 |
} else { |
|
566 |
$selected = 'network'; |
|
567 |
} |
|
568 |
} else { |
|
569 |
$selected = $pconfig['src']; |
|
570 |
} |
|
571 |
|
|
572 |
|
|
573 |
return($selected); |
|
574 |
} |
|
575 |
|
|
556 | 576 |
function build_dsttype_list() { |
557 | 577 |
global $pconfig, $config, $ifdisp; |
558 | 578 |
|
... | ... | |
599 | 619 |
} |
600 | 620 |
|
601 | 621 |
function dsttype_selected() { |
602 |
global $pconfig; |
|
603 |
|
|
604 |
$sel = is_specialnet($pconfig['dst']); |
|
605 |
|
|
606 |
if (!$sel) { |
|
607 |
if ($pconfig['dstmask'] == 32) |
|
608 |
return('single'); |
|
609 |
|
|
610 |
return('network'); |
|
611 |
} |
|
612 |
|
|
613 |
return($pconfig['dst']); |
|
614 |
} |
|
615 |
|
|
616 |
function srctype_selected() { |
|
617 |
global $pconfig; |
|
618 |
|
|
619 |
$sel = is_specialnet($pconfig['src']); |
|
622 |
global $pconfig, $config; |
|
620 | 623 |
|
621 |
if (!$sel) { |
|
622 |
if ($pconfig['srcmask'] == 32) |
|
623 |
return('single'); |
|
624 |
$selected = ""; |
|
624 | 625 |
|
625 |
return('network'); |
|
626 |
if (is_array($config['virtualip']['vip'])) { |
|
627 |
$selected = $pconfig['dst']; |
|
628 |
} else { |
|
629 |
$sel = is_specialnet($pconfig['dst']); |
|
630 |
if (!$sel) { |
|
631 |
if ($pconfig['dstmask'] == 32) { |
|
632 |
$selected = 'single'; |
|
633 |
} else { |
|
634 |
$selected = 'network'; |
|
635 |
} |
|
636 |
} else { |
|
637 |
$selected = $pconfig['dst']; |
|
638 |
} |
|
626 | 639 |
} |
627 | 640 |
|
628 |
return($pconfig['src']);
|
|
641 |
return($selected);
|
|
629 | 642 |
} |
630 | 643 |
|
631 | 644 |
$closehead = false; |
Also available in: Unified diff
Fixed #5599