mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Function comment block stubs
This commit is contained in:
parent
99577938f6
commit
307256d96e
@ -6,6 +6,12 @@ require_once 'includes/functions.php';
|
|||||||
define('RASPAP_IPTABLES_SCRIPT', "/tmp/iptables_raspap.sh");
|
define('RASPAP_IPTABLES_SCRIPT', "/tmp/iptables_raspap.sh");
|
||||||
define('RASPAP_IP6TABLES_SCRIPT', "/tmp/ip6tables_raspap.sh");
|
define('RASPAP_IP6TABLES_SCRIPT', "/tmp/ip6tables_raspap.sh");
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $rule
|
||||||
|
* @param string $conf
|
||||||
|
* @return string $don
|
||||||
|
*/
|
||||||
function getDependson(&$rule, &$conf)
|
function getDependson(&$rule, &$conf)
|
||||||
{
|
{
|
||||||
if (isset($rule["dependson"][0]) ) {
|
if (isset($rule["dependson"][0]) ) {
|
||||||
@ -19,6 +25,12 @@ function getDependson(&$rule, &$conf)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $sect
|
||||||
|
* @param string $conf
|
||||||
|
* @return string $active
|
||||||
|
*/
|
||||||
function isRuleEnabled(&$sect, &$conf)
|
function isRuleEnabled(&$sect, &$conf)
|
||||||
{
|
{
|
||||||
$fw_on = isset($conf["firewall-enable"]) && $conf["firewall-enable"];
|
$fw_on = isset($conf["firewall-enable"]) && $conf["firewall-enable"];
|
||||||
@ -32,6 +44,12 @@ function isRuleEnabled(&$sect, &$conf)
|
|||||||
return $active;
|
return $active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $sect
|
||||||
|
* @param string $conf
|
||||||
|
* @return string $str
|
||||||
|
*/
|
||||||
function createRuleStr(&$sect, &$conf)
|
function createRuleStr(&$sect, &$conf)
|
||||||
{
|
{
|
||||||
if (!is_array($sect["rules"]) ) { return "";
|
if (!is_array($sect["rules"]) ) { return "";
|
||||||
@ -84,16 +102,31 @@ function createRuleStr(&$sect, &$conf)
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $rule
|
||||||
|
* @return string boolean
|
||||||
|
*/
|
||||||
function isIPv4(&$rule)
|
function isIPv4(&$rule)
|
||||||
{
|
{
|
||||||
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "4") !== false;
|
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "4") !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $rule
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
function isIPv6(&$rule)
|
function isIPv6(&$rule)
|
||||||
{
|
{
|
||||||
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "6") !== false;
|
return !isset($rule["ip-version"]) || strstr($rule["ip-version"], "6") !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return string $count
|
||||||
|
*/
|
||||||
function configureFirewall()
|
function configureFirewall()
|
||||||
{
|
{
|
||||||
$json = file_get_contents(RASPAP_IPTABLES_CONF);
|
$json = file_get_contents(RASPAP_IPTABLES_CONF);
|
||||||
@ -141,6 +174,11 @@ function configureFirewall()
|
|||||||
return ($count > 0);
|
return ($count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $conf
|
||||||
|
* @return string $ret
|
||||||
|
*/
|
||||||
function WriteFirewallConf($conf)
|
function WriteFirewallConf($conf)
|
||||||
{
|
{
|
||||||
$ret = false;
|
$ret = false;
|
||||||
@ -149,7 +187,10 @@ function WriteFirewallConf($conf)
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return string $conf
|
||||||
|
*/
|
||||||
function ReadFirewallConf()
|
function ReadFirewallConf()
|
||||||
{
|
{
|
||||||
if (file_exists(RASPAP_FIREWALL_CONF) ) {
|
if (file_exists(RASPAP_FIREWALL_CONF) ) {
|
||||||
@ -173,6 +214,10 @@ function ReadFirewallConf()
|
|||||||
return $conf;
|
return $conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return string $ips
|
||||||
|
*/
|
||||||
function getVPN_IPs()
|
function getVPN_IPs()
|
||||||
{
|
{
|
||||||
$ips = "";
|
$ips = "";
|
||||||
@ -213,7 +258,9 @@ function getVPN_IPs()
|
|||||||
return trim($ips);
|
return trim($ips);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function DisplayFirewallConfig()
|
function DisplayFirewallConfig()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -292,3 +339,4 @@ function DisplayFirewallConfig()
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user