Skip to content

Commit

Permalink
Bug #29 fix: It asks user to accept T&C right now which is created fo…
Browse files Browse the repository at this point in the history
…r current date and future time. (#31)

* Bug #157863 fix: It asks user to accept T&C right now which is created for current date and future time.

* Bug #157863 fix: It asks user to accept T&C right now which is created for current date and future time.
  • Loading branch information
paritshivani authored Feb 20, 2020
1 parent fc6b1eb commit 38adaed
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/com_tc/administrator/models/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,14 @@ public function checkDuplicateAndLatestVersionTC($tcVersion,$tcClient)
*/
public function getMatchingTCs($option, $view)
{
$today = JHtml::date('now', 'Y-m-d H:i:s', true);

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('p.tc_id, c.version, c.client');
$query->from($db->quoteName('#__tc_patterns', 'p'));
$query->join('LEFT', $db->quoteName('#__tc_content', 'c') . ' ON (' . $db->quoteName('c.tc_id') . ' = ' . $db->quoteName('p.tc_id') . ')');
$query->where($db->quoteName('p.option') . " = " . $db->quote($option));
$query->where($db->quoteName('p.view') . " = " . $db->quote($view));
$query->where($db->quoteName('c.start_date') . " <= " . $db->quote($today));
$query->where($db->quoteName('c.start_date') . " <= UTC_TIMESTAMP()");
$query->where($db->quoteName('c.state') . " = " . $db->quote(1));

// Order in ascending, so get latest version of T&C
Expand Down Expand Up @@ -472,15 +470,13 @@ public function checkUserGroupAccess($tcUserGroup,$isBlacklist)
*/
public function getGlobalTCIdList()
{
$today = JHtml::date('now', 'Y-m-d H:i:s', true);

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('p.tc_id, c.version, c.client');
$query->from($db->quoteName('#__tc_patterns', 'p'));
$query->join('LEFT', $db->quoteName('#__tc_content', 'c') . ' ON (' . $db->quoteName('c.tc_id') . ' = ' . $db->quoteName('p.tc_id') . ')');
$query->where($db->quoteName('c.global') . " = " . $db->quote(1));
$query->where($db->quoteName('c.start_date') . " <= " . $db->quote($today));
$query->where($db->quoteName('c.start_date') . " <= UTC_TIMESTAMP()");
$query->where($db->quoteName('c.state') . " = " . $db->quote(1));

// Order in ascending, so get latest version of T&C
Expand Down

0 comments on commit 38adaed

Please sign in to comment.