Skip to content

Commit

Permalink
Merge branch '4.9' into 4.10
Browse files Browse the repository at this point in the history
# Conflicts:
#	calendar-bundle/src/Resources/contao/models/CalendarEventsModel.php
#	calendar-bundle/src/Resources/contao/modules/ModuleCalendar.php
#	core-bundle/src/Resources/contao/classes/Crawl.php
#	core-bundle/src/Resources/contao/classes/Messages.php
#	core-bundle/src/Resources/contao/dca/tl_article.php
#	core-bundle/src/Resources/contao/dca/tl_member.php
#	core-bundle/src/Resources/contao/dca/tl_member_group.php
#	core-bundle/src/Resources/contao/dca/tl_user.php
#	core-bundle/src/Resources/contao/dca/tl_user_group.php
#	core-bundle/src/Resources/contao/library/Contao/Search.php
#	core-bundle/src/Resources/contao/models/ArticleModel.php
#	core-bundle/src/Resources/contao/models/ContentModel.php
#	core-bundle/src/Resources/contao/models/MemberModel.php
#	core-bundle/src/Resources/contao/models/PageModel.php
#	core-bundle/src/Routing/RouteProvider.php
#	core-bundle/tests/Functional/RoutingTest.php
#	news-bundle/src/Resources/contao/models/NewsModel.php
#	news-bundle/src/Resources/contao/modules/ModuleNewsMenu.php
  • Loading branch information
leofeyer committed Sep 8, 2020
2 parents 511554c + de1d4b9 commit 989d898
Show file tree
Hide file tree
Showing 36 changed files with 94 additions and 103 deletions.
4 changes: 2 additions & 2 deletions calendar-bundle/src/Resources/contao/classes/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public function getSearchablePages($arrPages, $intRoot=0, $blnIsSitemap=false)
}

$arrProcessed = array();
$time = Date::floorToMinute();
$time = time();

// Get all calendars
$objCalendar = CalendarModel::findByProtected('');
Expand Down Expand Up @@ -353,7 +353,7 @@ public function getSearchablePages($arrPages, $intRoot=0, $blnIsSitemap=false)
}

// The target page has not been published (see #5520)
if (!$objParent->published || ($objParent->start != '' && $objParent->start > $time) || ($objParent->stop != '' && $objParent->stop <= ($time + 60)))
if (!$objParent->published || ($objParent->start != '' && $objParent->start > $time) || ($objParent->stop != '' && $objParent->stop <= $time))
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static function findPublishedByParentAndIdOrAlias($varId, $arrPids, array
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

return static::findOneBy($arrColumns, $varId, $arrOptions);
Expand Down Expand Up @@ -271,7 +271,7 @@ public static function findCurrentByPid($intPid, $intStart, $intEnd, array $arrO
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand All @@ -298,7 +298,7 @@ public static function findPublishedDefaultByPid($intPid, array $arrOptions=arra
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand Down Expand Up @@ -329,7 +329,7 @@ public static function findUpcomingByPids($arrIds, $intLimit=0, array $arrOption
$time = Date::floorToMinute();

// Get upcoming events using endTime instead of startTime (see #3917)
$arrColumns = array("$t.pid IN(" . implode(',', array_map('\intval', $arrIds)) . ") AND $t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND ($t.endTime>=$time OR ($t.recurring='1' AND ($t.recurrences=0 OR $t.repeatEnd>=$time)))");
$arrColumns = array("$t.pid IN(" . implode(',', array_map('\intval', $arrIds)) . ") AND $t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time') AND ($t.endTime>=$time OR ($t.recurring='1' AND ($t.recurrences=0 OR $t.repeatEnd>=$time)))");

if ($intLimit > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function compile()
$time = Date::floorToMinute();

// Find the boundaries
$objMinMax = $this->Database->query("SELECT MIN(startTime) AS dateFrom, MAX(endTime) AS dateTo, MAX(repeatEnd) AS repeatUntil FROM tl_calendar_events WHERE pid IN(" . implode(',', array_map('\intval', $this->cal_calendar)) . ")" . (!BE_USER_LOGGED_IN ? " AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "')" : ""));
$objMinMax = $this->Database->query("SELECT MIN(startTime) AS dateFrom, MAX(endTime) AS dateTo, MAX(repeatEnd) AS repeatUntil FROM tl_calendar_events WHERE pid IN(" . implode(',', array_map('\intval', $this->cal_calendar)) . ")" . (!BE_USER_LOGGED_IN ? " AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')" : ""));

// Store year and month
$intYear = date('Y', $this->Date->tstamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static function ($groupId): string {
AND login='1'
AND disable!='1'
AND (start='' OR start<='$time')
AND (stop='' OR stop>'".($time + 60)."')
AND (stop='' OR stop>'$time')
ORDER BY
username
",
Expand Down
3 changes: 1 addition & 2 deletions core-bundle/src/Resources/contao/classes/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,11 @@ public static function findSearchablePages($pid=0, $domain='', $blnIsXmlSitemap=
}

$arrPages = array();
$time = Date::floorToMinute();

// Recursively walk through all subpages
foreach ($objPages as $objPage)
{
$isPublished = ($objPage->published && ($objPage->start == '' || $objPage->start <= $time) && ($objPage->stop == '' || $objPage->stop > ($time + 60)));
$isPublished = ($objPage->published && ($objPage->start == '' || $objPage->start <= time()) && ($objPage->stop == '' || $objPage->stop > time()));

// Searchable and not protected
if ($isPublished && $objPage->type == 'regular' && !$objPage->requireItem && (!$objPage->noSearch || $blnIsXmlSitemap) && (!$blnIsXmlSitemap || $objPage->robots != 'noindex,nofollow') && (!$objPage->protected || Config::get('indexProtected')))
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/classes/BackendUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ protected function setUserFromDb()

foreach ((array) $this->groups as $id)
{
$objGroup = $this->Database->prepare("SELECT * FROM tl_user_group WHERE id=? AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "')")
$objGroup = $this->Database->prepare("SELECT * FROM tl_user_group WHERE id=? AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')")
->limit(1)
->execute($id);

Expand Down
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/classes/Crawl.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ private function generateMemberWidget(): Widget
// Get the active front end users
if (BackendUser::getInstance()->isAdmin)
{
$objMembers = Database::getInstance()->execute("SELECT id, username FROM tl_member WHERE login='1' AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "') ORDER BY username");
$objMembers = Database::getInstance()->execute("SELECT id, username FROM tl_member WHERE login='1' AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time') ORDER BY username");
}
else
{
$amg = StringUtil::deserialize(BackendUser::getInstance()->amg);

if (!empty($amg) && \is_array($amg))
{
$objMembers = Database::getInstance()->execute("SELECT id, username FROM tl_member WHERE (`groups` LIKE '%\"" . implode('"%\' OR \'%"', array_map('\intval', $amg)) . "\"%') AND login='1' AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "') ORDER BY username");
$objMembers = Database::getInstance()->execute("SELECT id, username FROM tl_member WHERE (`groups` LIKE '%\"" . implode('"%\' OR \'%"', array_map('\intval', $amg)) . "\"%') AND login='1' AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time') ORDER BY username");
}
}

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/classes/Hybrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function isHidden()
return false;
}

$isInvisible = $this->objParent->invisible || ($this->objParent->start != '' && $this->objParent->start > time()) || ($this->objParent->stop != '' && $this->objParent->stop < time());
$isInvisible = $this->objParent->invisible || ($this->objParent->start != '' && $this->objParent->start > time()) || ($this->objParent->stop != '' && $this->objParent->stop <= time());

// The element is visible, so show it
if (!$isInvisible)
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/classes/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function languageFallback()
{
$arrRoots = array();
$time = Date::floorToMinute();
$objRoots = $this->Database->execute("SELECT fallback, dns FROM tl_page WHERE type='root' AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "') ORDER BY dns");
$objRoots = $this->Database->execute("SELECT fallback, dns FROM tl_page WHERE type='root' AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time') ORDER BY dns");

while ($objRoots->next())
{
Expand Down
5 changes: 1 addition & 4 deletions core-bundle/src/Resources/contao/dca/tl_article.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Contao\CoreBundle\EventListener\DataContainer\ContentCompositionListener;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\DataContainer;
use Contao\Date;
use Contao\Image;
use Contao\Input;
use Contao\LayoutModel;
Expand Down Expand Up @@ -556,9 +555,7 @@ public function checkPermission()
public function addIcon($row, $label)
{
$image = 'articles';
$time = Date::floorToMinute();

$unpublished = ($row['start'] != '' && $row['start'] > $time) || ($row['stop'] != '' && $row['stop'] < $time);
$unpublished = ($row['start'] != '' && $row['start'] > time()) || ($row['stop'] != '' && $row['stop'] <= time());

if ($unpublished || !$row['published'])
{
Expand Down
5 changes: 1 addition & 4 deletions core-bundle/src/Resources/contao/dca/tl_member.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Contao\Config;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\DataContainer;
use Contao\Date;
use Contao\FrontendUser;
use Contao\Image;
use Contao\Input;
Expand Down Expand Up @@ -470,9 +469,7 @@ public function getActiveGroups()
public function addIcon($row, $label, DataContainer $dc, $args)
{
$image = 'member';
$time = Date::floorToMinute();

$disabled = ($row['start'] !== '' && $row['start'] > $time) || ($row['stop'] !== '' && $row['stop'] < $time);
$disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());

if ($row['useTwoFactor'])
{
Expand Down
5 changes: 1 addition & 4 deletions core-bundle/src/Resources/contao/dca/tl_member_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Contao\BackendUser;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\DataContainer;
use Contao\Date;
use Contao\Image;
use Contao\Input;
use Contao\StringUtil;
Expand Down Expand Up @@ -193,9 +192,7 @@ public function __construct()
public function addIcon($row, $label)
{
$image = 'mgroup';
$time = Date::floorToMinute();

$disabled = ($row['start'] !== '' && $row['start'] > $time) || ($row['stop'] !== '' && $row['stop'] < $time);
$disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());

if ($disabled || $row['disable'])
{
Expand Down
5 changes: 1 addition & 4 deletions core-bundle/src/Resources/contao/dca/tl_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Contao\Config;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\DataContainer;
use Contao\Date;
use Contao\Image;
use Contao\Input;
use Contao\Message;
Expand Down Expand Up @@ -631,9 +630,7 @@ public function addTemplateWarning()
public function addIcon($row, $label, DataContainer $dc, $args)
{
$image = $row['admin'] ? 'admin' : 'user';
$time = Date::floorToMinute();

$disabled = ($row['start'] !== '' && $row['start'] > $time) || ($row['stop'] !== '' && $row['stop'] < $time);
$disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());

if ($row['useTwoFactor'])
{
Expand Down
5 changes: 1 addition & 4 deletions core-bundle/src/Resources/contao/dca/tl_user_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Contao\BackendUser;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\DataContainer;
use Contao\Date;
use Contao\Image;
use Contao\Input;
use Contao\Message;
Expand Down Expand Up @@ -331,9 +330,7 @@ public function addTemplateWarning()
public function addIcon($row, $label)
{
$image = 'group';
$time = Date::floorToMinute();

$disabled = ($row['start'] !== '' && $row['start'] > $time) || ($row['stop'] !== '' && $row['stop'] < $time);
$disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());

if ($disabled || $row['disable'])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function generate()

protected function isHidden()
{
$isInvisible = $this->invisible || ($this->start != '' && $this->start > time()) || ($this->stop != '' && $this->stop < time());
$isInvisible = $this->invisible || ($this->start != '' && $this->start > time()) || ($this->stop != '' && $this->stop <= time());

// The element is visible, so show it
if (!$isInvisible)
Expand Down
9 changes: 5 additions & 4 deletions core-bundle/src/Resources/contao/elements/ContentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public function generate()
return '';
}

$objModule->typePrefix = 'ce_';

/** @var Module $objModule */
$objModule = new $strClass($objModule, $this->strColumn);

$cssID = StringUtil::deserialize($objModule->cssID, true);

// Override the CSS ID (see #305)
Expand All @@ -60,10 +65,6 @@ public function generate()
}

$objModule->cssID = $cssID;
$objModule->typePrefix = 'ce_';

/** @var Module $objModule */
$objModule = new $strClass($objModule, $this->strColumn);

// Tag the response
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public function generateSitemap($intId=0)

$this->purgeXmlFiles();

$strQuery = "SELECT id, language, sitemapName FROM tl_page WHERE type='root' AND createSitemap='1' AND sitemapName!='' AND (start='' OR start<='$time') AND (stop='' OR stop>'" . ($time + 60) . "') AND published='1'";
$strQuery = "SELECT id, language, sitemapName FROM tl_page WHERE type='root' AND createSitemap='1' AND sitemapName!='' AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')";

// Get a particular root page
if ($intId > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public static function getPageStatusIcon($objPage)
$image = $type . '.svg';

// Page not published or not active
if (!$objPage->published || ($objPage->start != '' && $objPage->start > time()) || ($objPage->stop != '' && $objPage->stop < time()))
if (!$objPage->published || ($objPage->start != '' && $objPage->start > time()) || ($objPage->stop != '' && $objPage->stop <= time()))
{
++$sub;
}
Expand Down
6 changes: 2 additions & 4 deletions core-bundle/src/Resources/contao/library/Contao/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,12 @@ public function isEqualTo(UserInterface $user)
return false;
}

$time = Date::floorToMinute();

if ($this->start !== '' && $this->start > $time)
if ($this->start !== '' && $this->start > time())
{
return false;
}

if ($this->stop !== '' && $this->stop <= ($time + 60))
if ($this->stop !== '' && $this->stop <= time())
{
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions core-bundle/src/Resources/contao/models/ArticleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static function findPublishedByIdOrAliasAndPid($varId, $intPid, array $ar
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

return static::findOneBy($arrColumns, $arrValues, $arrOptions);
Expand All @@ -192,7 +192,7 @@ public static function findPublishedById($intId, array $arrOptions=array())
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

return static::findOneBy($arrColumns, $intId, $arrOptions);
Expand All @@ -216,7 +216,7 @@ public static function findPublishedByPidAndColumn($intPid, $strColumn, array $a
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand All @@ -243,7 +243,7 @@ public static function findPublishedWithTeaserByPid($intPid, array $arrOptions=a
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand Down Expand Up @@ -272,7 +272,7 @@ public static function findPublishedWithTeaserByPidAndColumn($intPid, $strColumn
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/models/ContentModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public static function findPublishedByPidAndTable($intPid, $strParentTable, arra
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.invisible='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.invisible='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand Down Expand Up @@ -462,7 +462,7 @@ public static function countPublishedByPidAndTable($intPid, $strParentTable, arr
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.invisible='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')";
$arrColumns[] = "$t.invisible='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

if (!isset($arrOptions['order']))
Expand Down
6 changes: 3 additions & 3 deletions core-bundle/src/Resources/contao/models/MemberGroupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static function findPublishedById($intId, array $arrOptions=array())
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.disable=''";
$arrColumns[] = "$t.disable='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
}

return static::findOneBy($arrColumns, $intId, $arrOptions);
Expand All @@ -100,7 +100,7 @@ public static function findAllActive(array $arrOptions=array())
$t = static::$strTable;
$time = Date::floorToMinute();

return static::findBy(array("$t.disable='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "')"), null, $arrOptions);
return static::findBy(array("$t.disable='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')"), null, $arrOptions);
}

/**
Expand All @@ -126,7 +126,7 @@ public static function findFirstActiveWithJumpToByIds($arrIds)
$objDatabase = Database::getInstance();
$arrIds = array_map('\intval', $arrIds);

$objResult = $objDatabase->prepare("SELECT p.* FROM tl_member_group g LEFT JOIN tl_page p ON g.jumpTo=p.id WHERE g.id IN(" . implode(',', $arrIds) . ") AND g.jumpTo>0 AND g.redirect='1' AND g.disable!='1' AND (g.start='' OR g.start<='$time') AND (g.stop='' OR g.stop>'" . ($time + 60) . "') AND p.published='1' AND (p.start='' OR p.start<='$time') AND (p.stop='' OR p.stop>'" . ($time + 60) . "') ORDER BY " . $objDatabase->findInSet('g.id', $arrIds))
$objResult = $objDatabase->prepare("SELECT p.* FROM tl_member_group g LEFT JOIN tl_page p ON g.jumpTo=p.id WHERE g.id IN(" . implode(',', $arrIds) . ") AND g.jumpTo>0 AND g.redirect='1' AND g.disable!='1' AND (g.start='' OR g.start<='$time') AND (g.stop='' OR g.stop>'$time') AND p.published='1' AND (p.start='' OR p.start<='$time') AND (p.stop='' OR p.stop>'$time') ORDER BY " . $objDatabase->findInSet('g.id', $arrIds))
->limit(1)
->execute();

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/models/MemberModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public static function findActiveByEmailAndUsername($strEmail, $strUsername=null
$t = static::$strTable;
$time = Date::floorToMinute();

$arrColumns = array("$t.login='1' AND $t.disable='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.email=?");
$arrColumns = array("$t.email=? AND $t.login='1' AND $t.disable='' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')");

if ($strUsername !== null)
{
Expand Down
Loading

0 comments on commit 989d898

Please sign in to comment.