mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 02:25:05 +00:00
Cleaner way to show banner for disabled services
This commit is contained in:
parent
5d159b2c89
commit
0a7e86556f
@ -606,10 +606,7 @@ include("head.inc");
|
||||
<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 print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -87,10 +87,7 @@ include("head.inc");
|
||||
<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 print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -63,10 +63,7 @@ include("head.inc");
|
||||
<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 print_service_disabled_banner('firewall'); ?>
|
||||
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
|
||||
|
||||
<section class="col-xs-12">
|
||||
|
||||
@ -114,9 +114,7 @@ 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 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">
|
||||
|
||||
@ -69,6 +69,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
|
||||
|
||||
@ -200,9 +200,7 @@ $( 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 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."));?>
|
||||
|
||||
@ -237,8 +237,7 @@ function print_info_box($msg)
|
||||
EOFnp;
|
||||
}
|
||||
|
||||
function print_warning_box($msg)
|
||||
{
|
||||
function print_warning_box($msg) {
|
||||
echo <<<EOFnp
|
||||
<div class="col-xs-12">
|
||||
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||
@ -248,6 +247,29 @@ function print_warning_box($msg)
|
||||
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. Configured rules are currently not enforced."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_std_save_message() {
|
||||
global $d_sysrebootreqd_path;
|
||||
$filter_related = false;
|
||||
|
||||
@ -65,7 +65,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