Просмотр исходного кода

Ticket #3940 - Notifications: Show notifications for logged in member only.

AntonLV 4 лет назад
Родитель
Сommit
85a2df0098
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      modules/boonex/notifications/classes/BxNtfsModule.php

+ 7 - 4
modules/boonex/notifications/classes/BxNtfsModule.php

@@ -62,9 +62,12 @@ class BxNtfsModule extends BxBaseModNotificationsModule
     function actionGetPosts()
     function actionGetPosts()
     {
     {
         $aParams = $this->_prepareParamsGet();
         $aParams = $this->_prepareParamsGet();
-        $sEvents = $this->_oTemplate->getPosts($aParams);
+        if(empty($aParams['owner_id']) || (int)$aParams['owner_id'] != $this->_iOwnerId)
+            return echoJson([]);
 
 
-        echoJson(array('events' => $sEvents));
+        echoJson([
+            'events' => $this->_oTemplate->getPosts($aParams)
+        ]);
     }
     }
 
 
     /**
     /**
@@ -73,9 +76,9 @@ class BxNtfsModule extends BxBaseModNotificationsModule
 
 
     public function serviceGetSafeServices()
     public function serviceGetSafeServices()
     {
     {
-        return array (
+        return [
             'GetBlockView' => '',
             'GetBlockView' => '',
-        );
+        ];
     }
     }
 
 
     /**
     /**