index.php 892 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. session_start();
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Check token
  7. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  8. header('location: /login/');
  9. exit();
  10. }
  11. if($_GET['delete'] == 1){
  12. $v_username = escapeshellarg($user);
  13. $v_id = escapeshellarg((int)$_GET['notification_id']);
  14. exec (VESTA_CMD."v-delete-user-notification ".$v_username." ".$v_id, $output, $return_var);
  15. check_return_code($return_var,$output);
  16. unset($output);
  17. } else {
  18. $v_username = escapeshellarg($user);
  19. $v_id = escapeshellarg((int)$_GET['notification_id']);
  20. echo VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id;
  21. exec (VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id, $output, $return_var);
  22. check_return_code($return_var,$output);
  23. unset($output);
  24. }
  25. exit;