Commit 168de680 authored by Franco Fichtner's avatar Franco Fichtner

Merge pull request #506 from 8191/no_firewall_warn

firewall: show warning banner if firewall disabled
parents f871fc40 ba1c4879
...@@ -603,6 +603,7 @@ include("head.inc"); ...@@ -603,6 +603,7 @@ include("head.inc");
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
...@@ -85,6 +85,7 @@ include("head.inc"); ...@@ -85,6 +85,7 @@ include("head.inc");
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
...@@ -61,6 +61,7 @@ include("head.inc"); ...@@ -61,6 +61,7 @@ include("head.inc");
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
...@@ -111,6 +111,7 @@ include("head.inc"); ?> ...@@ -111,6 +111,7 @@ include("head.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
......
...@@ -70,6 +70,7 @@ $( document ).ready(function() { ...@@ -70,6 +70,7 @@ $( document ).ready(function() {
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid col-xs-12"> <div class="container-fluid col-xs-12">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs"> <ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<?php <?php
......
...@@ -226,6 +226,9 @@ $( document ).ready(function() { ...@@ -226,6 +226,9 @@ $( document ).ready(function() {
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($config['system']['disablefilter'])): ?>
<?php print_warning_box(gettext("The firewall has globally been disabled. Configured rules are currently not enforced."));?>
<?php endif; ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?> <?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('natconf')): ?> <?php if (is_subsystem_dirty('natconf')): ?>
<?php print_info_box_apply(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /> <?php print_info_box_apply(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
......
...@@ -176,6 +176,9 @@ $main_buttons = array( ...@@ -176,6 +176,9 @@ $main_buttons = array(
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($config['system']['disablefilter'])): ?>
<?php print_warning_box(gettext("The firewall has globally been disabled. Configured rules are currently not enforced."));?>
<?php endif; ?>
<?php <?php
if (isset($savemsg)) if (isset($savemsg))
print_info_box($savemsg); print_info_box($savemsg);
......
...@@ -177,6 +177,9 @@ $main_buttons = array( ...@@ -177,6 +177,9 @@ $main_buttons = array(
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($config['system']['disablefilter'])): ?>
<?php print_warning_box(gettext("The firewall has globally been disabled. Configured rules are currently not enforced."));?>
<?php endif; ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?> <?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('natconf')): ?> <?php if (is_subsystem_dirty('natconf')): ?>
<?php print_info_box_apply(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /> <?php print_info_box_apply(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
......
...@@ -247,6 +247,9 @@ include("head.inc"); ...@@ -247,6 +247,9 @@ include("head.inc");
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($config['system']['disablefilter'])): ?>
<?php print_warning_box(gettext("The firewall has globally been disabled. Configured rules are currently not enforced."));?>
<?php endif; ?>
<?php <?php
if (isset($savemsg)) if (isset($savemsg))
print_info_box($savemsg); print_info_box($savemsg);
......
...@@ -199,6 +199,7 @@ $( document ).ready(function() { ...@@ -199,6 +199,7 @@ $( document ).ready(function() {
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?> <?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('filter')): ?><p> <?php if (is_subsystem_dirty('filter')): ?><p>
<?php print_info_box_apply(gettext("The firewall rule configuration has been changed.<br />You must apply the changes in order for them to take effect."));?> <?php print_info_box_apply(gettext("The firewall rule configuration has been changed.<br />You must apply the changes in order for them to take effect."));?>
......
...@@ -239,6 +239,42 @@ function print_info_box($msg) ...@@ -239,6 +239,42 @@ function print_info_box($msg)
EOFnp; EOFnp;
} }
function print_warning_box($msg) {
echo <<<EOFnp
<div class="col-xs-12">
<div class="alert alert-warning alert-dismissible" role="alert">
<p>{$msg}</p>
</div>
</div>
EOFnp;
}
function is_service_enabled($service) {
global $config;
switch ($service) {
case 'firewall':
case 'filter':
return !isset($config['system']['disablefilter']);
default:
return false;
}
}
function print_service_disabled_banner($service) {
if (!is_service_enabled($service)) {
switch ($service) {
case 'firewall':
case 'filter':
print_warning_box(gettext(
"The firewall has globally been disabled and configured rules are currently not enforced. " .
"It can be enabled in the <a href=\"system_advanced_firewall.php\">Firewall and NAT settings</a> page."
));
break;
}
}
}
function get_std_save_message() { function get_std_save_message() {
global $d_sysrebootreqd_path; global $d_sysrebootreqd_path;
$filter_related = false; $filter_related = false;
......
...@@ -62,7 +62,7 @@ include("head.inc"); ...@@ -62,7 +62,7 @@ include("head.inc");
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php print_service_disabled_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment