Bug #9121 ยป php-array-refs.diff
| src/etc/inc/auth.inc | ||
|---|---|---|
|
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;
|
||
| ... | ... | |
|
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);
|
||
| src/etc/inc/easyrule.inc | ||
|---|---|---|
|
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 */
|
||
| ... | ... | |
|
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'];
|
||
| ... | ... | |
|
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 */
|
||
| src/etc/inc/filter.inc | ||
|---|---|---|
|
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;
|
||
| ... | ... | |
|
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");
|
||
| src/etc/inc/gwlb.inc | ||
|---|---|---|
|
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();
|
||
| src/etc/inc/interfaces.inc | ||
|---|---|---|
|
$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)) {
|
||
| ... | ... | |
|
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);
|
||
| src/etc/inc/interfaces_fast.inc | ||
|---|---|---|
|
$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));
|
||
| src/etc/inc/itemid.inc | ||
|---|---|---|
|
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);
|
||
| src/etc/inc/pfsense-utils.inc | ||
|---|---|---|
|
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'] <> "") {
|
||
| ... | ... | |
|
$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;
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
$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])) {
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
} elseif ($type == 'close') {
|
||
|
$current = & $parent[$level -1];
|
||
|
$current = &$parent[$level -1];
|
||
|
}
|
||
|
}
|
||
|
return ($xml_array);
|
||
| src/etc/inc/pkg-utils.inc | ||
|---|---|---|
|
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']);
|
||
| ... | ... | |
|
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 */
|
||
| src/etc/inc/priv.inc | ||
|---|---|---|
|
}
|
||
|
foreach ($entry['priv'] as $pname) {
|
||
|
if (strncmp($pname, "page-", 5)) {
|
||
|
continue;
|
||
|
}
|
||
|
$priv = &$priv_list[$pname];
|
||
|
if (!is_array($priv)) {
|
||
|
continue;
|
||
|
}
|
||
|
$matches = &$priv['match'];
|
||
|
if (!is_array($matches)) {
|
||
|
if (strncmp($pname, "page-", 5) ||
|
||
|
!is_array($priv_list[$pname]) ||
|
||
|
!is_array($priv_list[$pname]['match'])) {
|
||
|
continue;
|
||
|
}
|
||
|
foreach ($matches as $match) {
|
||
|
foreach ($priv_list[$pname]['match'] as $match) {
|
||
|
$allowed_pages[] = $match;
|
||
|
}
|
||
|
}
|
||
| src/etc/inc/service-utils.inc | ||
|---|---|---|
|
$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']);
|
||
| ... | ... | |
|
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");
|
||
| ... | ... | |
|
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");
|
||
| src/etc/inc/services.inc | ||
|---|---|---|
|
/* 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'])) {
|
||
| ... | ... | |
|
/* 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'])) {
|
||
| ... | ... | |
|
$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;
|
||
| src/etc/inc/shaper.inc | ||
|---|---|---|
|
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();
|
||
| ... | ... | |
|
if (!is_array($ptr['queue'][$indeks])) {
|
||
|
$ptr['queue'][$indeks] = array();
|
||
|
}
|
||
|
$ptr =& $ptr['queue'][$indeks];
|
||
|
$ptr = &$ptr['queue'][$indeks];
|
||
|
}
|
||
|
return $ptr;
|
||
| ... | ... | |
|
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]]);
|
||
|
}
|
||
| ... | ... | |
|
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;
|
||
| ... | ... | |
|
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]]);
|
||
|
}
|
||
| ... | ... | |
|
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);
|
||
| ... | ... | |
|
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();
|
||
| ... | ... | |
|
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;
|
||
|
}
|
||
| src/etc/inc/system.inc | ||
|---|---|---|
|
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();
|
||
| src/etc/inc/upgrade_config.inc | ||
|---|---|---|
|
}
|
||
|
/* convert filter rules */
|
||
|
init_config_arr(array('filter', 'rule'));
|
||
|
$n = count($config['filter']['rule']);
|
||
|
for ($i = 0; $i < $n; $i++) {
|
||
| ... | ... | |
|
}
|
||
|
/* 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++) {
|
||
| ... | ... | |
|
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++) {
|
||
| ... | ... | |
|
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;
|
||
| ... | ... | |
|
/* 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 */
|
||
| ... | ... | |
|
$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.
|
||
| ... | ... | |
|
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;
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
if (!is_array($config['ppps']['ppp'])) {
|
||
|
$config['ppps']['ppp'] = array();
|
||
|
}
|
||
|
$a_ppps = &$config['ppps']['ppp'];
|
||
|
foreach ($ifcfg as $ifname => $ifinfo) {
|
||
| ... | ... | |
|
function upgrade_065_to_066() {
|
||
|
global $config;
|
||
|
$dhcrelaycfg =& $config['dhcrelay'];
|
||
|
init_config_arr(array('dhcrelay'));
|
||
|
$dhcrelaycfg = &$config['dhcrelay'];
|
||
|
if (is_array($dhcrelaycfg)) {
|
||
|
$dhcrelayifs = array();
|
||
| ... | ... | |
|
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'])) {
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
}
|
||
|
// 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')) {
|
||
| ... | ... | |
|
return;
|
||
|
}
|
||
|
$miniupnpd =& $config['installedpackages']['miniupnpd']['config'][0];
|
||
|
$miniupnpd = &$config['installedpackages']['miniupnpd']['config'][0];
|
||
|
$miniupnpd['row'] = array();
|
||
| ... | ... | |
|
// 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--) {
|
||
| ... | ... | |
|
// 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--) {
|
||
| ... | ... | |
|
// 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--) {
|
||
| ... | ... | |
|
// 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--) {
|
||
| ... | ... | |
|
// 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--) {
|
||
| ... | ... | |
|
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) {
|
||
| ... | ... | |
|
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) {
|
||
| ... | ... | |
|
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) {
|
||
| ... | ... | |
|
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)) {
|
||
| ... | ... | |
|
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'];
|
||
| src/etc/inc/util.inc | ||
|---|---|---|
|
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);
|
||
|
}
|
||
| ... | ... | |
|
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);
|
||
|
}
|
||
| src/etc/phpshellsessions/disablecarp | ||
|---|---|---|
|
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']) {
|
||
| src/etc/phpshellsessions/enablecarp | ||
|---|---|---|
|
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']) {
|
||
| src/etc/rc.initial.setlanip | ||
|---|---|---|
|
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);
|
||
| src/usr/local/www/diag_dns.php | ||
|---|---|---|
|
$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);
|
||
| src/usr/local/www/firewall_aliases.php | ||
|---|---|---|
|
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']));
|
||
| src/usr/local/www/firewall_aliases_edit.php | ||
|---|---|---|
|
$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
|
||
| src/usr/local/www/firewall_aliases_import.php | ||
|---|---|---|
|
$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) {
|
||
| src/usr/local/www/firewall_nat.php | ||
|---|---|---|
|
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'])) {
|
||
| ... | ... | |
|
unset($a_nat[$_POST['id']]);
|
||
|
// Update the separators
|
||
|
$a_separators = &$config['nat']['separator'];
|
||
|
$ridx = $_POST['id'];
|
||
|
$mvnrows = -1;
|
||
|
move_separators($a_separators, $ridx, $mvnrows);
|
||
| ... | ... | |
|
/* delete selected rules */
|
||
|
if (is_array($_POST['rule']) && count($_POST['rule'])) {
|
||
|
$a_separators = &$config['nat']['separator'];
|
||
|
$num_deleted = 0;
|
||
|
foreach ($_POST['rule'] as $rulei) {
|
||
| src/usr/local/www/firewall_nat_edit.php | ||
|---|---|---|
|
$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'];
|
||
| ... | ... | |
|
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);
|
||
| src/usr/local/www/firewall_rules.php | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
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'];
|
||
| ... | ... | |
|
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;
|
||
| ... | ... | |
|
$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;
|
||
| ... | ... | |
|
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 = "";
|
||
| src/usr/local/www/firewall_rules_edit.php | ||
|---|---|---|
|
$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'];
|
||
| ... | ... | |
|
}
|
||
|
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.");
|
||
| ... | ... | |
|
$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;
|
||
| ... | ... | |
|
$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
|
||
| ... | ... | |
|
}
|
||
|
// 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;
|
||
| src/usr/local/www/firewall_virtual_ip.php | ||
|---|---|---|
|
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']) {
|
||
| src/usr/local/www/firewall_virtual_ip_edit.php | ||
|---|---|---|
|
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'])) {
|
||
| src/usr/local/www/interfaces.php | ||
|---|---|---|
|
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'])) {
|
||
| ... | ... | |
|
$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();
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
init_config_arr(array('interfaces', $if));
|
||
|
$wancfg = &$config['interfaces'][$if];
|
||
|
$old_wancfg = $wancfg;
|
||
|
$old_wancfg['realif'] = get_real_interface($if);
|
||
| src/usr/local/www/interfaces_bridge.php | ||
|---|---|---|
|
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;
|
||
| src/usr/local/www/interfaces_bridge_edit.php | ||
|---|---|---|
|
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'] != "") ||
|
||
| ... | ... | |
|
return false;
|
||
|
}
|
||
|
init_config_arr(array('bridges', 'bridged'));
|
||
|
$a_bridges = &$config['bridges']['bridged'];
|
||
|
$ifacelist = get_configured_interface_with_descr();
|
||
| src/usr/local/www/interfaces_gif.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/interfaces_gif_edit.php | ||
|---|---|---|
|
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'];
|
||
| src/usr/local/www/interfaces_gre.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/interfaces_gre_edit.php | ||
|---|---|---|
|
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'];
|
||
| src/usr/local/www/interfaces_groups.php | ||
|---|---|---|
|
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") {
|
||
| src/usr/local/www/interfaces_groups_edit.php | ||
|---|---|---|
|
$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'];
|
||
| src/usr/local/www/interfaces_lagg.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/interfaces_lagg_edit.php | ||
|---|---|---|
|
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();
|
||
| src/usr/local/www/interfaces_ppps_edit.php | ||
|---|---|---|
|
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();
|
||
| ... | ... | |
|
$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);
|
||
| src/usr/local/www/interfaces_vlan.php | ||
|---|---|---|
|
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'])) {
|
||
| src/usr/local/www/interfaces_vlan_edit.php | ||
|---|---|---|
|
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();
|
||
| src/usr/local/www/interfaces_wireless.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/interfaces_wireless_edit.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/load_balancer_monitor.php | ||
|---|---|---|
|
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;
|
||
| src/usr/local/www/load_balancer_monitor_edit.php | ||
|---|---|---|
|
$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'];
|
||
| src/usr/local/www/load_balancer_pool.php | ||
|---|---|---|
|
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;
|
||
| src/usr/local/www/load_balancer_pool_edit.php | ||
|---|---|---|
|
$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'];
|
||
| src/usr/local/www/load_balancer_setting.php | ||
|---|---|---|
|
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) {
|
||
| src/usr/local/www/load_balancer_virtual_server.php | ||
|---|---|---|
|
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;
|
||
| src/usr/local/www/load_balancer_virtual_server_edit.php | ||
|---|---|---|
|
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_virtual_server.php');
|
||
|
}
|
||