index.php 815 B

1234567891011121314151617181920212223242526272829
  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. exec (VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id, $output, $return_var);
  21. check_return_code($return_var,$output);
  22. unset($output);
  23. }
  24. exit;