From 9afb95960fcf3c20440d0f3f6ddd3b706dc10449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CSamadhan?= Date: Fri, 10 Nov 2017 15:16:41 +0530 Subject: [PATCH] Issue #6 chore: T&C - User should not redirect back to T&C page after accepting T&C. --- com_tc/administrator/models/content.php | 6 +++--- com_tc/administrator/models/contents.php | 6 +++--- com_tc/site/views/content/view.html.php | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/com_tc/administrator/models/content.php b/com_tc/administrator/models/content.php index 43af67e..8b147d1 100755 --- a/com_tc/administrator/models/content.php +++ b/com_tc/administrator/models/content.php @@ -565,10 +565,10 @@ public function userAcceptedTC($loggedInUserId, $tcId) { if ($loggedInUserId && $tcId) { - $table = $this->getTable('usertcs'); - $table->load(['user_id' => $loggedInUserId, 'tc_id' => $tcId]); + $table = $this->getTable('usertcs'); + $table->load(['user_id' => $loggedInUserId, 'tc_id' => $tcId]); - return $table->tc_id; + return $table->tc_id; } } } diff --git a/com_tc/administrator/models/contents.php b/com_tc/administrator/models/contents.php index e1478e2..7b9c923 100755 --- a/com_tc/administrator/models/contents.php +++ b/com_tc/administrator/models/contents.php @@ -140,17 +140,17 @@ protected function getListQuery() // Join over the users for the checked out user $query->select($db->quoteName(array('uc.name'), ('editor'))); $query->join("LEFT", $db->quoteName('#__users', 'uc') . 'ON (' . $db->quoteName('uc.id') . ' = ' . - $db->quoteName('a.checked_out') . ')'); + $db->quoteName('a.checked_out') . ')'); // Join over the user field 'created_by' $query->select('`created_by`.name AS `created_by`'); $query->join("LEFT", $db->quoteName('#__users', 'created_by') . 'ON (' . $db->quoteName('created_by.id') . ' = ' . - $db->quoteName('a.created_by') . ')'); + $db->quoteName('a.created_by') . ')'); // Join over the user field 'modified_by' $query->select('`modified_by`.name AS `modified_by`'); $query->join("LEFT", $db->quoteName('#__users', 'modified_by') . 'ON (' . $db->quoteName('modified_by.id') . ' = ' . - $db->quoteName('a.modified_by') . ')'); + $db->quoteName('a.modified_by') . ')'); // Filter by published state $published = $this->getState('filter.state'); diff --git a/com_tc/site/views/content/view.html.php b/com_tc/site/views/content/view.html.php index b65a783..a20a99d 100755 --- a/com_tc/site/views/content/view.html.php +++ b/com_tc/site/views/content/view.html.php @@ -48,17 +48,17 @@ public function display($tpl = null) if (empty($userAcceptedTC)) { - $this->layout = $input->get('layout', 'default', 'STRING'); + $this->layout = $input->get('layout', 'default', 'STRING'); - if (!$this->user_id && $this->layout != 'terms') - { - $app->redirect(JRoute::_(JURI::base())); + if (!$this->user_id && $this->layout != 'terms') + { + $app->redirect(JRoute::_(JURI::base())); - return false; - } + return false; + } - $this->termsandconditions = $model->getItem($this->tc_id); - parent::display($tpl); + $this->termsandconditions = $model->getItem($this->tc_id); + parent::display($tpl); } else {