If a customer's page is hidden from menu via settings, redirect the user if he tries to access the page

This commit is contained in:
Michael Wyraz
2016-07-27 13:45:54 +02:00
parent e5c649aba3
commit e3587fb346
8 changed files with 69 additions and 0 deletions

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','domains')) {
redirectTo('customer_index.php');
exit;
}
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) { } elseif (isset($_GET['id'])) {

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','email')) {
redirectTo('customer_index.php');
exit;
}
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) { } elseif (isset($_GET['id'])) {

View File

@@ -19,6 +19,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','extras')) {
redirectTo('customer_index.php');
exit;
}
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) { } elseif (isset($_GET['id'])) {
@@ -29,6 +35,13 @@ if ($page == 'overview') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras"); $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras");
eval("echo \"" . getTemplate("extras/extras") . "\";"); eval("echo \"" . getTemplate("extras/extras") . "\";");
} elseif ($page == 'htpasswds') { } elseif ($page == 'htpasswds') {
// redirect if this customer sub-page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','extras.directoryprotection')) {
redirectTo('customer_index.php');
exit;
}
if ($action == '') { if ($action == '') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htpasswds"); $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htpasswds");
$fields = array( $fields = array(
@@ -262,6 +275,13 @@ if ($page == 'overview') {
} }
} }
} elseif ($page == 'htaccess') { } elseif ($page == 'htaccess') {
// redirect if this customer sub-page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','extras.pathoptions')) {
redirectTo('customer_index.php');
exit;
}
if ($action == '') { if ($action == '') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess"); $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
$fields = array( $fields = array(
@@ -520,6 +540,12 @@ if ($page == 'overview') {
} }
} elseif ($page == 'backup') { } elseif ($page == 'backup') {
// redirect if this customer sub-page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','extras.backup')) {
redirectTo('customer_index.php');
exit;
}
if (Settings::Get('system.backupenabled') == 1) if (Settings::Get('system.backupenabled') == 1)
{ {
if ($action == 'abort' && isset($_POST['send']) && $_POST['send'] == 'send') { if ($action == 'abort' && isset($_POST['send']) && $_POST['send'] == 'send') {

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','ftp')) {
redirectTo('customer_index.php');
exit;
}
$id = 0; $id = 0;
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','extras.logger')) {
redirectTo('customer_index.php');
exit;
}
if ($page == 'log' if ($page == 'log'
) { ) {
if ($action == '') { if ($action == '') {

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','mysql')) {
redirectTo('customer_index.php');
exit;
}
// get sql-root access data // get sql-root access data
Database::needRoot(true); Database::needRoot(true);
Database::needSqlData(); Database::needSqlData();

View File

@@ -20,6 +20,12 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','domains')) {
redirectTo('customer_index.php');
exit;
}
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);

View File

@@ -20,6 +20,13 @@
define('AREA', 'customer'); define('AREA', 'customer');
$intrafficpage = 1; $intrafficpage = 1;
require './lib/init.php'; require './lib/init.php';
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','traffic')) {
redirectTo('customer_index.php');
exit;
}
$traffic = ''; $traffic = '';
$month = null; $month = null;
$year = null; $year = null;