* notification: do not notify expired or inactive users

This commit is contained in:
Klaus Leithoff 2011-11-07 16:50:16 +00:00
parent 1657114628
commit 05e07d0c80

View File

@ -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);