From 27884265679dbabba3fb468a1ead9e0e25c4b810 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 27 Jun 2016 20:29:09 +0300 Subject: [PATCH] delete old notifications --- web/css/styles.min.css | 2 +- web/delete/notification/index.php | 1 - web/inc/main.php | 15 +++++++++++++++ web/templates/admin/panel.html | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/web/css/styles.min.css b/web/css/styles.min.css index 2a4efc7d..b0674c76 100644 --- a/web/css/styles.min.css +++ b/web/css/styles.min.css @@ -813,7 +813,7 @@ input[type="checkbox"] { background-color: #c4da5e; } .l-profile__notifications.updates { - background-position: -202px -157px; + background-position: -202px -135px; } .notification-container { diff --git a/web/delete/notification/index.php b/web/delete/notification/index.php index fa3a14f1..0f978712 100644 --- a/web/delete/notification/index.php +++ b/web/delete/notification/index.php @@ -21,7 +21,6 @@ if($_GET['delete'] == 1){ } else { $v_username = escapeshellarg($user); $v_id = escapeshellarg((int)$_GET['notification_id']); - echo VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id; exec (VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id, $output, $return_var); check_return_code($return_var,$output); unset($output); diff --git a/web/inc/main.php b/web/inc/main.php index 51e3afbf..4df0ece9 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -105,6 +105,21 @@ function top_panel($user, $TAB) { } $panel = json_decode(implode('', $output), true); unset($output); + + + // getting notifications + $command = VESTA_CMD."v-list-user-notifications '".$user."' 'json'"; + exec ($command, $output, $return_var); + $notifications = json_decode(implode('', $output), true); + foreach($notifications as $message){ + if($message['ACK'] == 'no'){ + $panel[$user]['NOTIFICATIONS'] = 'yes'; + break; + } + } + unset($output); + + if ( $user == 'admin' ) { include(dirname(__FILE__).'/../templates/admin/panel.html'); } else { diff --git a/web/templates/admin/panel.html b/web/templates/admin/panel.html index c26e050c..fd5d145e 100644 --- a/web/templates/admin/panel.html +++ b/web/templates/admin/panel.html @@ -23,7 +23,7 @@
- ">  + ">