From 95ac7ad29459974c4692ffa69446c5b03b5cd2ad Mon Sep 17 00:00:00 2001 From: Iglocska Date: Wed, 2 Mar 2016 10:39:49 +0100 Subject: [PATCH] If a user is disabled then he should not receive mass admin e-mails - however, if an admin specifically chooses to e-mail him/her it will still work --- app/Controller/UsersController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php index 708aea709..51a29430c 100755 --- a/app/Controller/UsersController.php +++ b/app/Controller/UsersController.php @@ -936,6 +936,7 @@ class UsersController extends AppController { $conditions = array(); if (!$this->_isSiteAdmin()) $conditions = array('org_id' => $this->Auth->user('org_id')); if ($this->request->data['User']['recipient'] != 1) $conditions['id'] = $this->request->data['User']['recipientEmailList']; + else $conditions['AND'][] = array('User.disabled' => 0); $users = $this->User->find('all', array('recursive' => -1, 'order' => array('email ASC'), 'conditions' => $conditions)); $this->request->data['User']['message'] = $this->User->adminMessageResolve($this->request->data['User']['message']); $failures = '';