Skip to content

Commit 38adaed

Browse files
authored
Bug #29 fix: It asks user to accept T&C right now which is created for 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.
1 parent fc6b1eb commit 38adaed

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/com_tc/administrator/models/content.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,14 @@ public function checkDuplicateAndLatestVersionTC($tcVersion,$tcClient)
285285
*/
286286
public function getMatchingTCs($option, $view)
287287
{
288-
$today = JHtml::date('now', 'Y-m-d H:i:s', true);
289-
290288
$db = JFactory::getDbo();
291289
$query = $db->getQuery(true);
292290
$query->select('p.tc_id, c.version, c.client');
293291
$query->from($db->quoteName('#__tc_patterns', 'p'));
294292
$query->join('LEFT', $db->quoteName('#__tc_content', 'c') . ' ON (' . $db->quoteName('c.tc_id') . ' = ' . $db->quoteName('p.tc_id') . ')');
295293
$query->where($db->quoteName('p.option') . " = " . $db->quote($option));
296294
$query->where($db->quoteName('p.view') . " = " . $db->quote($view));
297-
$query->where($db->quoteName('c.start_date') . " <= " . $db->quote($today));
295+
$query->where($db->quoteName('c.start_date') . " <= UTC_TIMESTAMP()");
298296
$query->where($db->quoteName('c.state') . " = " . $db->quote(1));
299297

300298
// Order in ascending, so get latest version of T&C
@@ -472,15 +470,13 @@ public function checkUserGroupAccess($tcUserGroup,$isBlacklist)
472470
*/
473471
public function getGlobalTCIdList()
474472
{
475-
$today = JHtml::date('now', 'Y-m-d H:i:s', true);
476-
477473
$db = JFactory::getDbo();
478474
$query = $db->getQuery(true);
479475
$query->select('p.tc_id, c.version, c.client');
480476
$query->from($db->quoteName('#__tc_patterns', 'p'));
481477
$query->join('LEFT', $db->quoteName('#__tc_content', 'c') . ' ON (' . $db->quoteName('c.tc_id') . ' = ' . $db->quoteName('p.tc_id') . ')');
482478
$query->where($db->quoteName('c.global') . " = " . $db->quote(1));
483-
$query->where($db->quoteName('c.start_date') . " <= " . $db->quote($today));
479+
$query->where($db->quoteName('c.start_date') . " <= UTC_TIMESTAMP()");
484480
$query->where($db->quoteName('c.state') . " = " . $db->quote(1));
485481

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

0 commit comments

Comments
 (0)