[icinga-checkins] icinga.org: icingaweb2/feature/announce-banner-11198: Revert "Don' t show acknowledged announcements"

git at icinga.org git at icinga.org
Fri Nov 4 14:30:53 CET 2016


Module: icingaweb2
Branch: feature/announce-banner-11198
Commit: c2e88679ce6b80e7b7e33ddce193c0f8a9a7922a
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=c2e88679ce6b80e7b7e33ddce193c0f8a9a7922a

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Fri Nov  4 14:06:10 2016 +0100

Revert "Don't show acknowledged announcements"

This reverts commit f99d3597137549d0cae137757db983bde7c41b7e.

refs #11198

---

 library/Icinga/Application/Web.php |   35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php
index 11b159e..9f5626b 100644
--- a/library/Icinga/Application/Web.php
+++ b/library/Icinga/Application/Web.php
@@ -575,29 +575,18 @@ class Web extends EmbeddedWeb
     protected function showAnnouncements()
     {
         if (! Icinga::app()->getRequest()->isXmlHttpRequest()) {
-            $user = Auth::getInstance()->getUser();
-            if ($user !== null) {
-                $repo = new AnnouncementIniRepository();
-                $now = new DateTime();
-                $query = $repo
-                    ->select(array('message'))
-                    ->applyFilter(new FilterAnd(array(
-                        Filter::expression('start', '<=', $now),
-                        Filter::expression('end', '>=', $now),
-                        Filter::expression(
-                            'hash',
-                            '!=',
-                            $repo->select()
-                                ->from('acknowledgement', array('announcement_hash'))
-                                ->where('user', $user->getUsername())
-                                ->fetchColumn()
-                        )
-                    )))
-                    ->order('start');
-
-                foreach ($query->fetchColumn() as $message) {
-                    Notification::info($message);
-                }
+            $repo = new AnnouncementIniRepository();
+            $now = new DateTime();
+            $query = $repo
+                ->select(array('message'))
+                ->applyFilter(new FilterAnd(array(
+                    Filter::expression('start', '<=', $now),
+                    Filter::expression('end', '>=', $now)
+                )))
+                ->order('start');
+
+            foreach ($query->fetchColumn() as $message) {
+                Notification::info($message);
             }
         }
 



More information about the icinga-checkins mailing list