Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Classes/Domain/Repository/LogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getNumberOfReceivers(Filter $filter): int
. ' left join ' . Newsletter::TABLE_NAME . ' nl on nl.uid=l.newsletter'
. ' left join ' . Configuration::TABLE_NAME . ' c on nl.configuration=c.uid'
. ' where l.deleted=0 and l.status=' . Log::STATUS_DISPATCH
. ' and c.site in ("' . implode('","', $filter->getSitesForFilter()) . '")'
. " and c.site in ('" . implode("','", $filter->getSitesForFilter()) . "')"
. ' and nl.crdate>' . $filter->getTimeDateStart()->getTimestamp()
. ' limit 1';
return (int)$connection->executeQuery($sql)->fetchOne();
Expand All @@ -57,7 +57,7 @@ public function getGroupedLinksByHref(Filter $filter): array
. ' left join ' . Newsletter::TABLE_NAME . ' nl on nl.uid=l.newsletter'
. ' left join ' . Configuration::TABLE_NAME . ' c on nl.configuration=c.uid'
. ' where l.deleted=0 and l.status=' . Log::STATUS_LINKOPENING
. ' and c.site in ("' . implode('","', $filter->getSitesForFilter()) . '")'
. " and c.site in ('" . implode("','", $filter->getSitesForFilter()) . "')"
. ' and nl.crdate>' . $filter->getTimeDateStart()->getTimestamp()
. ' group by l.properties, l.newsletter'
. ' order by count desc'
Expand All @@ -79,13 +79,13 @@ public function getGroupedLinksByHref(Filter $filter): array
public function getOverallOpenings(Filter $filter): int
{
$connection = DatabaseUtility::getConnectionForTable(Log::TABLE_NAME);
$sql = 'select count(distinct newsletter, user)'
$sql = 'select count(distinct (newsletter, user))'
. ' from ' . Log::TABLE_NAME . ' l'
. ' left join ' . Newsletter::TABLE_NAME . ' nl on nl.uid=l.newsletter'
. ' left join ' . Configuration::TABLE_NAME . ' c on nl.configuration=c.uid'
. ' where l.deleted = 0'
. ' and l.status IN (' . Log::STATUS_NEWSLETTEROPENING . ',' . Log::STATUS_LINKOPENING . ')'
. ' and c.site in ("' . implode('","', $filter->getSitesForFilter()) . '")'
. " and c.site in ('" . implode("','", $filter->getSitesForFilter()) . "')"
. ' and nl.crdate>' . $filter->getTimeDateStart()->getTimestamp();
return (int)$connection->executeQuery($sql)->fetchOne();
}
Expand All @@ -98,12 +98,12 @@ public function getOverallOpenings(Filter $filter): int
public function getOpeningsByClickers(Filter $filter): int
{
$connection = DatabaseUtility::getConnectionForTable(Log::TABLE_NAME);
$sql = 'select count(distinct newsletter, user)'
$sql = 'select count(distinct (newsletter, user))'
. ' from ' . Log::TABLE_NAME . ' l'
. ' left join ' . Newsletter::TABLE_NAME . ' nl on nl.uid=l.newsletter'
. ' left join ' . Configuration::TABLE_NAME . ' c on nl.configuration=c.uid'
. ' where l.deleted = 0 and l.status=' . Log::STATUS_LINKOPENING
. ' and c.site in ("' . implode('","', $filter->getSitesForFilter()) . '")'
. " and c.site in ('" . implode("','", $filter->getSitesForFilter()) . "')"
. ' and nl.crdate>' . $filter->getTimeDateStart()->getTimestamp();
return (int)$connection->executeQuery($sql)->fetchOne();
}
Expand Down Expand Up @@ -152,7 +152,7 @@ protected function getOverallAmountByLogStatus(array $status, Filter $filter): i
. ' left join ' . Newsletter::TABLE_NAME . ' nl on nl.uid=l.newsletter'
. ' left join ' . Configuration::TABLE_NAME . ' c on nl.configuration=c.uid'
. ' where l.deleted = 0 and l.status in (' . ArrayUtility::convertArrayToIntegerList($status) . ')'
. ' and c.site in ("' . implode('","', $filter->getSitesForFilter()) . '")'
. " and c.site in ('" . implode("','", $filter->getSitesForFilter()) . "')"
. ' and nl.crdate>' . $filter->getTimeDateStart()->getTimestamp();
return (int)$connection->executeQuery($sql)->fetchOne();
}
Expand Down Expand Up @@ -275,7 +275,7 @@ public function isLogRecordExisting(int $newsletterIdentifier, int $userIdentifi
$uid = (int)$queryBuilder
->select('uid')
->from(Log::TABLE_NAME)
->where('newsletter=' . $newsletterIdentifier . ' and user=' . $userIdentifier . ' and status=' . $status)
->where('newsletter=' . (int)$newsletterIdentifier . " and user='" . (int)$userIdentifier . "' and status='" . (int)$status . "'")
->setMaxResults(1)
->executeQuery()
->fetchOne();
Expand All @@ -294,11 +294,11 @@ public function findByNewsletterAndStatus(Newsletter $newsletter, array $status,
$connection = DatabaseUtility::getConnectionForTable(Log::TABLE_NAME);
$sqlSelectColumns = '*';
if ($distinctMails === true) {
$sqlSelectColumns = 'distinct newsletter, user';
$sqlSelectColumns = 'distinct (newsletter, user)';
}
return $connection->executeQuery(
'select ' . $sqlSelectColumns . ' from ' . Log::TABLE_NAME .
' where deleted=0 and status in (' . implode(',', $status) . ') and newsletter=' . $newsletter->getUid()
' where deleted=0 and status in (' . implode(',', $status) . ') and newsletter=' . (int)$newsletter->getUid()
)->fetchAllAssociative();
}

Expand All @@ -312,7 +312,7 @@ public function findByNewsletterAndStatus(Newsletter $newsletter, array $status,
public function findRawByUser(User $user, array $statusWhitelist = [], array $statusBlacklist = []): array
{
$connection = DatabaseUtility::getConnectionForTable(Log::TABLE_NAME);
$sql = 'select * from ' . Log::TABLE_NAME . ' where deleted=0 and user=' . $user->getUid();
$sql = 'select * from ' . Log::TABLE_NAME . " where deleted=0 and user='" . (int)$user->getUid() . "'";
if ($statusWhitelist !== []) {
$sql .= ' and status in (' . implode(',', $statusWhitelist) . ')';
} elseif ($statusBlacklist !== []) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/QueueRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function isUserAndNewsletterAlreadyAddedToQueue(User $user, Newsletter $n
return (int)$queryBuilder
->select('uid')
->from(Queue::TABLE_NAME)
->where('newsletter=' . $newsletter->getUid() . ' and user=' . $user->getUid())
->where('newsletter=' . (int)$newsletter->getUid() . " and user='" . (int)$user->getUid() . "'")
->setMaxResults(1)
->executeQuery()
->fetchOne() > 0;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public function getUserAmountFromGroups(array $groupIdentifiers): int
if ($sub !== '') {
$sub .= ' or ';
}
$sub .= 'find_in_set(' . (int)$identifier . ',usergroup)';
$sub = "((',' || usergroup || ',') LIKE '%," . (int)$identifier . ",%')";
}
$sql .= ' where deleted=0 and disable=0 and email like "%@%" and (' . $sub . ')';
$sql .= " where deleted=0 and disable=0 and email like '%@%' and (" . $sub . ')';
return (int)$connection->executeQuery($sql)->fetchOne();
}
return 0;
Expand Down
10 changes: 5 additions & 5 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
'state' => 'stable',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-13.4.99'
'typo3' => '12.4.0-13.4.99',
],
'conflicts' => [
'news' => '9.0.0-10.99.99'
'news' => '9.0.0-10.99.99',
],
'suggests' => [
'lux' => '0.0.0-0.0.0',
'dashboard' => '0.0.0-0.0.0'
]
]
'dashboard' => '0.0.0-0.0.0',
],
],
];