mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
php 7.1 style fixes for https://github.com/opnsense/core/issues/1733
This commit is contained in:
@@ -33,10 +33,7 @@ require_once("services.inc");
|
||||
require_once("system.inc");
|
||||
require_once("plugins.inc.d/dyndns.inc");
|
||||
|
||||
if (empty($config['dyndnses']['dyndns']) || !isset($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
$a_dyndns = &config_read_array('dyndnses', 'dyndns');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['act']) && $_POST['act'] == "del" && isset($_POST['id'])) {
|
||||
|
||||
@@ -45,10 +45,7 @@ function is_dyndns_username($uname)
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
$a_dyndns = &config_read_array('dyndnses', 'dyndns');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['id']) && !empty($a_dyndns[$_GET['id']])) {
|
||||
|
||||
@@ -34,11 +34,7 @@ require_once("services.inc");
|
||||
require_once("interfaces.inc");
|
||||
require_once("plugins.inc.d/dyndns.inc");
|
||||
|
||||
if (!isset($config['dyndnses']['dyndns'])) {
|
||||
$config['dyndnses']['dyndns'] = array();
|
||||
}
|
||||
|
||||
$a_dyndns = &$config['dyndnses']['dyndns'];
|
||||
$a_dyndns = &config_read_array('dyndnses', 'dyndns');
|
||||
|
||||
if (!empty($_REQUEST['getdyndnsstatus'])) {
|
||||
$first_entry = true;
|
||||
|
||||
@@ -33,11 +33,7 @@ require_once("services.inc");
|
||||
require_once("system.inc");
|
||||
require_once("plugins.inc.d/rfc2136.inc");
|
||||
|
||||
if (!isset($config['dnsupdates']['dnsupdate'])) {
|
||||
$config['dnsupdates']['dnsupdate'] = array();
|
||||
}
|
||||
|
||||
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
|
||||
$a_rfc2136 = &config_read_array('dnsupdates', 'dnsupdate');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['act']) && $_POST['act'] == "del" && isset($_POST['id'])) {
|
||||
|
||||
@@ -33,10 +33,7 @@ require_once("system.inc");
|
||||
require_once("interfaces.inc");
|
||||
require_once("plugins.inc.d/rfc2136.inc");
|
||||
|
||||
if (!isset($config['dnsupdates']['dnsupdate'])) {
|
||||
$config['dnsupdates']['dnsupdate'] = array();
|
||||
}
|
||||
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
|
||||
$a_rfc2136 = &config_read_array('dnsupdates', 'dnsupdate');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['id']) && !empty($a_rfc2136[$_GET['id']])) {
|
||||
|
||||
@@ -35,11 +35,7 @@ require_once("services.inc");
|
||||
require_once("interfaces.inc");
|
||||
require_once("plugins.inc.d/rfc2136.inc");
|
||||
|
||||
if (!isset($config['dnsupdates']['dnsupdate'])) {
|
||||
$config['dnsupdates']['dnsupdate'] = array();
|
||||
}
|
||||
|
||||
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
|
||||
$a_rfc2136 = &config_read_array('dnsupdates', 'dnsupdate');
|
||||
|
||||
if (!empty($_REQUEST['getrfc2136status'])) {
|
||||
$first_entry = true;
|
||||
|
||||
@@ -34,10 +34,7 @@ require_once("interfaces.inc");
|
||||
require_once("services.inc");
|
||||
require_once('plugins.inc.d/igmpproxy.inc');
|
||||
|
||||
$a_igmpproxy = array();
|
||||
if (isset($config['igmpproxy']['igmpentry'])) {
|
||||
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
||||
}
|
||||
$a_igmpproxy = &config_read_array('igmpproxy', 'igmpentry');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['act']) && $_POST['act'] == "del") {
|
||||
|
||||
@@ -33,10 +33,7 @@ require_once("guiconfig.inc");
|
||||
require_once("services.inc");
|
||||
require_once('plugins.inc.d/igmpproxy.inc');
|
||||
|
||||
if (!isset($config['igmpproxy']['igmpentry'])) {
|
||||
$config['igmpproxy']['igmpentry'] = array();
|
||||
}
|
||||
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
||||
$a_igmpproxy = &config_read_array('igmpproxy', 'igmpentry');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['id']) && !empty($a_igmpproxy[$_GET['id']])) {
|
||||
|
||||
@@ -33,10 +33,10 @@ require_once("services.inc");
|
||||
require_once("system.inc");
|
||||
require_once("plugins.inc.d/if_l2tp.inc");
|
||||
|
||||
$l2tpcfg = &config_read_array('l2tp');
|
||||
if (!isset($config['l2tp']['radius']) || !is_array($config['l2tp']['radius'])) {
|
||||
$config['l2tp']['radius'] = array();
|
||||
}
|
||||
$l2tpcfg = &$config['l2tp'];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$pconfig['remoteip'] = $l2tpcfg['remoteip'];
|
||||
|
||||
@@ -32,10 +32,7 @@ require_once("services.inc");
|
||||
require_once("system.inc");
|
||||
require_once("plugins.inc.d/if_l2tp.inc");
|
||||
|
||||
if (!isset($config['l2tp']['user'])) {
|
||||
$config['l2tp']['user'] = array();
|
||||
}
|
||||
$a_secret = &$config['l2tp']['user'];
|
||||
$a_secret = &config_read_array('l2tp', 'user');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// delete entry
|
||||
|
||||
@@ -48,10 +48,7 @@ require_once("services.inc");
|
||||
require_once("system.inc");
|
||||
require_once("plugins.inc.d/if_l2tp.inc");
|
||||
|
||||
if (empty($config['l2tp']['user']) || !is_array($config['l2tp']['user'])) {
|
||||
$config['l2tp']['user'] = array();
|
||||
}
|
||||
$a_secret = &$config['l2tp']['user'];
|
||||
$a_secret = &config_read_array('l2tp', 'user');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['id']) && !empty($a_secret[$_GET['id']])) {
|
||||
|
||||
@@ -32,11 +32,7 @@ require_once("filter.inc");
|
||||
require_once("plugins.inc.d/if_pppoe.inc");
|
||||
require_once("interfaces.inc");
|
||||
|
||||
if (empty($config['pppoes']['pppoe']) || !is_array($config['pppoes']['pppoe'])) {
|
||||
$config['pppoes'] = array();
|
||||
$config['pppoes']['pppoe'] = array();
|
||||
}
|
||||
$a_pppoes = &$config['pppoes']['pppoe'];
|
||||
$a_pppoes = &config_read_array('pppoes', 'pppoe');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!empty($_POST['apply'])) {
|
||||
|
||||
@@ -50,11 +50,7 @@ function vpn_pppoe_get_id()
|
||||
return $vpnid;
|
||||
}
|
||||
|
||||
if (empty($config['pppoes']['pppoe']) || !is_array($config['pppoes']['pppoe'])) {
|
||||
$config['pppoes'] = array();
|
||||
$config['pppoes']['pppoe'] = array();
|
||||
}
|
||||
$a_pppoes = &$config['pppoes']['pppoe'];
|
||||
$a_pppoes = &config_read_array('pppoes', 'pppoe');
|
||||
|
||||
$copy_fields = array('remoteip', 'localip', 'mode', 'interface', 'n_pppoe_units', 'pppoe_subnet', 'dns1', 'dns2', 'descr', 'pppoeid');
|
||||
|
||||
|
||||
@@ -34,10 +34,7 @@ require_once('services.inc');
|
||||
require_once("system.inc");
|
||||
require_once('plugins.inc.d/if_pptp.inc');
|
||||
|
||||
if (!is_array($config['pptpd']['radius'])) {
|
||||
$config['pptpd']['radius'] = array();
|
||||
}
|
||||
$pptpcfg = &$config['pptpd'];
|
||||
$pptpcfg = &config_read_array('pptpd');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$pconfig['remoteip'] = $pptpcfg['remoteip'];
|
||||
|
||||
@@ -32,10 +32,7 @@ require_once('services.inc');
|
||||
require_once("system.inc");
|
||||
require_once('plugins.inc.d/if_pptp.inc');
|
||||
|
||||
if (!is_array($config['pptpd']['user'])) {
|
||||
$config['pptpd']['user'] = array();
|
||||
}
|
||||
$a_secret = &$config['pptpd']['user'];
|
||||
$a_secret = &config_read_array('pptpd', 'user');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// delete entry
|
||||
|
||||
@@ -48,10 +48,7 @@ require_once('services.inc');
|
||||
require_once("system.inc");
|
||||
require_once('plugins.inc.d/if_pptp.inc');
|
||||
|
||||
if (!is_array($config['pptpd']['user'])) {
|
||||
$config['pptpd']['user'] = array();
|
||||
}
|
||||
$a_secret = &$config['pptpd']['user'];
|
||||
$a_secret = &config_read_array('pptpd', 'user');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['id']) && !empty($a_secret[$_GET['id']])) {
|
||||
|
||||
@@ -33,10 +33,7 @@ require_once("services.inc");
|
||||
require_once("plugins.inc.d/relayd.inc");
|
||||
require_once("interfaces.inc");
|
||||
|
||||
if (empty($config['load_balancer']['monitor_type']) || !is_array($config['load_balancer']['monitor_type'])) {
|
||||
$config['load_balancer']['monitor_type'] = array();
|
||||
}
|
||||
$a_monitor = &$config['load_balancer']['monitor_type'];
|
||||
$a_monitor = &config_read_array('load_balancer', 'monitor_type');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['act']) && $_POST['act'] == "del") {
|
||||
|
||||
@@ -75,10 +75,7 @@ $rfc2616 = array(
|
||||
505 => "505 HTTP Version Not Supported"
|
||||
);
|
||||
|
||||
if (empty($config['load_balancer']['monitor_type']) || !is_array($config['load_balancer']['monitor_type'])) {
|
||||
$config['load_balancer']['monitor_type'] = array();
|
||||
}
|
||||
$a_monitor = &$config['load_balancer']['monitor_type'];
|
||||
$a_monitor = &config_read_array('load_balancer', 'monitor_type');
|
||||
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
|
||||
@@ -33,10 +33,7 @@ require_once("services.inc");
|
||||
require_once("plugins.inc.d/relayd.inc");
|
||||
require_once("interfaces.inc");
|
||||
|
||||
if (empty($config['load_balancer']['lbpool']) || !is_array($config['load_balancer']['lbpool'])) {
|
||||
$config['load_balancer']['lbpool'] = array();
|
||||
}
|
||||
$a_pool = &$config['load_balancer']['lbpool'];
|
||||
$a_pool = &config_read_array('load_balancer', 'lbpool');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['act']) && $_POST['act'] == "del") {
|
||||
|
||||
@@ -32,10 +32,7 @@ require_once("services.inc");
|
||||
require_once("interfaces.inc");
|
||||
|
||||
|
||||
if (empty($config['load_balancer']['lbpool']) || !is_array($config['load_balancer']['lbpool'])) {
|
||||
$config['load_balancer']['lbpool'] = array();
|
||||
}
|
||||
$a_pool = &$config['load_balancer']['lbpool'];
|
||||
$a_pool = &config_read_array('load_balancer', 'lbpool');
|
||||
|
||||
|
||||
$copy_fields = array('name', 'mode', 'descr', 'port', 'retry', 'monitor', 'servers', 'serversdisabled');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user