diff --git a/notifications/inc/class.notifications.inc.php b/notifications/inc/class.notifications.inc.php index 2afdd6637a..0f57bd1012 100644 --- a/notifications/inc/class.notifications.inc.php +++ b/notifications/inc/class.notifications.inc.php @@ -367,7 +367,16 @@ final class notifications { try { // system or non-system user if($receiver->account_id && is_numeric($receiver->account_id)) { - // system user + // system user, collect data and check for Status and expire state, skip notification if expired or not active + $userData = $GLOBALS['egw']->accounts->read($receiver->account_id); + //error_log(__METHOD__.__LINE__." fetched data for User:".array2string($userData['account_lid']).'#'.$userData['account_type'].'#'.$userData['account_status'].'#'.$GLOBALS['egw']->accounts->is_expired($userData).'#'); + if ($userData && $userData['account_type'] === 'u' && + ($userData['account_status'] != 'A' || $GLOBALS['egw']->accounts->is_expired($userData))) + { + //error_log(__METHOD__.__LINE__." skipped notification for User with Data:".array2string($userData)); + $notification_chain = 'disable'; + continue; + } $receiver->handle = $receiver->account_lid; // check if the receiver has rights to run the notifcation app $ids = $GLOBALS['egw']->accounts->memberships($receiver->account_id,true);