mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix #9121: Initialize arrays to prevent PHP 7 errors
This commit is contained in:
parent
6b0ef0456b
commit
ea0dd41709
@ -829,7 +829,7 @@ function local_user_set_groups($user, $new_groups = NULL) {
|
||||
if ($groupname == '' || in_array($groupname, $cur_groups)) {
|
||||
continue;
|
||||
}
|
||||
$group = & $config['system']['group'][$groupindex[$groupname]];
|
||||
$group = &$config['system']['group'][$groupindex[$groupname]];
|
||||
$group['member'][] = $user['uid'];
|
||||
$mod_groups[] = $group;
|
||||
|
||||
@ -851,7 +851,7 @@ function local_user_set_groups($user, $new_groups = NULL) {
|
||||
if (!isset($config['system']['group'][$groupindex[$groupname]])) {
|
||||
continue;
|
||||
}
|
||||
$group = & $config['system']['group'][$groupindex[$groupname]];
|
||||
$group = &$config['system']['group'][$groupindex[$groupname]];
|
||||
if (is_array($group['member'])) {
|
||||
$index = array_search($user['uid'], $group['member']);
|
||||
array_splice($group['member'], $index, 1);
|
||||
|
||||
@ -98,13 +98,8 @@ function easyrule_block_rule_create($int = 'wan', $ipproto = "inet") {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* No rules, start a new array */
|
||||
if (!is_array($config['filter']['rule'])) {
|
||||
$config['filter']['rule'] = array();
|
||||
}
|
||||
|
||||
filter_rules_sort();
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
filter_rules_sort();
|
||||
$a_filter = &$config['filter']['rule'];
|
||||
|
||||
/* Make up a new rule */
|
||||
@ -160,11 +155,6 @@ function easyrule_block_alias_add($host, $int = 'wan') {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If there are no aliases, start an array */
|
||||
if (!is_array($config['aliases']['alias'])) {
|
||||
$config['aliases']['alias'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
|
||||
@ -286,13 +276,8 @@ function easyrule_block_host_add($host, $int = 'wan', $ipproto = "inet") {
|
||||
function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipproto) {
|
||||
global $config;
|
||||
|
||||
/* No rules, start a new array */
|
||||
if (!is_array($config['filter']['rule'])) {
|
||||
$config['filter']['rule'] = array();
|
||||
}
|
||||
|
||||
filter_rules_sort();
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
filter_rules_sort();
|
||||
$a_filter = &$config['filter']['rule'];
|
||||
|
||||
/* Make up a new rule */
|
||||
|
||||
@ -212,7 +212,7 @@ function filter_delete_states_for_down_gateways() {
|
||||
if (empty($a_gateways[$gateway['monitor']])) {
|
||||
continue;
|
||||
}
|
||||
$gwstatus =& $a_gateways[$gateway['monitor']];
|
||||
$gwstatus = &$a_gateways[$gateway['monitor']];
|
||||
if (strstr($gwstatus['status'], "down")) {
|
||||
$any_gateway_down = true;
|
||||
break;
|
||||
@ -1612,7 +1612,7 @@ function filter_nat_rules_automatic_tonathosts($with_descr = false) {
|
||||
foreach (get_staticroutes(false, false, true) as $route) {
|
||||
$netip = explode("/", $route['network']);
|
||||
if (isset($GatewaysList[$route['gateway']])) {
|
||||
$gateway =& $GatewaysList[$route['gateway']];
|
||||
$gateway = &$GatewaysList[$route['gateway']];
|
||||
if (!interface_has_gateway($gateway['interface']) && is_private_ip($netip[0])) {
|
||||
$tonathosts[] = $route['network'];
|
||||
$descriptions[] = gettext("static route");
|
||||
|
||||
@ -1972,12 +1972,7 @@ function validate_gateway($gateway_settings, $id = "", $parent_ip = "", $parent_
|
||||
function save_gateway($gateway_settings, $realid = "") {
|
||||
global $config;
|
||||
|
||||
if (!is_array($config['gateways'])) {
|
||||
$config['gateways'] = array();
|
||||
}
|
||||
if (!is_array($config['gateways']['gateway_item'])) {
|
||||
$config['gateways']['gateway_item'] = array();
|
||||
}
|
||||
init_config_arr(array('gateways', 'gateway_item'));
|
||||
$a_gateway_item = &$config['gateways']['gateway_item'];
|
||||
$reloadif = "";
|
||||
$gateway = array();
|
||||
|
||||
@ -1808,7 +1808,7 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode) {
|
||||
$config["virtualip_carp_maintenancemode"] = true;
|
||||
write_config(gettext("Enter CARP maintenance mode"));
|
||||
}
|
||||
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
|
||||
if (is_array($viparr)) {
|
||||
@ -5278,6 +5278,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan", $
|
||||
global $config;
|
||||
|
||||
/* XXX: For speed reasons reference directly the interface array */
|
||||
init_config_arr(array('interfaces'));
|
||||
$ifdescrs = &$config['interfaces'];
|
||||
//$ifdescrs = get_configured_interface_list(true);
|
||||
|
||||
|
||||
@ -61,6 +61,7 @@ function convert_real_interface_to_friendly_interface_name_fast() {
|
||||
|
||||
$out = array();
|
||||
/* XXX: For speed reasons reference directly the interface array */
|
||||
init_config_arr(array('interfaces'));
|
||||
$ifdescrs = &$config['interfaces'];
|
||||
$iffriendlynames = array_keys($ifdescrs);
|
||||
$out = array_flip(get_real_interface_fast($iffriendlynames));
|
||||
|
||||
@ -48,6 +48,7 @@ function delete_id($id, &$array) {
|
||||
unset($array[$delete_index]);
|
||||
|
||||
// Update the separators
|
||||
init_config_arr(array('filter', 'separator', strtolower($if)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($if)];
|
||||
// get rule index within interface
|
||||
$ridx = ifridx($if, $delete_index);
|
||||
|
||||
@ -807,6 +807,7 @@ function remove_text_from_file($file, $text) {
|
||||
function after_sync_bump_adv_skew() {
|
||||
global $config, $g;
|
||||
$processed_skew = 1;
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$a_vip = &$config['virtualip']['vip'];
|
||||
foreach ($a_vip as $vipent) {
|
||||
if ($vipent['advskew'] <> "") {
|
||||
@ -2704,7 +2705,7 @@ function xml2array($contents, $get_attributes = 1, $priority = 'tag') {
|
||||
$current[$tag . '_attr'] = $attributes_data;
|
||||
}
|
||||
$repeated_tag_index[$tag . '_' . $level] = 1;
|
||||
$current = & $current[$tag];
|
||||
$current = &$current[$tag];
|
||||
} else {
|
||||
if (isset ($current[$tag][0])) {
|
||||
$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
|
||||
@ -2721,7 +2722,7 @@ function xml2array($contents, $get_attributes = 1, $priority = 'tag') {
|
||||
}
|
||||
}
|
||||
$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
|
||||
$current = & $current[$tag][$last_item_index];
|
||||
$current = &$current[$tag][$last_item_index];
|
||||
}
|
||||
} elseif ($type == "complete") {
|
||||
if (!isset ($current[$tag])) {
|
||||
@ -2756,7 +2757,7 @@ function xml2array($contents, $get_attributes = 1, $priority = 'tag') {
|
||||
}
|
||||
}
|
||||
} elseif ($type == 'close') {
|
||||
$current = & $parent[$level -1];
|
||||
$current = &$parent[$level -1];
|
||||
}
|
||||
}
|
||||
return ($xml_array);
|
||||
|
||||
@ -668,7 +668,7 @@ function sync_package($package_name) {
|
||||
return; // No package belongs to the pkg_id passed to this function.
|
||||
}
|
||||
|
||||
$package =& $config['installedpackages']['package'][$pkg_id];
|
||||
$package = &$config['installedpackages']['package'][$pkg_id];
|
||||
if (!file_exists("/usr/local/pkg/" . $package['configurationfile'])) {
|
||||
log_error(sprintf(gettext("The %s package is missing its configuration file and must be reinstalled."), $package['name']));
|
||||
delete_package_xml($package['name']);
|
||||
@ -950,14 +950,13 @@ function delete_package_xml($package_name, $when = "post-deinstall") {
|
||||
pkg_debug(sprintf(gettext("Removing %s package... "), $package_name));
|
||||
update_status(sprintf(gettext("Removing %s components..."), $package_name) . "\n");
|
||||
/* parse package configuration */
|
||||
init_config_arr(array('installedpackages', 'package'));
|
||||
init_config_arr(array('installedpackages', 'package', $pkgid));
|
||||
$packages = &$config['installedpackages']['package'];
|
||||
$pkg_info = &$packages[$pkgid];
|
||||
init_config_arr(array('installedpackages', 'menu'));
|
||||
$menus = &$config['installedpackages']['menu'];
|
||||
init_config_arr(array('installedpackages', 'service'));
|
||||
$services = &$config['installedpackages']['service'];
|
||||
init_config_arr(array('installedpackages', 'package', $pkgid));
|
||||
$pkg_info = &$packages[$pkgid];
|
||||
if (file_exists("/usr/local/pkg/" . $pkg_info['configurationfile'])) {
|
||||
$pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $packages[$pkgid]['configurationfile'], "packagegui");
|
||||
/* remove menu items */
|
||||
|
||||
@ -214,18 +214,12 @@ function getPrivPages(& $entry, & $allowed_pages) {
|
||||
}
|
||||
|
||||
foreach ($entry['priv'] as $pname) {
|
||||
if (strncmp($pname, "page-", 5)) {
|
||||
if (strncmp($pname, "page-", 5) ||
|
||||
!is_array($priv_list[$pname]) ||
|
||||
!is_array($priv_list[$pname]['match'])) {
|
||||
continue;
|
||||
}
|
||||
$priv = &$priv_list[$pname];
|
||||
if (!is_array($priv)) {
|
||||
continue;
|
||||
}
|
||||
$matches = &$priv['match'];
|
||||
if (!is_array($matches)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($matches as $match) {
|
||||
foreach ($priv_list[$pname]['match'] as $match) {
|
||||
$allowed_pages[] = $match;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ function write_rcfile($params) {
|
||||
$towrite .= "\t{$params['start']}\n";
|
||||
$towrite .= "}\n\n";
|
||||
if (!empty($params['stop'])) {
|
||||
$tokill =& $params['stop'];
|
||||
$tokill = &$params['stop'];
|
||||
} else if (!empty($params['executable'])) {
|
||||
/* just nuke the executable */
|
||||
$tokill = "/usr/bin/killall " . escapeshellarg($params['executable']);
|
||||
@ -92,7 +92,7 @@ function start_service($name, $after_sync = false) {
|
||||
if ($service['rcfile']) {
|
||||
$prefix = RCFILEPREFIX;
|
||||
if (!empty($service['prefix'])) {
|
||||
$prefix =& $service['prefix'];
|
||||
$prefix = &$service['prefix'];
|
||||
}
|
||||
if (file_exists("{$prefix}{$service['rcfile']}") || is_link("{$prefix}{$service['rcfile']}")) {
|
||||
mwexec_bg("{$prefix}{$service['rcfile']} start");
|
||||
@ -120,7 +120,7 @@ function stop_service($name) {
|
||||
if ($service['rcfile']) {
|
||||
$prefix = RCFILEPREFIX;
|
||||
if (!empty($service['prefix'])) {
|
||||
$prefix =& $service['prefix'];
|
||||
$prefix = &$service['prefix'];
|
||||
}
|
||||
if (file_exists("{$prefix}{$service['rcfile']}") || is_link("{$prefix}{$service['rcfile']}")) {
|
||||
mwexec("{$prefix}{$service['rcfile']} stop");
|
||||
|
||||
@ -1751,7 +1751,8 @@ function services_dhcrelay_configure() {
|
||||
/* kill any running dhcrelay */
|
||||
killbypid("{$g['varrun_path']}/dhcrelay.pid");
|
||||
|
||||
$dhcrelaycfg =& $config['dhcrelay'];
|
||||
init_config_arr(array('dhcrelay'));
|
||||
$dhcrelaycfg = &$config['dhcrelay'];
|
||||
|
||||
/* DHCPRelay enabled on any interfaces? */
|
||||
if (!isset($dhcrelaycfg['enable'])) {
|
||||
@ -1826,7 +1827,8 @@ function services_dhcrelay6_configure() {
|
||||
/* kill any running dhcrelay */
|
||||
killbypid("{$g['varrun_path']}/dhcrelay6.pid");
|
||||
|
||||
$dhcrelaycfg =& $config['dhcrelay6'];
|
||||
init_config_arr(array('dhcrelay6'));
|
||||
$dhcrelaycfg = &$config['dhcrelay6'];
|
||||
|
||||
/* DHCPv6 Relay enabled on any interfaces? */
|
||||
if (!isset($dhcrelaycfg['enable'])) {
|
||||
@ -2756,7 +2758,7 @@ function configure_cron() {
|
||||
$crontab_contents = file("/etc/crontab", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
||||
for ($i = 0; $i < count($crontab_contents); $i++) {
|
||||
$cron_item =& $crontab_contents[$i];
|
||||
$cron_item = &$crontab_contents[$i];
|
||||
if (strpos($cron_item, "# pfSense specific crontab entries") !== false) {
|
||||
array_splice($crontab_contents, $i - 1);
|
||||
break;
|
||||
|
||||
@ -308,7 +308,8 @@ function get_queue_stats() {
|
||||
function &get_reference_to_me_in_config(&$mypath) {
|
||||
global $config;
|
||||
|
||||
$ptr =& $config['shaper'];
|
||||
init_config_arr(array('shaper'));
|
||||
$ptr = &$config['shaper'];
|
||||
foreach ($mypath as $indeks) {
|
||||
if (!is_array($ptr)) {
|
||||
$ptr = array();
|
||||
@ -319,7 +320,7 @@ function &get_reference_to_me_in_config(&$mypath) {
|
||||
if (!is_array($ptr['queue'][$indeks])) {
|
||||
$ptr['queue'][$indeks] = array();
|
||||
}
|
||||
$ptr =& $ptr['queue'][$indeks];
|
||||
$ptr = &$ptr['queue'][$indeks];
|
||||
}
|
||||
|
||||
return $ptr;
|
||||
@ -328,9 +329,10 @@ function &get_reference_to_me_in_config(&$mypath) {
|
||||
function unset_object_by_reference(&$mypath) {
|
||||
global $config;
|
||||
|
||||
$ptr =& $config['shaper'];
|
||||
init_config_arr(array('shaper'));
|
||||
$ptr = &$config['shaper'];
|
||||
for ($i = 0; $i < count($mypath) - 1; $i++) {
|
||||
$ptr =& $ptr['queue'][$mypath[$i]];
|
||||
$ptr = &$ptr['queue'][$mypath[$i]];
|
||||
}
|
||||
unset($ptr['queue'][$mypath[$i]]);
|
||||
}
|
||||
@ -338,9 +340,10 @@ function unset_object_by_reference(&$mypath) {
|
||||
function &get_dn_reference_to_me_in_config(&$mypath) {
|
||||
global $config;
|
||||
|
||||
$ptr =& $config['dnshaper'];
|
||||
init_config_arr(array('dnshaper'));
|
||||
$ptr = &$config['dnshaper'];
|
||||
foreach ($mypath as $indeks) {
|
||||
$ptr =& $ptr['queue'][$indeks];
|
||||
$ptr = &$ptr['queue'][$indeks];
|
||||
}
|
||||
|
||||
return $ptr;
|
||||
@ -349,9 +352,10 @@ function &get_dn_reference_to_me_in_config(&$mypath) {
|
||||
function unset_dn_object_by_reference(&$mypath) {
|
||||
global $config;
|
||||
|
||||
$ptr =& $config['dnshaper'];
|
||||
init_config_arr(array('dnshaper'));
|
||||
$ptr = &$config['dnshaper'];
|
||||
for ($i = 0; $i < count($mypath) - 1; $i++) {
|
||||
$ptr =& $ptr['queue'][$mypath[$i]];
|
||||
$ptr = &$ptr['queue'][$mypath[$i]];
|
||||
}
|
||||
unset($ptr['queue'][$mypath[$i]]);
|
||||
}
|
||||
@ -522,8 +526,8 @@ function get_interface_bandwidth($object) {
|
||||
global $altq_list_queues;
|
||||
|
||||
$int = $object->GetInterface();
|
||||
$altq =& $altq_list_queues[$int];
|
||||
if ($altq) {
|
||||
if (isset($altq_list_queues[$int])) {
|
||||
$altq = &$altq_list_queues[$int];
|
||||
$bw_3 = $altq->GetBandwidth();
|
||||
$bw_3 = $bw_3 * get_bandwidthtype_scale($altq->GetBwscale());
|
||||
return floatval($bw_3);
|
||||
@ -5014,12 +5018,7 @@ function read_altq_config() {
|
||||
global $altq_list_queues, $config;
|
||||
$path = array();
|
||||
|
||||
if (!is_array($config['shaper'])) {
|
||||
$config['shaper'] = array();
|
||||
}
|
||||
if (!is_array($config['shaper']['queue'])) {
|
||||
$config['shaper']['queue'] = array();
|
||||
}
|
||||
init_config_arr(array('shaper', 'queue'));
|
||||
$a_int = &$config['shaper']['queue'];
|
||||
|
||||
$altq_list_queues = array();
|
||||
@ -5055,18 +5054,12 @@ function read_dummynet_config() {
|
||||
global $dummynet_pipe_list, $config;
|
||||
$path = array();
|
||||
|
||||
if (!is_array($config['dnshaper'])) {
|
||||
$config['dnshaper'] = array();
|
||||
}
|
||||
if (!is_array($config['dnshaper']['queue'])) {
|
||||
$config['dnshaper']['queue'] = array();
|
||||
}
|
||||
init_config_arr(array('dnshaper', 'queue'));
|
||||
$a_int = &$config['dnshaper']['queue'];
|
||||
|
||||
$dummynet_pipe_list = array();
|
||||
|
||||
if (!is_array($config['dnshaper']['queue']) ||
|
||||
!count($config['dnshaper']['queue'])) {
|
||||
if (!count($config['dnshaper']['queue'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1204,14 +1204,10 @@ EOD;
|
||||
function system_webgui_create_certificate() {
|
||||
global $config, $g;
|
||||
|
||||
if (!is_array($config['ca'])) {
|
||||
$config['ca'] = array();
|
||||
}
|
||||
$a_ca =& $config['ca'];
|
||||
if (!is_array($config['cert'])) {
|
||||
$config['cert'] = array();
|
||||
}
|
||||
$a_cert =& $config['cert'];
|
||||
init_config_arr(array('ca'));
|
||||
$a_ca = &$config['ca'];
|
||||
init_config_arr(array('cert'));
|
||||
$a_cert = &$config['cert'];
|
||||
log_error(gettext("Creating SSL Certificate for this host"));
|
||||
|
||||
$cert = array();
|
||||
|
||||
@ -89,6 +89,7 @@ function upgrade_010_to_011() {
|
||||
}
|
||||
|
||||
/* convert filter rules */
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
$n = count($config['filter']['rule']);
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
|
||||
@ -133,6 +134,7 @@ function upgrade_010_to_011() {
|
||||
}
|
||||
|
||||
/* convert shaper rules */
|
||||
init_config_arr(array('pfqueueing', 'rule'));
|
||||
$n = count($config['pfqueueing']['rule']);
|
||||
if (is_array($config['pfqueueing']['rule'])) {
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
@ -215,6 +217,7 @@ function upgrade_013_to_014() {
|
||||
global $config;
|
||||
/* convert shaper rules (make pipes) */
|
||||
if (is_array($config['pfqueueing']['rule'])) {
|
||||
init_config_arr(array('pfqueueing', 'pipe'));
|
||||
$config['pfqueueing']['pipe'] = array();
|
||||
|
||||
for ($i = 0; isset($config['pfqueueing']['rule'][$i]); $i++) {
|
||||
@ -514,8 +517,9 @@ function upgrade_027_to_028() {
|
||||
|
||||
function upgrade_028_to_029() {
|
||||
global $config;
|
||||
$rule_item = array();
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
$a_filter = &$config['filter']['rule'];
|
||||
$rule_item = array();
|
||||
$rule_item['interface'] = "enc0";
|
||||
$rule_item['type'] = "pass";
|
||||
$rule_item['source']['any'] = true;
|
||||
@ -901,6 +905,7 @@ function upgrade_045_to_046() {
|
||||
/* Upgrade load balancer from slb to relayd */
|
||||
if (is_array($config['load_balancer']['virtual_server']) && count($config['load_balancer']['virtual_server'])) {
|
||||
$vs_a = &$config['load_balancer']['virtual_server'];
|
||||
init_config_arr(array('load_balancer', 'lbpool'));
|
||||
$pool_a = &$config['load_balancer']['lbpool'];
|
||||
$pools = array();
|
||||
/* Index pools by name */
|
||||
@ -1970,11 +1975,8 @@ function upgrade_053_to_054() {
|
||||
$gateway_group_arr = array();
|
||||
$gateways = return_gateways_array();
|
||||
$group_name_changes = array();
|
||||
if (!is_array($config['gateways']['gateway_item'])) {
|
||||
$config['gateways']['gateway_item'] = array();
|
||||
}
|
||||
|
||||
$a_gateways =& $config['gateways']['gateway_item'];
|
||||
init_config_arr(array('gateways', 'gateway_item'));
|
||||
$a_gateways = &$config['gateways']['gateway_item'];
|
||||
foreach ($lbpool_arr as $lbpool) {
|
||||
if ($lbpool['type'] == "gateway") {
|
||||
// Gateway Groups have to have valid names in pf, old lb pools did not. Clean them up.
|
||||
@ -2406,9 +2408,11 @@ function upgrade_062_to_063() {
|
||||
function upgrade_063_to_064() {
|
||||
global $config;
|
||||
$j = 0;
|
||||
init_config_arr(array('ppps', 'ppp'));
|
||||
init_config_arr(array('interfaces'));
|
||||
$ifcfg = &$config['interfaces'];
|
||||
|
||||
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
|
||||
if (count($config['ppps']['ppp'])) {
|
||||
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
|
||||
$config['ppps']['ppp'][$pppid]['if'] = "ppp".$j;
|
||||
$config['ppps']['ppp'][$pppid]['ptpid'] = $j;
|
||||
@ -2426,9 +2430,6 @@ function upgrade_063_to_064() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($config['ppps']['ppp'])) {
|
||||
$config['ppps']['ppp'] = array();
|
||||
}
|
||||
$a_ppps = &$config['ppps']['ppp'];
|
||||
|
||||
foreach ($ifcfg as $ifname => $ifinfo) {
|
||||
@ -2514,7 +2515,8 @@ function upgrade_064_to_065() {
|
||||
function upgrade_065_to_066() {
|
||||
global $config;
|
||||
|
||||
$dhcrelaycfg =& $config['dhcrelay'];
|
||||
init_config_arr(array('dhcrelay'));
|
||||
$dhcrelaycfg = &$config['dhcrelay'];
|
||||
|
||||
if (is_array($dhcrelaycfg)) {
|
||||
$dhcrelayifs = array();
|
||||
@ -3179,7 +3181,7 @@ function upgrade_090_to_091() {
|
||||
function upgrade_091_to_092() {
|
||||
global $config;
|
||||
|
||||
if (is_array($config['nat']['advancedoutbound']) && is_array($config['nat']['advancedoutbound']['rule'])) {
|
||||
if (is_array($config['nat']['advancedoutbound']['rule'])) {
|
||||
$nat_rules = &$config['nat']['advancedoutbound']['rule'];
|
||||
for ($i = 0; isset($nat_rules[$i]); $i++) {
|
||||
if (empty($nat_rules[$i]['interface'])) {
|
||||
@ -3742,11 +3744,8 @@ function upgrade_117_to_118() {
|
||||
unset($config['system']['cert']);
|
||||
}
|
||||
|
||||
if (!isset($config['ipsec']['phase1'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$a_phase1 =& $config['ipsec']['phase1'];
|
||||
init_config_arr(array('ipsec', 'phase1'));
|
||||
$a_phase1 = &$config['ipsec']['phase1'];
|
||||
|
||||
foreach ($a_phase1 as &$ph1_entry) {
|
||||
// update asn1dn strings from racoon's format to strongswan's
|
||||
@ -3769,7 +3768,8 @@ function upgrade_118_to_119() {
|
||||
}
|
||||
|
||||
// change peerid_type to 'any' for EAP types to retain previous behavior of omitting rightid
|
||||
$a_phase1 =& $config['ipsec']['phase1'];
|
||||
init_config_arr(array('ipsec', 'phase1'));
|
||||
$a_phase1 = &$config['ipsec']['phase1'];
|
||||
|
||||
foreach ($a_phase1 as &$ph1_entry) {
|
||||
if (strstr($ph1_entry['authentication_method'], 'eap')) {
|
||||
@ -3803,7 +3803,7 @@ function upgrade_120_to_121() {
|
||||
return;
|
||||
}
|
||||
|
||||
$miniupnpd =& $config['installedpackages']['miniupnpd']['config'][0];
|
||||
$miniupnpd = &$config['installedpackages']['miniupnpd']['config'][0];
|
||||
|
||||
$miniupnpd['row'] = array();
|
||||
|
||||
@ -3834,7 +3834,7 @@ function upgrade_122_to_123() {
|
||||
|
||||
// Cleanup firewall rules
|
||||
if (isset($config['filter']['rule']) && is_array($config['filter']['rule'])) {
|
||||
$rules =& $config['filter']['rule'];
|
||||
$rules = &$config['filter']['rule'];
|
||||
$last_rule = count($rules) - 1;
|
||||
// Process in reverse order to be able to unset items
|
||||
for ($i = $last_rule; $i >= 0; $i--) {
|
||||
@ -3855,7 +3855,7 @@ function upgrade_122_to_123() {
|
||||
|
||||
// Cleanup 1:1 NAT rules
|
||||
if (isset($config['nat']['onetoone']) && is_array($config['nat']['onetoone'])) {
|
||||
$onetoone =& $config['nat']['onetoone'];
|
||||
$onetoone = &$config['nat']['onetoone'];
|
||||
$last_rule = count($onetoone) - 1;
|
||||
// Process in reverse order to be able to unset items
|
||||
for ($i = $last_rule; $i >= 0; $i--) {
|
||||
@ -3876,7 +3876,7 @@ function upgrade_122_to_123() {
|
||||
|
||||
// Cleanup npt NAT rules
|
||||
if (isset($config['nat']['npt']) && is_array($config['nat']['npt'])) {
|
||||
$npt =& $config['nat']['npt'];
|
||||
$npt = &$config['nat']['npt'];
|
||||
$last_rule = count($npt) - 1;
|
||||
// Process in reverse order to be able to unset items
|
||||
for ($i = $last_rule; $i >= 0; $i--) {
|
||||
@ -3889,7 +3889,7 @@ function upgrade_122_to_123() {
|
||||
|
||||
// Cleanup Port-forward NAT rules
|
||||
if (isset($config['nat']['rule']) && is_array($config['nat']['rule'])) {
|
||||
$nat_rules =& $config['nat']['rule'];
|
||||
$nat_rules = &$config['nat']['rule'];
|
||||
$last_rule = count($nat_rules) - 1;
|
||||
// Process in reverse order to be able to unset items
|
||||
for ($i = $last_rule; $i >= 0; $i--) {
|
||||
@ -3910,7 +3910,7 @@ function upgrade_122_to_123() {
|
||||
|
||||
// Cleanup Port-forward NAT rules
|
||||
if (isset($config['nat']['outbound']['rule']) && is_array($config['nat']['outbound']['rule'])) {
|
||||
$out_rules =& $config['nat']['outbound']['rule'];
|
||||
$out_rules = &$config['nat']['outbound']['rule'];
|
||||
$last_rule = count($out_rules) - 1;
|
||||
// Process in reverse order to be able to unset items
|
||||
for ($i = $last_rule; $i >= 0; $i--) {
|
||||
@ -4378,12 +4378,7 @@ function upgrade_141_to_142() {
|
||||
global $config;
|
||||
/* Convert Namecheap type DynDNS entries to the new split hostname and domain format */
|
||||
|
||||
if (!is_array($config['dyndnses'])) {
|
||||
$config['dyndnses'] = array();
|
||||
}
|
||||
if (!is_array($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
init_config_arr(array('dyndnses', 'dyndns'));
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
|
||||
foreach ($a_dyndns as &$dyndns) {
|
||||
@ -4950,12 +4945,7 @@ function upgrade_156_to_157() {
|
||||
global $config;
|
||||
/* Convert Cloudflare and GratisDNS type DynDNS entries to the new split hostname and domain format */
|
||||
|
||||
if (!is_array($config['dyndnses'])) {
|
||||
$config['dyndnses'] = array();
|
||||
}
|
||||
if (!is_array($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
init_config_arr(array('dyndnses', 'dyndns'));
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
|
||||
foreach ($a_dyndns as &$dyndns) {
|
||||
@ -4983,12 +4973,7 @@ function upgrade_157_to_158() {
|
||||
global $config;
|
||||
/* Convert Dynamic DNS passwords to base64 encoding. Redmine #6688 */
|
||||
|
||||
if (!is_array($config['dyndnses'])) {
|
||||
$config['dyndnses'] = array();
|
||||
}
|
||||
if (!is_array($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
init_config_arr(array('dyndnses', 'dyndns'));
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
|
||||
foreach ($a_dyndns as &$dyndns) {
|
||||
@ -5490,7 +5475,7 @@ function upgrade_173_to_174() {
|
||||
function upgrade_174_to_175() {
|
||||
global $config;
|
||||
init_config_arr(array('ipsec', 'phase1'));
|
||||
if (is_array($config['ipsec']['phase1'])) {
|
||||
if (count($config['ipsec']['phase1'])) {
|
||||
$a_phase1 = &$config['ipsec']['phase1'];
|
||||
foreach($a_phase1 as &$phase1) {
|
||||
if (empty($phase1)) {
|
||||
@ -5759,10 +5744,7 @@ function upgrade_184_to_185() {
|
||||
if (is_array($config['installedpackages']['autoconfigbackup']['config'][0])) {
|
||||
$acbpkg = &$config['installedpackages']['autoconfigbackup']['config'][0];
|
||||
|
||||
if (!is_array($config['system']['acb'])) {
|
||||
$config['system']['acb'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('system', 'acb'));
|
||||
$acb = &$config['system']['acb'];
|
||||
$acb['enable'] = ($acbpkg['enable_acb'] != 'disabled') ? 'yes':'no';
|
||||
$acb['gold_encryption_password'] = $acbpkg['crypto_password'];
|
||||
|
||||
@ -1268,7 +1268,9 @@ function get_configured_vip_list($family = 'all', $type = VIP_ALL) {
|
||||
global $config;
|
||||
|
||||
$list = array();
|
||||
if (!is_array($config['virtualip']['vip']) || empty($config['virtualip']['vip'])) {
|
||||
if (!is_array($config['virtualip']) ||
|
||||
!is_array($config['virtualip']['vip']) ||
|
||||
empty($config['virtualip']['vip'])) {
|
||||
return ($list);
|
||||
}
|
||||
|
||||
@ -1328,7 +1330,9 @@ function get_configured_vip_subnetv6($vipinterface = '') {
|
||||
function get_configured_vip_detail($vipinterface = '', $family = 'inet', $what = 'ip') {
|
||||
global $config;
|
||||
|
||||
if (empty($vipinterface) || !is_array($config['virtualip']['vip']) ||
|
||||
if (empty($vipinterface) ||
|
||||
!is_array($config['virtualip']) ||
|
||||
!is_array($config['virtualip']['vip']) ||
|
||||
empty($config['virtualip']['vip'])) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ require_once("util.inc");
|
||||
|
||||
set_single_sysctl("net.inet.carp.allow", "0");
|
||||
if (is_array($config['virtualip']['vip'])) {
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
foreach ($viparr as $vip) {
|
||||
switch ($vip['mode']) {
|
||||
|
||||
@ -24,6 +24,7 @@ require_once("interfaces.inc");
|
||||
require_once("util.inc");
|
||||
|
||||
if (is_array($config['virtualip']['vip'])) {
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
foreach ($viparr as $vip) {
|
||||
switch ($vip['mode']) {
|
||||
|
||||
@ -201,9 +201,7 @@ function next_unused_gateway_name($interface) {
|
||||
|
||||
function add_gateway_to_config($interface, $gatewayip, $inet_type) {
|
||||
global $g, $config, $dry_run;
|
||||
if (!is_array($config['gateways']['gateway_item'])) {
|
||||
$config['gateways']['gateway_item'] = array();
|
||||
}
|
||||
init_config_arr(array('gateways', 'gateway_item'));
|
||||
$a_gateways = &$config['gateways']['gateway_item'];
|
||||
if ($dry_run) {
|
||||
print_r($a_gateways);
|
||||
|
||||
@ -31,16 +31,7 @@ require_once("guiconfig.inc");
|
||||
|
||||
$host = trim($_REQUEST['host'], " \t\n\r\0\x0B[];\"'");
|
||||
|
||||
/* If this section of config.xml has not been populated yet we need to set it up
|
||||
*/
|
||||
if (!is_array($config['aliases'])) {
|
||||
$config['aliases'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['aliases']['alias'])) {
|
||||
$config['aliases']['alias'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
|
||||
$aliasname = substr(str_replace(array(".", "-"), "_", $host), 0, 31);
|
||||
|
||||
@ -35,14 +35,7 @@ require_once("functions.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
|
||||
if (!is_array($config['aliases'])) {
|
||||
$config['aliases'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['aliases']['alias'])) {
|
||||
$config['aliases']['alias'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
|
||||
$tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/", "", $_REQUEST['tab']));
|
||||
|
||||
@ -55,14 +55,7 @@ $reserved_ifs = get_configured_interface_list(true);
|
||||
$pf_reserved_keywords = array_merge($pf_reserved_keywords, $reserved_ifs, $reserved_table_names);
|
||||
$max_alias_addresses = 5000;
|
||||
|
||||
if (!is_array($config['aliases'])) {
|
||||
$config['aliases'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['aliases']['alias'])) {
|
||||
$config['aliases']['alias'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
|
||||
// Debugging
|
||||
|
||||
@ -55,13 +55,7 @@ if (empty($tab)) {
|
||||
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Bulk import"));
|
||||
$pglinks = array("", "firewall_aliases.php?tab=" . $tab, "@self");
|
||||
|
||||
if (!is_array($config['aliases'])) {
|
||||
$config['aliases'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['aliases']['alias'])) {
|
||||
$config['aliases']['alias'] = array();
|
||||
}
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
|
||||
if ($_POST) {
|
||||
|
||||
@ -39,6 +39,7 @@ require_once("itemid.inc");
|
||||
init_config_arr(array('nat', 'separator'));
|
||||
init_config_arr(array('nat', 'rule'));
|
||||
$a_nat = &$config['nat']['rule'];
|
||||
$a_separators = &$config['nat']['separator'];
|
||||
|
||||
/* update rule order, POST[rule] is an array of ordered IDs */
|
||||
if (array_key_exists('order-store', $_REQUEST) && have_natpfruleint_access($natent['interface'])) {
|
||||
@ -107,7 +108,6 @@ if (($_POST['act'] == "del") && have_natpfruleint_access($natent['interface']))
|
||||
unset($a_nat[$_POST['id']]);
|
||||
|
||||
// Update the separators
|
||||
$a_separators = &$config['nat']['separator'];
|
||||
$ridx = $_POST['id'];
|
||||
$mvnrows = -1;
|
||||
move_separators($a_separators, $ridx, $mvnrows);
|
||||
@ -128,7 +128,6 @@ if (isset($_POST['del_x']) && have_natpfruleint_access($natent['interface'])) {
|
||||
|
||||
/* delete selected rules */
|
||||
if (is_array($_POST['rule']) && count($_POST['rule'])) {
|
||||
$a_separators = &$config['nat']['separator'];
|
||||
$num_deleted = 0;
|
||||
|
||||
foreach ($_POST['rule'] as $rulei) {
|
||||
|
||||
@ -46,9 +46,11 @@ foreach ($ifdisp as $kif => $kdescr) {
|
||||
$specialsrcdst[] = "{$kif}ip";
|
||||
}
|
||||
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
init_config_arr(array('nat', 'separator'));
|
||||
init_config_arr(array('nat', 'rule'));
|
||||
$a_nat = &$config['nat']['rule'];
|
||||
$a_separators = &$config['nat']['separator'];
|
||||
|
||||
if (isset($_REQUEST['id']) && is_numericint($_REQUEST['id'])) {
|
||||
$id = $_REQUEST['id'];
|
||||
@ -512,7 +514,6 @@ if ($_POST['save']) {
|
||||
array_splice($a_nat, $after+1, 0, array($natent));
|
||||
|
||||
// Update the separators
|
||||
$a_separators = &$config['nat']['separator'];
|
||||
$ridx = $after;
|
||||
$mvnrows = +1;
|
||||
move_separators($a_separators, $ridx, $mvnrows);
|
||||
|
||||
@ -108,14 +108,7 @@ function delete_nat_association($id) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($config['filter'])) {
|
||||
$config['filter'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['filter']['rule'])) {
|
||||
$config['filter']['rule'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
filter_rules_sort();
|
||||
$a_filter = &$config['filter']['rule'];
|
||||
|
||||
@ -150,6 +143,7 @@ if ($_POST['act'] == "del") {
|
||||
unset($a_filter[$_POST['id']]);
|
||||
|
||||
// Update the separators
|
||||
init_config_arr(array('filter', 'separator', strtolower($if)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($if)];
|
||||
$ridx = ifridx($if, $_POST['id']); // get rule index within interface
|
||||
$mvnrows = -1;
|
||||
@ -174,6 +168,7 @@ if (isset($_POST['del_x'])) {
|
||||
$deleted = false;
|
||||
|
||||
if (is_array($_POST['rule']) && count($_POST['rule'])) {
|
||||
init_config_arr(array('filter', 'separator', strtolower($if)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($if)];
|
||||
$num_deleted = 0;
|
||||
|
||||
@ -505,14 +500,8 @@ foreach ($a_filter as $filteri => $filterent):
|
||||
pprint_port($filterent['destination']['port'])
|
||||
);
|
||||
|
||||
if (!is_array($config['schedules'])) {
|
||||
$config['schedules'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['schedules']['schedule'])) {
|
||||
$config['schedules']['schedule'] = array();
|
||||
}
|
||||
//build Schedule popup box
|
||||
init_config_arr(array('schedules', 'schedule'));
|
||||
$a_schedules = &$config['schedules']['schedule'];
|
||||
$schedule_span_begin = "";
|
||||
$schedule_span_end = "";
|
||||
|
||||
@ -139,10 +139,7 @@ foreach ($ifdisp as $kif => $kdescr) {
|
||||
$specialsrcdst[] = "{$kif}ip";
|
||||
}
|
||||
|
||||
if (!is_array($config['filter']['rule'])) {
|
||||
$config['filter']['rule'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('filter', 'rule'));
|
||||
filter_rules_sort();
|
||||
$a_filter = &$config['filter']['rule'];
|
||||
|
||||
@ -608,7 +605,7 @@ if ($_POST['save']) {
|
||||
}
|
||||
|
||||
if ($_POST['proto'] == "icmp") {
|
||||
$t =& $_POST['icmptype'];
|
||||
$t = $_POST['icmptype'];
|
||||
if (isset($t) && !is_array($t)) {
|
||||
// shouldn't happen but avoids making assumptions for data-sanitising
|
||||
$input_errors[] = gettext("ICMP types expected to be a list if present, but is not.");
|
||||
@ -965,6 +962,7 @@ if ($_POST['save']) {
|
||||
$a_filter[$id] = $filterent;
|
||||
} else { // rule moved to different interface
|
||||
// Update the separators of previous interface.
|
||||
init_config_arr(array('filter', 'separator', strtolower($if)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($if)];
|
||||
$ridx = ifridx($if, $id); // get rule index within interface
|
||||
$mvnrows = -1;
|
||||
@ -973,6 +971,7 @@ if ($_POST['save']) {
|
||||
$a_filter[$id] = $filterent; // save edited rule to new interface
|
||||
|
||||
// Update the separators of new interface.
|
||||
init_config_arr(array('filter', 'separator', strtolower($tmpif)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($tmpif)];
|
||||
$ridx = ifridx($tmpif, $id); // get rule index within interface
|
||||
if ($ridx == 0) { // rule was placed at the top
|
||||
@ -1004,6 +1003,7 @@ if ($_POST['save']) {
|
||||
}
|
||||
|
||||
// Update the separators
|
||||
init_config_arr(array('filter', 'separator', strtolower($tmpif)));
|
||||
$a_separators = &$config['filter']['separator'][strtolower($tmpif)];
|
||||
$ridx = ifridx($tmpif, $after); // get rule index within interface
|
||||
$mvnrows = +1;
|
||||
|
||||
@ -36,14 +36,7 @@ require_once("functions.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
|
||||
if (!is_array($config['virtualip'])) {
|
||||
$config['virtualip'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['virtualip']['vip'])) {
|
||||
$config['virtualip']['vip'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$a_vip = &$config['virtualip']['vip'];
|
||||
|
||||
if ($_POST['apply']) {
|
||||
|
||||
@ -35,14 +35,7 @@ require_once("guiconfig.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
|
||||
if (!is_array($config['virtualip'])) {
|
||||
$config['virtualip'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['virtualip']['vip'])) {
|
||||
$config['virtualip']['vip'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$a_vip = &$config['virtualip']['vip'];
|
||||
|
||||
if (isset($_REQUEST['id']) && is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -41,6 +41,10 @@ require_once("rrd.inc");
|
||||
require_once("vpn.inc");
|
||||
require_once("xmlparse_attr.inc");
|
||||
|
||||
function remove_bad_chars($string) {
|
||||
return preg_replace('/[^a-z_0-9]/i', '', $string);
|
||||
}
|
||||
|
||||
define("ANTENNAS", false);
|
||||
|
||||
if (isset($_POST['referer'])) {
|
||||
@ -72,26 +76,10 @@ if (!is_array($pconfig)) {
|
||||
$pconfig = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['ppps'])) {
|
||||
$config['ppps'] = array();
|
||||
}
|
||||
if (!is_array($config['ppps']['ppp'])) {
|
||||
$config['ppps']['ppp'] = array();
|
||||
}
|
||||
init_config_arr(array('ppps', 'ppp'));
|
||||
$a_ppps = &$config['ppps']['ppp'];
|
||||
|
||||
function remove_bad_chars($string) {
|
||||
return preg_replace('/[^a-z_0-9]/i', '', $string);
|
||||
}
|
||||
|
||||
if (!is_array($config['gateways'])) {
|
||||
$config['gateways'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['gateways']['gateway_item'])) {
|
||||
$config['gateways']['gateway_item'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('gateways', 'gateway_item'));
|
||||
$a_gateways = &$config['gateways']['gateway_item'];
|
||||
|
||||
$interfaces = get_configured_interface_with_descr();
|
||||
@ -106,6 +94,7 @@ foreach ($no_address_interfaces as $ifbl) {
|
||||
}
|
||||
}
|
||||
|
||||
init_config_arr(array('interfaces', $if));
|
||||
$wancfg = &$config['interfaces'][$if];
|
||||
$old_wancfg = $wancfg;
|
||||
$old_wancfg['realif'] = get_real_interface($if);
|
||||
|
||||
@ -28,15 +28,8 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['bridges'])) {
|
||||
$config['bridges'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['bridges']['bridged'])) {
|
||||
$config['bridges']['bridged'] = array();
|
||||
}
|
||||
|
||||
$a_bridges = &$config['bridges']['bridged'] ;
|
||||
init_config_arr(array('bridges', 'bridged'));
|
||||
$a_bridges = &$config['bridges']['bridged'];
|
||||
|
||||
function bridge_inuse($num) {
|
||||
global $config, $a_bridges;
|
||||
|
||||
@ -28,14 +28,6 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['bridges'])) {
|
||||
$config['bridges'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['bridges']['bridged'])) {
|
||||
$config['bridges']['bridged'] = array();
|
||||
}
|
||||
|
||||
function is_aoadv_used($pconfig) {
|
||||
if (($pconfig['static'] !="") ||
|
||||
($pconfig['private'] != "") ||
|
||||
@ -60,6 +52,7 @@ function is_aoadv_used($pconfig) {
|
||||
return false;
|
||||
}
|
||||
|
||||
init_config_arr(array('bridges', 'bridged'));
|
||||
$a_bridges = &$config['bridges']['bridged'];
|
||||
|
||||
$ifacelist = get_configured_interface_with_descr();
|
||||
|
||||
@ -28,13 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['gifs'])) {
|
||||
$config['gifs'] = array();
|
||||
}
|
||||
if (!is_array($config['gifs']['gif'])) {
|
||||
$config['gifs']['gif'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('gifs', 'gif'));
|
||||
$a_gifs = &$config['gifs']['gif'] ;
|
||||
|
||||
function gif_inuse($num) {
|
||||
|
||||
@ -28,13 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['gifs'])) {
|
||||
$config['gifs'] = array();
|
||||
}
|
||||
if (!is_array($config['gifs']['gif'])) {
|
||||
$config['gifs']['gif'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('gifs', 'gif'));
|
||||
$a_gifs = &$config['gifs']['gif'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -29,13 +29,7 @@
|
||||
require_once("guiconfig.inc");
|
||||
require_once("functions.inc");
|
||||
|
||||
if (!is_array($config['gres'])) {
|
||||
$config['gres'] = array();
|
||||
}
|
||||
if (!is_array($config['gres']['gre'])) {
|
||||
$config['gres']['gre'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('gres', 'gre'));
|
||||
$a_gres = &$config['gres']['gre'] ;
|
||||
|
||||
function gre_inuse($num) {
|
||||
|
||||
@ -29,13 +29,7 @@
|
||||
require_once("guiconfig.inc");
|
||||
require_once("functions.inc");
|
||||
|
||||
if (!is_array($config['gres'])) {
|
||||
$config['gres'] = array();
|
||||
}
|
||||
if (!is_array($config['gres']['gre'])) {
|
||||
$config['gres']['gre'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('gres', 'gre'));
|
||||
$a_gres = &$config['gres']['gre'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -29,14 +29,7 @@
|
||||
require_once("guiconfig.inc");
|
||||
require_once("functions.inc");
|
||||
|
||||
if (!is_array($config['ifgroups'])) {
|
||||
$config['ifgroups'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['ifgroups']['ifgroupentry'])) {
|
||||
$config['ifgroups']['ifgroupentry'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('ifgroups', 'ifgroupentry'));
|
||||
$a_ifgroups = &$config['ifgroups']['ifgroupentry'];
|
||||
|
||||
if ($_POST['act'] == "del") {
|
||||
|
||||
@ -34,14 +34,7 @@ $pgtitle = array(gettext("Interfaces"), gettext("Interface Groups"), gettext("Ed
|
||||
$pglinks = array("", "interfaces_groups.php", "@self");
|
||||
$shortcut_section = "interfaces";
|
||||
|
||||
if (!is_array($config['ifgroups'])) {
|
||||
$config['ifgroups'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['ifgroups']['ifgroupentry'])) {
|
||||
$config['ifgroups']['ifgroupentry'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('ifgroups', 'ifgroupentry'));
|
||||
$a_ifgroups = &$config['ifgroups']['ifgroupentry'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['laggs'])) {
|
||||
$config['laggs'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['laggs']['lagg'])) {
|
||||
$config['laggs']['lagg'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('laggs', 'lagg'));
|
||||
$a_laggs = &$config['laggs']['lagg'] ;
|
||||
|
||||
function lagg_inuse($num) {
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['laggs'])) {
|
||||
$config['laggs'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['laggs']['lagg'])) {
|
||||
$config['laggs']['lagg'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('laggs', 'lagg'));
|
||||
$a_laggs = &$config['laggs']['lagg'];
|
||||
|
||||
$portlist = get_interface_list();
|
||||
|
||||
@ -39,14 +39,7 @@ define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
|
||||
define("CRON_DAILY_PATTERN", "0 0 * * *");
|
||||
define("CRON_HOURLY_PATTERN", "0 * * * *");
|
||||
|
||||
if (!is_array($config['ppps'])) {
|
||||
$config['ppps'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['ppps']['ppp'])) {
|
||||
$config['ppps']['ppp'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('ppps', 'ppp'));
|
||||
$a_ppps = &$config['ppps']['ppp'];
|
||||
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
@ -470,7 +463,6 @@ $types = array("select" => gettext("Select"), "ppp" => gettext("PPP"), "pppoe" =
|
||||
$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml";
|
||||
$serviceproviders_contents = file_get_contents($serviceproviders_xml);
|
||||
$serviceproviders_attr = xml2array($serviceproviders_contents, 1, "attr");
|
||||
|
||||
$serviceproviders = &$serviceproviders_attr['serviceproviders']['country'];
|
||||
|
||||
//print_r($serviceproviders);
|
||||
|
||||
@ -35,15 +35,8 @@ require_once("interfaces_fast.inc");
|
||||
|
||||
global $profile;
|
||||
|
||||
if (!is_array($config['vlans'])) {
|
||||
$config['vlans'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['vlans']['vlan'])) {
|
||||
$config['vlans']['vlan'] = array();
|
||||
}
|
||||
|
||||
$a_vlans = &$config['vlans']['vlan'] ;
|
||||
init_config_arr(array('vlans', 'vlan'));
|
||||
$a_vlans = &$config['vlans']['vlan'];
|
||||
|
||||
if ($_POST['act'] == "del") {
|
||||
if (!isset($_POST['id'])) {
|
||||
|
||||
@ -32,13 +32,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['vlans'])) {
|
||||
$config['vlans'] = array();
|
||||
}
|
||||
if (!is_array($config['vlans']['vlan'])) {
|
||||
$config['vlans']['vlan'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('vlans', 'vlan'));
|
||||
$a_vlans = &$config['vlans']['vlan'];
|
||||
|
||||
$portlist = get_interface_list();
|
||||
|
||||
@ -29,13 +29,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['wireless'])) {
|
||||
$config['wireless'] = array();
|
||||
}
|
||||
if (!is_array($config['wireless']['clone'])) {
|
||||
$config['wireless']['clone'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('wireless', 'clone'));
|
||||
$a_clones = &$config['wireless']['clone'];
|
||||
|
||||
function clone_inuse($num) {
|
||||
|
||||
@ -29,14 +29,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['wireless'])) {
|
||||
$config['wireless'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['wireless']['clone'])) {
|
||||
$config['wireless']['clone'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('wireless', 'clone'));
|
||||
$a_clones = &$config['wireless']['clone'];
|
||||
|
||||
function clone_inuse($num) {
|
||||
|
||||
@ -30,9 +30,7 @@
|
||||
require_once("guiconfig.inc");
|
||||
require_once("filter.inc");
|
||||
|
||||
if (!is_array($config['load_balancer']['monitor_type'])) {
|
||||
$config['load_balancer']['monitor_type'] = array();
|
||||
}
|
||||
init_config_arr(array('load_balancer', 'monitor_type'));
|
||||
$a_monitor = &$config['load_balancer']['monitor_type'];
|
||||
|
||||
$pconfig = $_POST;
|
||||
|
||||
@ -31,10 +31,7 @@ require_once("guiconfig.inc");
|
||||
|
||||
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_monitor.php');
|
||||
|
||||
if (!is_array($config['load_balancer']['monitor_type'])) {
|
||||
$config['load_balancer']['monitor_type'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'monitor_type'));
|
||||
$a_monitor = &$config['load_balancer']['monitor_type'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -32,10 +32,7 @@ require_once("functions.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
|
||||
if (!is_array($config['load_balancer']['lbpool'])) {
|
||||
$config['load_balancer']['lbpool'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'lbpool'));
|
||||
$a_pool = &$config['load_balancer']['lbpool'];
|
||||
|
||||
$pconfig = $_POST;
|
||||
|
||||
@ -33,16 +33,13 @@ require_once("util.inc");
|
||||
|
||||
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_pool.php');
|
||||
|
||||
if (!is_array($config['load_balancer']['lbpool'])) {
|
||||
$config['load_balancer']['lbpool'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'lbpool'));
|
||||
$a_pool = &$config['load_balancer']['lbpool'];
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
if (isset($id) && $a_pool[$id]) {
|
||||
init_config_arr(array('load_balancer', 'lbpool', $id));
|
||||
$pconfig['name'] = $a_pool[$id]['name'];
|
||||
$pconfig['mode'] = $a_pool[$id]['mode'];
|
||||
$pconfig['descr'] = $a_pool[$id]['descr'];
|
||||
|
||||
@ -34,10 +34,7 @@ require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
require_once("util.inc");
|
||||
|
||||
if (!is_array($config['load_balancer']['setting'])) {
|
||||
$config['load_balancer']['setting'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'setting'));
|
||||
$lbsetting = &$config['load_balancer']['setting'];
|
||||
|
||||
if ($_POST) {
|
||||
|
||||
@ -33,10 +33,7 @@ require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
require_once("vslb.inc");
|
||||
|
||||
if (!is_array($config['load_balancer']['virtual_server'])) {
|
||||
$config['load_balancer']['virtual_server'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'virtual_server'));
|
||||
$a_vs = &$config['load_balancer']['virtual_server'];
|
||||
|
||||
$pconfig = $_POST;
|
||||
|
||||
@ -35,15 +35,11 @@ if (isset($_POST['referer'])) {
|
||||
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_virtual_server.php');
|
||||
}
|
||||
|
||||
if (!is_array($config['load_balancer']['virtual_server'])) {
|
||||
$config['load_balancer']['virtual_server'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['load_balancer']['lbpool'])) {
|
||||
$config['load_balancer']['lbpool'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('load_balancer', 'virtual_server'));
|
||||
$a_vs = &$config['load_balancer']['virtual_server'];
|
||||
init_config_arr(array('load_balancer', 'lbpool'));
|
||||
$a_pool = &$config['load_balancer']['lbpool'];
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
if (isset($id) && $a_vs[$id]) {
|
||||
|
||||
@ -125,6 +125,7 @@ if ($_REQUEST['act'] == "del") {
|
||||
}
|
||||
}
|
||||
|
||||
init_config_arr(array('installedpackages', xml_safe_fieldname($pkg['name']), 'config'));
|
||||
$a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
|
||||
|
||||
if ($a_pkg[$_REQUEST['id']]) {
|
||||
|
||||
@ -95,8 +95,9 @@ if ($config['installedpackages'] && !is_array($config['installedpackages'][xml_s
|
||||
* https://redmine.pfsense.org/issues/7624
|
||||
* https://redmine.pfsense.org/issues/476
|
||||
*/
|
||||
if ($config['installedpackages'] &&
|
||||
(count($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']) > 0) &&
|
||||
|
||||
init_config_arr(array('installedpackages', xml_safe_fieldname($pkg['name']), 'config'));
|
||||
if ((count($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']) > 0) &&
|
||||
(empty($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'][0])) &&
|
||||
is_array($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'])) {
|
||||
array_shift($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']);
|
||||
@ -1102,10 +1103,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
|
||||
$size = ($pkga['size'] ? "size=\"{$pkga['size']}\"" : '');
|
||||
$fieldname = $pkga['fieldname'];
|
||||
|
||||
if (!is_array($config['aliases'])) {
|
||||
$config['aliases'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('aliases', 'alias'));
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
$addrisfirst = 0;
|
||||
$aliasesaddr = "";
|
||||
|
||||
@ -56,6 +56,8 @@ function index_of_command() {
|
||||
}
|
||||
|
||||
$croncmd = "/usr/bin/nice -n20 /usr/local/bin/php /usr/local/sbin/execacb.php";
|
||||
|
||||
init_config_arr(array('cron', 'item'));
|
||||
$a_cron = &$config['cron']['item'];
|
||||
$pconfig = $config['system']['acb'];
|
||||
|
||||
|
||||
@ -54,11 +54,8 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("Configuration"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "@self", "@self");
|
||||
@ -126,17 +123,11 @@ if ($_REQUEST['act'] == "viewhtml") {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['ca'])) {
|
||||
$config['ca'] = array();
|
||||
}
|
||||
init_config_arr(array('ca'));
|
||||
$a_ca = &$config['ca'];
|
||||
|
||||
$a_ca =& $config['ca'];
|
||||
|
||||
if (!is_array($config['cert'])) {
|
||||
$config['cert'] = array();
|
||||
}
|
||||
|
||||
$a_cert =& $config['cert'];
|
||||
init_config_arr(array('cert'));
|
||||
$a_cert = &$config['cert'];
|
||||
|
||||
if ($a_cp[$cpzone]) {
|
||||
$cpzoneid = $pconfig['zoneid'] = $a_cp[$cpzone]['zoneid'];
|
||||
@ -319,7 +310,8 @@ if ($_POST['save']) {
|
||||
}
|
||||
|
||||
if (!$input_errors) {
|
||||
$newcp =& $a_cp[$cpzone];
|
||||
init_config_arr(array('captiveportal', $cpzone));
|
||||
$newcp = &$a_cp[$cpzone];
|
||||
//$newcp['zoneid'] = $a_cp[$cpzone]['zoneid'];
|
||||
if (empty($newcp['zoneid'])) {
|
||||
$newcp['zoneid'] = 2;
|
||||
|
||||
@ -57,22 +57,14 @@ if (empty($cpzone)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'element'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_element = &$a_cp[$cpzone]['element'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("File Manager"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "@self");
|
||||
$shortcut_section = "captiveportal";
|
||||
|
||||
if (!is_array($a_cp[$cpzone]['element'])) {
|
||||
$a_cp[$cpzone]['element'] = array();
|
||||
}
|
||||
|
||||
$a_element =& $a_cp[$cpzone]['element'];
|
||||
|
||||
// Calculate total size of all files
|
||||
$total_size = 0;
|
||||
for ($i = 0; $i < count($a_element); $i++) {
|
||||
|
||||
@ -49,11 +49,9 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'allowedhostname'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_allowedhostnames = &$a_cp[$cpzone]['allowedhostname'];
|
||||
|
||||
if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) {
|
||||
$cpzoneid = $a_cp[$cpzone]['zoneid'];
|
||||
@ -64,7 +62,6 @@ $pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal
|
||||
$shortcut_section = "captiveportal";
|
||||
|
||||
if ($_POST['act'] == "del" && !empty($cpzone)) {
|
||||
$a_allowedhostnames =& $a_cp[$cpzone]['allowedhostname'];
|
||||
if ($a_allowedhostnames[$_POST['id']]) {
|
||||
$ipent = $a_allowedhostnames[$_POST['id']];
|
||||
|
||||
|
||||
@ -54,11 +54,9 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'allowedhostname'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_allowedhostnames = &$a_cp[$cpzone]['allowedhostname'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("Allowed Hostnames"), gettext("Edit"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "services_captiveportal_hostname.php?zone=" . $cpzone, "@self");
|
||||
@ -66,13 +64,6 @@ $shortcut_section = "captiveportal";
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
if (!is_array($a_cp[$cpzone]['allowedhostname'])) {
|
||||
$a_cp[$cpzone]['allowedhostname'] = array();
|
||||
}
|
||||
|
||||
$a_allowedhostnames = &$a_cp[$cpzone]['allowedhostname'];
|
||||
|
||||
if (isset($id) && $a_allowedhostnames[$id]) {
|
||||
$pconfig['zone'] = $a_allowedhostnames[$id]['zone'];
|
||||
$pconfig['hostname'] = $a_allowedhostnames[$id]['hostname'];
|
||||
|
||||
@ -46,11 +46,8 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) {
|
||||
$cpzoneid = $a_cp[$cpzone]['zoneid'];
|
||||
@ -61,7 +58,8 @@ $pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal
|
||||
$shortcut_section = "captiveportal";
|
||||
|
||||
if ($_POST['act'] == "del" && !empty($cpzone)) {
|
||||
$a_allowedips =& $config['captiveportal'][$cpzone]['allowedip'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'allowedip'));
|
||||
$a_allowedips = &$config['captiveportal'][$cpzone]['allowedip'];
|
||||
|
||||
if ($a_allowedips[$_POST['id']]) {
|
||||
$ipent = $a_allowedips[$_POST['id']];
|
||||
|
||||
@ -54,23 +54,15 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'allowedip'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_allowedips = &$config['captiveportal'][$cpzone]['allowedip'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("Allowed IP Addresses"), gettext("Edit"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "services_captiveportal_ip.php?zone=" . $cpzone, "@self");
|
||||
$shortcut_section = "captiveportal";
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
if (!is_array($config['captiveportal'][$cpzone]['allowedip'])) {
|
||||
$config['captiveportal'][$cpzone]['allowedip'] = array();
|
||||
}
|
||||
|
||||
$a_allowedips =& $config['captiveportal'][$cpzone]['allowedip'];
|
||||
|
||||
if (isset($id) && $a_allowedips[$id]) {
|
||||
$pconfig['ip'] = $a_allowedips[$id]['ip'];
|
||||
$pconfig['sn'] = $a_allowedips[$id]['sn'];
|
||||
|
||||
@ -47,11 +47,9 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'passthrumac'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_passthrumacs = &$a_cp[$cpzone]['passthrumac'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("MACs"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "@self");
|
||||
@ -81,20 +79,11 @@ if ($_POST['save']) {
|
||||
}
|
||||
|
||||
if ($_POST['postafterlogin']) {
|
||||
if (!is_array($a_passthrumacs)) {
|
||||
if (empty($a_passthrumacs)) {
|
||||
echo gettext("No entry exists yet!") ."\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($_POST['zone'])) {
|
||||
echo gettext("Please set the zone on which the operation should be allowed");
|
||||
exit;
|
||||
}
|
||||
if (!is_array($a_cp[$cpzone]['passthrumac'])) {
|
||||
$a_cp[$cpzone]['passthrumac'] = array();
|
||||
}
|
||||
$a_passthrumacs =& $a_cp[$cpzone]['passthrumac'];
|
||||
|
||||
if ($_POST['username']) {
|
||||
$mac = captiveportal_passthrumac_findbyname($_POST['username']);
|
||||
if (!empty($mac)) {
|
||||
@ -131,8 +120,6 @@ if ($_POST['save']) {
|
||||
}
|
||||
|
||||
if ($_POST['act'] == "del") {
|
||||
$a_passthrumacs =& $a_cp[$cpzone]['passthrumac'];
|
||||
|
||||
if ($a_passthrumacs[$_POST['id']]) {
|
||||
$cpzoneid = $a_cp[$cpzone]['zoneid'];
|
||||
$rules = captiveportal_passthrumac_delete_entry($a_passthrumacs[$_POST['id']]);
|
||||
|
||||
@ -57,11 +57,9 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal', $cpzone, 'passthrumac'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_passthrumacs = &$a_cp[$cpzone]['passthrumac'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("MACs"), gettext("Edit"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "services_captiveportal_mac.php?zone=" . $cpzone, "@self");
|
||||
@ -71,12 +69,6 @@ if (is_numericint($_REQUEST['id'])) {
|
||||
$id = $_REQUEST['id'];
|
||||
}
|
||||
|
||||
if (!is_array($a_cp[$cpzone]['passthrumac'])) {
|
||||
$a_cp[$cpzone]['passthrumac'] = array();
|
||||
}
|
||||
|
||||
$a_passthrumacs = &$a_cp[$cpzone]['passthrumac'];
|
||||
|
||||
if (isset($id) && $a_passthrumacs[$id]) {
|
||||
$pconfig['action'] = $a_passthrumacs[$id]['action'];
|
||||
$pconfig['mac'] = $a_passthrumacs[$id]['mac'];
|
||||
|
||||
@ -55,15 +55,9 @@ if (empty($cpzone)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
|
||||
if (!is_array($config['voucher'])) {
|
||||
$config['voucher'] = array();
|
||||
}
|
||||
init_config_arr(array('captiveportal'));
|
||||
init_config_arr(array('voucher', $cpzone, 'roll'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
if (empty($a_cp[$cpzone])) {
|
||||
log_error(sprintf(gettext("Submission on captiveportal page with unknown zone parameter: %s"), htmlspecialchars($cpzone)));
|
||||
|
||||
@ -41,28 +41,17 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
init_config_arr(array('voucher', $cpzone, 'roll'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
$a_roll = &$config['voucher'][$cpzone]['roll'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("Vouchers"), gettext("Edit"));
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "services_captiveportal.php?zone=" . $cpzone, "services_captiveportal_vouchers.php?zone=" . $cpzone, "@self");
|
||||
$shortcut_section = "captiveportal-vouchers";
|
||||
|
||||
if (!is_array($config['voucher'])) {
|
||||
$config['voucher'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['voucher'][$cpzone]['roll'])) {
|
||||
$config['voucher'][$cpzone]['roll'] = array();
|
||||
}
|
||||
|
||||
$a_roll = &$config['voucher'][$cpzone]['roll'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
if (isset($id) && $a_roll[$id]) {
|
||||
$pconfig['zone'] = $a_roll[$id]['zone'];
|
||||
$pconfig['number'] = $a_roll[$id]['number'];
|
||||
|
||||
@ -35,9 +35,7 @@ require_once("captiveportal.inc");
|
||||
global $cpzone;
|
||||
global $cpzoneid;
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
if ($_POST['act'] == "del" && !empty($_POST['zone'])) {
|
||||
|
||||
@ -36,11 +36,8 @@ $pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Add Zo
|
||||
$pglinks = array("", "services_captiveportal_zones.php", "@self");
|
||||
$shortcut_section = "captiveportal";
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
if ($_POST['Submit']) {
|
||||
unset($input_errors);
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['checkipservices'])) {
|
||||
$config['checkipservices'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['checkipservices']['checkipservice'])) {
|
||||
$config['checkipservices']['checkipservice'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('checkipservices', 'checkipservice'));
|
||||
$a_checkipservice = &$config['checkipservices']['checkipservice'];
|
||||
|
||||
$dirty = false;
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['checkipservices'])) {
|
||||
$config['checkipservices'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['checkipservices']['checkipservice'])) {
|
||||
$config['checkipservices']['checkipservice'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('checkipservices', 'checkipservice'));
|
||||
$a_checkip = &$config['checkipservices']['checkipservice'];
|
||||
|
||||
if (is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -118,10 +118,7 @@ if (is_array($config['dhcpd'][$if])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'][$if]['pool'])) {
|
||||
$config['dhcpd'][$if]['pool'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dhcpd', $if, 'pool'));
|
||||
$a_pools = &$config['dhcpd'][$if]['pool'];
|
||||
|
||||
if (is_numeric($pool) && $a_pools[$pool]) {
|
||||
@ -132,10 +129,7 @@ if (is_array($config['dhcpd'][$if])) {
|
||||
$dhcpdconf = &$config['dhcpd'][$if];
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'][$if]['staticmap'])) {
|
||||
$dhcpdconf['staticmap'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dhcpd', $if, 'staticmap'));
|
||||
$a_maps = &$config['dhcpd'][$if]['staticmap'];
|
||||
}
|
||||
|
||||
|
||||
@ -56,27 +56,12 @@ if (!$if) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'])) {
|
||||
$config['dhcpd'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'][$if])) {
|
||||
$config['dhcpd'][$if] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'][$if]['staticmap'])) {
|
||||
$config['dhcpd'][$if]['staticmap'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpd'][$if]['pool'])) {
|
||||
$config['dhcpd'][$if]['pool'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dhcpd', $if, 'staticmap'));
|
||||
init_config_arr(array('dhcpd', $if, 'pool'));
|
||||
$a_maps = &$config['dhcpd'][$if]['staticmap'];
|
||||
$a_pools = &$config['dhcpd'][$if]['pool'];
|
||||
|
||||
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
|
||||
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
|
||||
$a_maps = &$config['dhcpd'][$if]['staticmap'];
|
||||
$ifcfgip = get_interface_ip($if);
|
||||
$ifcfgsn = get_interface_subnet($if);
|
||||
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
|
||||
|
||||
@ -171,6 +171,7 @@ if (is_array($config['dhcpdv6'][$if])) {
|
||||
if (!is_array($config['dhcpdv6'][$if]['staticmap'])) {
|
||||
$config['dhcpdv6'][$if]['staticmap'] = array();
|
||||
}
|
||||
init_config_arr(array('dhcpdv6', $if, 'staticmap'));
|
||||
$a_maps = &$config['dhcpdv6'][$if]['staticmap'];
|
||||
}
|
||||
|
||||
|
||||
@ -57,16 +57,7 @@ if (!$if) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!is_array($config['dhcpdv6'])) {
|
||||
$config['dhcpdv6'] = array();
|
||||
}
|
||||
if (!is_array($config['dhcpdv6'][$if])) {
|
||||
$config['dhcpdv6'][$if] = array();
|
||||
}
|
||||
if (!is_array($config['dhcpdv6'][$if]['staticmap'])) {
|
||||
$config['dhcpdv6'][$if]['staticmap'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dhcpdv6', $if, 'staticmap'));
|
||||
$netboot_enabled = isset($config['dhcpdv6'][$if]['netboot']);
|
||||
$a_maps = &$config['dhcpdv6'][$if]['staticmap'];
|
||||
$ifcfgipv6 = get_interface_ipv6($if);
|
||||
|
||||
@ -85,14 +85,6 @@ if (!empty($config['dnsmasq']['interface'])) {
|
||||
$pconfig['interface'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dnsmasq']['hosts'])) {
|
||||
$config['dnsmasq']['hosts'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dnsmasq']['domainoverrides'])) {
|
||||
$config['dnsmasq']['domainoverrides'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dnsmasq', 'hosts'));
|
||||
$a_hosts = &$config['dnsmasq']['hosts'];
|
||||
|
||||
|
||||
@ -33,10 +33,6 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['dnsmasq']['domainoverrides'])) {
|
||||
$config['dnsmasq']['domainoverrides'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dnsmasq', 'domainoverrides'));
|
||||
$a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
|
||||
|
||||
|
||||
@ -33,10 +33,6 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['dnsmasq']['hosts'])) {
|
||||
$config['dnsmasq']['hosts'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dnsmasq', 'hosts'));
|
||||
$a_hosts = &$config['dnsmasq']['hosts'];
|
||||
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if(!is_array($config['dyndnses'])){
|
||||
$config['dyndnses'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dyndnses', 'dyndns'));
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
global $dyndns_split_domain_types;
|
||||
|
||||
|
||||
@ -41,14 +41,7 @@ function is_dyndns_username($uname) {
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['dyndnses'])) {
|
||||
$config['dyndnses'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dyndnses', 'dyndns'));
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
@ -32,15 +32,9 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if(!is_array($config['igmpproxy'])){
|
||||
$config['igmpproxy'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['igmpproxy']['igmpentry'])) {
|
||||
$config['igmpproxy']['igmpentry'] = array();
|
||||
}
|
||||
|
||||
//igmpproxy_sort();
|
||||
|
||||
init_config_arr(array('igmpproxy', 'igmpentry'));
|
||||
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
||||
|
||||
if ($_POST['apply']) {
|
||||
|
||||
@ -35,15 +35,9 @@ $pglinks = array("", "services_igmpproxy.php", "@self");
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['igmpproxy'])) {
|
||||
$config['igmpproxy'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['igmpproxy']['igmpentry'])) {
|
||||
$config['igmpproxy']['igmpentry'] = array();
|
||||
}
|
||||
|
||||
//igmpproxy_sort();
|
||||
|
||||
init_config_arr(array('igmpproxy', 'igmpentry'));
|
||||
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
||||
|
||||
if (is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -179,6 +179,7 @@ function build_interface_list() {
|
||||
return($iflist);
|
||||
}
|
||||
|
||||
init_config_arr(array('ntpd'));
|
||||
$pconfig = &$config['ntpd'];
|
||||
if (empty($pconfig['interface'])) {
|
||||
$pconfig['interface'] = array();
|
||||
|
||||
@ -170,6 +170,7 @@ if ($_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
init_config_arr(array('ntpd'));
|
||||
$pconfig = &$config['ntpd'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("NTP"), gettext("ACLs"));
|
||||
|
||||
@ -306,6 +306,7 @@ function build_nmea_list() {
|
||||
return($nmealist);
|
||||
}
|
||||
|
||||
init_config_arr(array('ntpd', 'gps'));
|
||||
$pconfig = &$config['ntpd']['gps'];
|
||||
$pgtitle = array(gettext("Services"), gettext("NTP"), gettext("Serial GPS"));
|
||||
$pglinks = array("", "services_ntpd.php", "@self");
|
||||
|
||||
@ -97,6 +97,7 @@ if ($_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
init_config_arr(array('ntpd', 'pps'));
|
||||
$pconfig = &$config['ntpd']['pps'];
|
||||
|
||||
$pgtitle = array(gettext("Services"), gettext("NTP"), gettext("PPS"));
|
||||
|
||||
@ -30,14 +30,7 @@ require_once("guiconfig.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("vpn.inc");
|
||||
|
||||
if (!is_array($config['pppoes'])) {
|
||||
$config['pppoes'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['pppoes']['pppoe'])) {
|
||||
$config['pppoes']['pppoe'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('pppoes', 'pppoe'));
|
||||
$a_pppoes = &$config['pppoes']['pppoe'];
|
||||
|
||||
|
||||
|
||||
@ -46,10 +46,7 @@ function vpn_pppoe_get_id() {
|
||||
return $vpnid;
|
||||
}
|
||||
|
||||
if (!is_array($config['pppoes']['pppoe'])) {
|
||||
$config['pppoes']['pppoe'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('pppoes', 'pppoe'));
|
||||
$a_pppoes = &$config['pppoes']['pppoe'];
|
||||
|
||||
if (is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -28,14 +28,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['dnsupdates'])) {
|
||||
$config['dnsupdates'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dnsupdates']['dnsupdate'])) {
|
||||
$config['dnsupdates']['dnsupdate'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dnsupdates', 'dnsupdate'));
|
||||
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
|
||||
|
||||
if ($_POST['act'] == "del") {
|
||||
|
||||
@ -37,14 +37,7 @@ $tsig_key_algos = array(
|
||||
'hmac-sha512' => 'HMAC-SHA512 (most secure)',
|
||||
);
|
||||
|
||||
if (!is_array($config['dnsupdates'])) {
|
||||
$config['dnsupdates'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['dnsupdates']['dnsupdate'])) {
|
||||
$config['dnsupdates']['dnsupdate'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('dnsupdates', 'dnsupdate'));
|
||||
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
|
||||
|
||||
if (is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -32,22 +32,10 @@ require_once("unbound.inc");
|
||||
require_once("pfsense-utils.inc");
|
||||
require_once("system.inc");
|
||||
|
||||
if (!is_array($config['unbound'])) {
|
||||
$config['unbound'] = array();
|
||||
}
|
||||
|
||||
$a_unboundcfg =& $config['unbound'];
|
||||
|
||||
if (!is_array($a_unboundcfg['hosts'])) {
|
||||
$a_unboundcfg['hosts'] = array();
|
||||
}
|
||||
|
||||
$a_hosts =& $a_unboundcfg['hosts'];
|
||||
|
||||
if (!is_array($a_unboundcfg['domainoverrides'])) {
|
||||
$a_unboundcfg['domainoverrides'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('unbound', 'hosts'));
|
||||
init_config_arr(array('unbound', 'domainoverrides'));
|
||||
$a_unboundcfg = &$config['unbound'];
|
||||
$a_hosts = &$a_unboundcfg['hosts'];
|
||||
$a_domainOverrides = &$a_unboundcfg['domainoverrides'];
|
||||
|
||||
if (isset($a_unboundcfg['enable'])) {
|
||||
@ -98,7 +86,8 @@ if (empty($a_unboundcfg['system_domain_local_zone_type'])) {
|
||||
$pconfig['system_domain_local_zone_type'] = $a_unboundcfg['system_domain_local_zone_type'];
|
||||
}
|
||||
|
||||
$a_cert =& $config['cert'];
|
||||
init_config_arr(array('cert'));
|
||||
$a_cert = &$config['cert'];
|
||||
$certs_available = false;
|
||||
|
||||
if (is_array($a_cert) && count($a_cert)) {
|
||||
|
||||
@ -31,10 +31,7 @@ require_once("guiconfig.inc");
|
||||
require_once("pfsense-utils.inc");
|
||||
require_once("unbound.inc");
|
||||
|
||||
if (!is_array($config['unbound']['acls'])) {
|
||||
$config['unbound']['acls'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('unbound', 'acls'));
|
||||
$a_acls = &$config['unbound']['acls'];
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
@ -34,10 +34,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['unbound']['domainoverrides'])) {
|
||||
$config['unbound']['domainoverrides'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('unbound', 'domainoverrides'));
|
||||
$a_domainOverrides = &$config['unbound']['domainoverrides'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -48,10 +48,7 @@ function hosts_sort() {
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['unbound']['hosts'])) {
|
||||
$config['unbound']['hosts'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('unbound', 'hosts'));
|
||||
$a_hosts = &$config['unbound']['hosts'];
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
|
||||
@ -32,14 +32,7 @@
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['wol'])) {
|
||||
$config['wol'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['wol']['wolentry'])) {
|
||||
$config['wol']['wolentry'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('wol', 'wolentry'));
|
||||
$a_wol = &$config['wol']['wolentry'];
|
||||
|
||||
if ($_REQUEST['wakeall'] != "") {
|
||||
|
||||
@ -42,14 +42,7 @@ function wol_sort() {
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
|
||||
if (!is_array($config['wol'])) {
|
||||
$config['wol'] = array();
|
||||
}
|
||||
|
||||
if (!is_array($config['wol']['wolentry'])) {
|
||||
$config['wol']['wolentry'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('wol', 'wolentry'));
|
||||
$a_wol = &$config['wol']['wolentry'];
|
||||
|
||||
if (is_numericint($_REQUEST['id'])) {
|
||||
|
||||
@ -117,11 +117,8 @@ function print_details($cpent) {
|
||||
|
||||
$cpzone = strtolower($_REQUEST['zone']);
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
if (count($a_cp) == 1) {
|
||||
$cpzone = current(array_keys($a_cp));
|
||||
|
||||
@ -40,7 +40,8 @@ if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
/* If the zone does not exist, do not display the invalid zone */
|
||||
if (!array_key_exists($cpzone, $a_cp)) {
|
||||
|
||||
@ -36,11 +36,8 @@ require_once("voucher.inc");
|
||||
|
||||
$cpzone = strtolower($_REQUEST['zone']);
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
/* If the zone does not exist, do not display the invalid zone */
|
||||
if (!array_key_exists($cpzone, $a_cp)) {
|
||||
|
||||
@ -36,11 +36,8 @@ require_once("voucher.inc");
|
||||
|
||||
$cpzone = strtolower($_REQUEST['zone']);
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
/* If the zone does not exist, do not display the invalid zone */
|
||||
if (!array_key_exists($cpzone, $a_cp)) {
|
||||
@ -60,6 +57,7 @@ if (!is_array($config['voucher'][$cpzone]['roll'])) {
|
||||
$config['voucher'][$cpzone]['roll'] = array();
|
||||
}
|
||||
|
||||
init_config_arr(array('voucher', $cpzone, 'roll'));
|
||||
$a_roll = &$config['voucher'][$cpzone]['roll'];
|
||||
|
||||
include("head.inc");
|
||||
|
||||
@ -36,11 +36,8 @@ require_once("voucher.inc");
|
||||
|
||||
$cpzone = strtolower($_REQUEST['zone']);
|
||||
|
||||
if (!is_array($config['captiveportal'])) {
|
||||
$config['captiveportal'] = array();
|
||||
}
|
||||
|
||||
$a_cp =& $config['captiveportal'];
|
||||
init_config_arr(array('captiveportal'));
|
||||
$a_cp = &$config['captiveportal'];
|
||||
|
||||
/* If the zone does not exist, do not display the invalid zone */
|
||||
if (!array_key_exists($cpzone, $a_cp)) {
|
||||
|
||||
@ -57,36 +57,31 @@ if ($status != 0 && $_POST['carp_maintenancemode'] != "") {
|
||||
}
|
||||
|
||||
if ($_POST['disablecarp'] != "") {
|
||||
init_config_arr(array('virtualip', 'vip'));
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
if ($status != 0) {
|
||||
set_single_sysctl('net.inet.carp.allow', '0');
|
||||
if (is_array($config['virtualip']['vip'])) {
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
foreach ($viparr as $vip) {
|
||||
if ($vip['mode'] != "carp" && $vip['mode'] != "ipalias")
|
||||
continue;
|
||||
if ($vip['mode'] == "ipalias" && substr($vip['interface'], 0, 4) != "_vip")
|
||||
continue;
|
||||
|
||||
interface_vip_bring_down($vip);
|
||||
}
|
||||
foreach ($viparr as $vip) {
|
||||
if ($vip['mode'] != "carp" && $vip['mode'] != "ipalias")
|
||||
continue;
|
||||
if ($vip['mode'] == "ipalias" && substr($vip['interface'], 0, 4) != "_vip")
|
||||
continue;
|
||||
interface_vip_bring_down($vip);
|
||||
}
|
||||
$savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot and some configuration changes will re-enable."), $carp_counter);
|
||||
$status = 0;
|
||||
} else {
|
||||
$savemsg = gettext("CARP has been enabled.");
|
||||
if (is_array($config['virtualip']['vip'])) {
|
||||
$viparr = &$config['virtualip']['vip'];
|
||||
foreach ($viparr as $vip) {
|
||||
switch ($vip['mode']) {
|
||||
case "carp":
|
||||
interface_carp_configure($vip);
|
||||
break;
|
||||
case 'ipalias':
|
||||
if (substr($vip['interface'], 0, 4) == "_vip") {
|
||||
interface_ipalias_configure($vip);
|
||||
}
|
||||
break;
|
||||
}
|
||||
foreach ($viparr as $vip) {
|
||||
switch ($vip['mode']) {
|
||||
case "carp":
|
||||
interface_carp_configure($vip);
|
||||
break;
|
||||
case 'ipalias':
|
||||
if (substr($vip['interface'], 0, 4) == "_vip") {
|
||||
interface_ipalias_configure($vip);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
interfaces_sync_setup();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user