From fe019879702fa79a9e78457b708cb91d254c9db3 Mon Sep 17 00:00:00 2001 From: pupi1985 Date: Sun, 2 Feb 2014 00:19:02 -0300 Subject: [PATCH] Denied URL access to disabled pages in the Pages section. --- qa-include/qa-page-activity.php | 6 +++++- qa-include/qa-page-categories.php | 5 +++++ qa-include/qa-page-hot.php | 5 +++++ qa-include/qa-page-questions.php | 5 +++++ qa-include/qa-page-tags.php | 5 +++++ qa-include/qa-page-users.php | 5 +++++ 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/qa-include/qa-page-activity.php b/qa-include/qa-page-activity.php index dc4fd54fc..4bd1240cd 100644 --- a/qa-include/qa-page-activity.php +++ b/qa-include/qa-page-activity.php @@ -28,7 +28,11 @@ header('Location: ../'); exit; } - + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_activity')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-selects.php'; require_once QA_INCLUDE_DIR.'qa-app-format.php'; diff --git a/qa-include/qa-page-categories.php b/qa-include/qa-page-categories.php index 12407b41d..4486b45a7 100644 --- a/qa-include/qa-page-categories.php +++ b/qa-include/qa-page-categories.php @@ -28,6 +28,11 @@ header('Location: ../'); exit; } + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_categories')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-selects.php'; require_once QA_INCLUDE_DIR.'qa-app-format.php'; diff --git a/qa-include/qa-page-hot.php b/qa-include/qa-page-hot.php index 833979ec9..f97840ee3 100644 --- a/qa-include/qa-page-hot.php +++ b/qa-include/qa-page-hot.php @@ -28,6 +28,11 @@ header('Location: ../'); exit; } + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_hot')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-selects.php'; require_once QA_INCLUDE_DIR.'qa-app-q-list.php'; diff --git a/qa-include/qa-page-questions.php b/qa-include/qa-page-questions.php index ae78f79e9..2440d85ac 100644 --- a/qa-include/qa-page-questions.php +++ b/qa-include/qa-page-questions.php @@ -28,6 +28,11 @@ header('Location: ../'); exit; } + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_questions')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-selects.php'; require_once QA_INCLUDE_DIR.'qa-app-format.php'; diff --git a/qa-include/qa-page-tags.php b/qa-include/qa-page-tags.php index 0784b2895..0e78a1a9e 100644 --- a/qa-include/qa-page-tags.php +++ b/qa-include/qa-page-tags.php @@ -28,6 +28,11 @@ header('Location: ../'); exit; } + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_tags')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-selects.php'; require_once QA_INCLUDE_DIR.'qa-app-format.php'; diff --git a/qa-include/qa-page-users.php b/qa-include/qa-page-users.php index f478768c6..663157a0d 100644 --- a/qa-include/qa-page-users.php +++ b/qa-include/qa-page-users.php @@ -28,6 +28,11 @@ header('Location: ../'); exit; } + + // Do not grant access to this section if it has been disabled + if (!qa_opt('nav_users')) { + return include QA_INCLUDE_DIR . 'qa-page-not-found.php'; + } require_once QA_INCLUDE_DIR.'qa-db-users.php'; require_once QA_INCLUDE_DIR.'qa-db-selects.php';