From 9640bc3e557df567a125ea2df673d034f1dcc90c Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 24 Oct 2022 09:10:43 +0200 Subject: [PATCH] do NOT try to access notifications, if not installed or enabled for the user gives a SQL error, if not installed --- api/src/Json/Request.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/Json/Request.php b/api/src/Json/Request.php index 04ffbad92b..f8225c16b4 100644 --- a/api/src/Json/Request.php +++ b/api/src/Json/Request.php @@ -103,8 +103,12 @@ class Request { $this->handleRequest($menuaction, $parameters); } - // check if we have push notifications, if notifications app available - if (class_exists('notifications_push')) notifications_push::get(); + // check if we have push notifications, if notifications app available AND enabled for the user + if (!empty($GLOBALS['egw_info']['user']['apps']['notifications']) && + class_exists('notifications_push')) + { + notifications_push::get(); + } } /** @@ -201,4 +205,4 @@ class Request } -} +} \ No newline at end of file