mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
Merge pull request #506 from 8191/no_firewall_warn
firewall: show warning banner if firewall disabled
This commit is contained in:
commit
168de68091
@ -603,6 +603,7 @@ include("head.inc");
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -85,6 +85,7 @@ include("head.inc");
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -61,6 +61,7 @@ include("head.inc");
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -111,6 +111,7 @@ include("head.inc"); ?>
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
<section class="col-xs-12">
|
||||
<div class="tab-content content-box col-xs-12">
|
||||
|
||||
@ -70,6 +70,7 @@ $( document ).ready(function() {
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid col-xs-12">
|
||||
<div class="row">
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<section class="col-xs-12">
|
||||
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
|
||||
<?php
|
||||
|
||||
@ -226,6 +226,9 @@ $( document ).ready(function() {
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<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 (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 />
|
||||
|
||||
@ -176,6 +176,9 @@ $main_buttons = array(
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<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);
|
||||
|
||||
@ -177,6 +177,9 @@ $main_buttons = array(
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<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 (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 />
|
||||
|
||||
@ -247,6 +247,9 @@ include("head.inc");
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<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);
|
||||
|
||||
@ -199,6 +199,7 @@ $( document ).ready(function() {
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
|
||||
<?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."));?>
|
||||
|
||||
@ -239,6 +239,42 @@ function print_info_box($msg)
|
||||
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() {
|
||||
global $d_sysrebootreqd_path;
|
||||
$filter_related = false;
|
||||
|
||||
@ -62,7 +62,7 @@ include("head.inc");
|
||||
<section class="page-content-main">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<?php print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user