From: Steve Sutton Date: Tue, 19 Aug 2014 14:59:49 +0000 (-0400) Subject: Member link in template only if page is on X-Git-Tag: V1.0^2~31 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=3b8abd84b98722158042e3dddbda6c6aaabc59c4;p=web%2FKeweenaw.git 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. --- 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 @@