From 3b8abd84b98722158042e3dddbda6c6aaabc59c4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 19 Aug 2014 10:59:49 -0400 Subject: [PATCH] Member link in template only if page is on Setup template so the members link in footer only appears if the member login page is active. --- Toolkit/Page.php | 11 +++++++++++ templates/template.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Toolkit/Page.php b/Toolkit/Page.php index ef6437c..6c54853 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -441,6 +441,17 @@ class Toolkit_Page ) { header('Location: ' . $this->getToolboxUrl(MEMBERS_CATEGORY)); } + if (filter_var(MEMBERS_CATEGORY, FILTER_VALIDATE_INT)) { + $dbh = Toolkit_Database::getInstance(); + $sql = " + SELECT active + FROM toolbox.pages + WHERE id = " . MEMBERS_CATEGORY; + $this->hasMembersOnly = (bool)$dbh->query($sql)->fetchColumn(); + } + + } else { + $this->hasMembersOnly = false; } $this->pageTitle = $this->_getPageTitle($this->_catid); diff --git a/templates/template.html b/templates/template.html index 0755f07..4554fb5 100644 --- a/templates/template.html +++ b/templates/template.html @@ -203,7 +203,7 @@ -- 2.17.1