MailWorker ignores banned and not activated users
authorMarcel Werk <burntime@woltlab.com>
Mon, 14 Jul 2014 21:59:27 +0000 (23:59 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 14 Jul 2014 21:59:27 +0000 (23:59 +0200)
wcfsetup/install/files/lib/system/worker/MailWorker.class.php

index 4ed62cb3480754a5ad0df9efc4992329cd729843..1d7e5564d67fc0b1cb2c195e531062dc0b0b2fe8 100644 (file)
@@ -62,8 +62,13 @@ class MailWorker extends AbstractWorker {
                if ($this->mailData['action'] == '') {
                        $this->conditions->add("user.userID IN (?)", array($this->mailData['userIDs']));
                }
-               else if ($this->mailData['action'] == 'group') {
-                       $this->conditions->add("user.userID IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", array($this->mailData['groupIDs']));
+               else {
+                       $this->conditions->add("user.activationCode = ?", array(0));
+                       $this->conditions->add("user.banned = ?", array(0));
+                       
+                       if ($this->mailData['action'] == 'group') {
+                               $this->conditions->add("user.userID IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", array($this->mailData['groupIDs']));
+                       }
                }
                
                $sql = "SELECT  COUNT(*) AS count