mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:48:55 +01:00
* notification: do not notify expired or inactive users
This commit is contained in:
parent
f9e8d7312d
commit
389f385701
@ -367,7 +367,16 @@ final class notifications {
|
|||||||
try {
|
try {
|
||||||
// system or non-system user
|
// system or non-system user
|
||||||
if($receiver->account_id && is_numeric($receiver->account_id)) {
|
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;
|
$receiver->handle = $receiver->account_lid;
|
||||||
// check if the receiver has rights to run the notifcation app
|
// check if the receiver has rights to run the notifcation app
|
||||||
$ids = $GLOBALS['egw']->accounts->memberships($receiver->account_id,true);
|
$ids = $GLOBALS['egw']->accounts->memberships($receiver->account_id,true);
|
||||||
|
Loading…
Reference in New Issue
Block a user