index.php 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  4. // Check token
  5. verify_csrf($_GET);
  6. if ($_GET["delete"] == 1) {
  7. if (empty($_GET["notification_id"])) {
  8. exec(HESTIA_CMD . "v-delete-user-notification " . $user . " all", $output, $return_var);
  9. } else {
  10. $v_id = quoteshellarg((int) $_GET["notification_id"]);
  11. exec(
  12. HESTIA_CMD . "v-delete-user-notification " . $user . " " . $v_id,
  13. $output,
  14. $return_var,
  15. );
  16. }
  17. check_return_code($return_var, $output);
  18. unset($output);
  19. } else {
  20. if (empty($_GET["notification_id"])) {
  21. exec(
  22. HESTIA_CMD . "v-acknowledge-user-notification " . $user . " all",
  23. $output,
  24. $return_var,
  25. );
  26. } else {
  27. $v_id = quoteshellarg((int) $_GET["notification_id"]);
  28. exec(
  29. HESTIA_CMD . "v-acknowledge-user-notification " . $user . " " . $v_id,
  30. $output,
  31. $return_var,
  32. );
  33. check_return_code($return_var, $output);
  34. unset($output);
  35. }
  36. }
  37. exit();