QwikClock is an employee time tracking app.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

action.php 924B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Make things happen when buttons are pressed and forms submitted.
  4. */
  5. require_once __DIR__ . "/required.php";
  6. if ($VARS['action'] !== "signout") {
  7. dieifnotloggedin();
  8. }
  9. /**
  10. * Redirects back to the page ID in $_POST/$_GET['source'] with the given message ID.
  11. * The message will be displayed by the app.
  12. * @param string $msg message ID (see lang/messages.php)
  13. * @param string $arg If set, replaces "{arg}" in the message string when displayed to the user.
  14. */
  15. function returnToSender($msg, $arg = "") {
  16. global $VARS;
  17. if ($arg == "") {
  18. header("Location: app.php?page=" . urlencode($VARS['source']) . "&msg=" . $msg);
  19. } else {
  20. header("Location: app.php?page=" . urlencode($VARS['source']) . "&msg=$msg&arg=$arg");
  21. }
  22. die();
  23. }
  24. switch ($VARS['action']) {
  25. case "signout":
  26. session_destroy();
  27. header('Location: index.php');
  28. die("Logged out.");
  29. }