Skip to content

Commit

Permalink
Issue #6 chore: T&C - User should not redirect back to T&C page after…
Browse files Browse the repository at this point in the history
… accepting T&C.
  • Loading branch information
samadhansalunkhe committed Nov 10, 2017
1 parent e8bbe82 commit 9afb959
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions com_tc/administrator/models/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
6 changes: 3 additions & 3 deletions com_tc/administrator/models/contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
16 changes: 8 additions & 8 deletions com_tc/site/views/content/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 9afb959

Please sign in to comment.