check if notification exists before removing them

This commit is contained in:
Uwe Steinmann 2013-03-06 12:53:00 +01:00
parent e9e8ed2844
commit c9a18c2538

View File

@ -397,16 +397,20 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
// If any of the notification subscribers no longer have read access,
// remove their subscription.
if(isset($this->_notifyList["users"])) {
foreach ($this->_notifyList["users"] as $u) {
if ($this->getAccessMode($u) < M_READ) {
$this->removeNotify($u->getID(), true);
}
}
}
if(isset($this->_notifyList["groups"])) {
foreach ($this->_notifyList["groups"] as $g) {
if ($this->getGroupAccessMode($g) < M_READ) {
$this->removeNotify($g->getID(), false);
}
}
}
return true;
} /* }}} */