* Notifications: fix dont try to notify when none is set/forced for folders to check for new mails; dont try to notify when email as module is not enabled for the particular user

This commit is contained in:
Klaus Leithoff 2010-12-03 10:44:47 +00:00
parent 9981730b29
commit d08086c8b2

View File

@ -112,7 +112,7 @@ class notifications_ajax {
* @return xajax response * @return xajax response
*/ */
public function get_notifications() { public function get_notifications() {
$this->check_mailbox(); if ($GLOBALS['egw_info']['user']['apps']['felamimail']) $this->check_mailbox();
$this->get_egwpopup(); $this->get_egwpopup();
return $this->response->getXML(); return $this->response->getXML();
@ -124,7 +124,8 @@ class notifications_ajax {
* @return boolean true or false * @return boolean true or false
*/ */
private function check_mailbox() { private function check_mailbox() {
if(!isset($this->preferences[self::_mailappname]['notify_folders'])) { //error_log(__METHOD__.__LINE__.array2string($this->preferences[self::_mailappname]['notify_folders']));
if(!isset($this->preferences[self::_mailappname]['notify_folders'])||$this->preferences[self::_mailappname]['notify_folders']=='none') {
return true; //no pref set for notifying - exit return true; //no pref set for notifying - exit
} }
$notify_folders = explode(',', $this->preferences[self::_mailappname]['notify_folders']); $notify_folders = explode(',', $this->preferences[self::_mailappname]['notify_folders']);