Fixed daily mail notifications
authorMarcel Werk <burntime@woltlab.com>
Mon, 22 Jun 2015 16:08:15 +0000 (18:08 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 22 Jun 2015 16:08:15 +0000 (18:08 +0200)
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php

index 2cf66e346157b0871cd45699fc8d2965afe50a31..d0fdf974872d0509bd16a5d5d610d51c6a7def61 100644 (file)
@@ -34,11 +34,14 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                $userIDs = array();
                $sql = "SELECT  DISTINCT userID
                        FROM    wcf".WCF_N."_user_notification
-                       WHERE   mailNotified = 0
-                               AND time < ?";
+                       WHERE   mailNotified = ?
+                               AND time < ?
+                               AND confirmTime = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array(
-                       TIME_NOW - 3600 * 23
+                       0,
+                       TIME_NOW - 3600 * 23,
+                       0
                ));
                while ($row = $statement->fetchArray()) {
                        $userIDs[] = $row['userID'];
@@ -55,6 +58,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("notification.userID IN (?)", array($userIDs));
                $conditions->add("notification.mailNotified = ?", array(0));
+               $conditions->add("notification.confirmTime = ?", array(0));
                
                $sql = "SELECT          notification.*, notification_event.eventID, object_type.objectType
                        FROM            wcf".WCF_N."_user_notification notification