From c6b6638705d9da107d1cfd9388f82cda090fa5d2 Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Fri, 20 Oct 2017 20:29:10 +0200 Subject: [PATCH] * fixed viewing thread without being logged * removed unused and wrong function OTS_Account::getLastLogin() (field lastday is used for premium) --- system/libs/pot/OTS_Account.php | 10 ---------- system/pages/forum/show_thread.php | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index e578344c..b1026a71 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -341,16 +341,6 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable //return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])); } - public function getLastLogin() - { - if( !isset($this->data['lastday']) ) - { - throw new E_OTS_NotLoaded(); - } - - return $this->data['lastday']; - } - public function isPremium() { global $config; diff --git a/system/pages/forum/show_thread.php b/system/pages/forum/show_thread.php index 7c5909d3..303ca93f 100644 --- a/system/pages/forum/show_thread.php +++ b/system/pages/forum/show_thread.php @@ -21,7 +21,7 @@ if(empty($thread_name['name'])) { return; } -if(Forum::hasAccess($thread_name['section'])) { +if(!Forum::hasAccess($thread_name['section'])) { echo "You don't have access to view this thread."; return; }