Generalize pppoe server enabled check and use it elsewhere in the GUI that needed fixed. Still needs changes in filter.inc - Ticket #1243

This commit is contained in:
jim-p 2011-02-10 10:25:32 -05:00
parent 0fc6be3f54
commit 93c2c1e620
5 changed files with 24 additions and 12 deletions

View File

@ -1039,6 +1039,22 @@ function is_dhcp_server_enabled()
return $dhcpdenable;
}
/* Any PPPoE servers enabled? */
function is_pppoe_server_enabled() {
global $config;
$pppoeenable = false;
if (!is_array($config['pppoes']) || !is_array($config['pppoes']['pppoe']))
return false;
foreach ($config['pppoes']['pppoe'] as $pppoes)
if ($pppoes['mode'] == 'server')
$pppoeenable = true;
return $pppoeenable;
}
function convert_seconds_to_hms($sec){
$min=$hrs=0;
if ($sec != 0){

View File

@ -284,9 +284,8 @@ function typesel_change() {
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
if ($config['pppoe']['mode'] == "server")
if(have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))

View File

@ -478,9 +478,8 @@ include("fbegin.inc"); ?>
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
if ($config['pppoe']['mode'] == "server")
if(have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))

View File

@ -410,9 +410,8 @@ function poolopts_change() {
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
if ($config['pppoe']['mode'] == "server")
if(have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))

View File

@ -683,9 +683,8 @@ include("head.inc");
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
if ($config['pppoe']['mode'] == "server")
if(have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
if(have_ruleint_access("enc0"))