secure_login.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. $login_url_skip = 0;
  3. if (
  4. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web/reset/mail/index.php" ||
  5. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web//reset/mail/index.php" ||
  6. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web/reset/mail/set-ar.php" ||
  7. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web//reset/mail/set-ar.php" ||
  8. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web/reset/mail/get-ar.php" ||
  9. $_SERVER["SCRIPT_FILENAME"] == "/usr/local/hestia/web//reset/mail/get-ar.php" ||
  10. substr($_SERVER["SCRIPT_FILENAME"], 0, 21) == "/usr/local/hestia/bin/"
  11. ) {
  12. $login_url_skip = 1;
  13. }
  14. if ($login_url_skip == 0) {
  15. if (!isset($login_url_loaded)) {
  16. $login_url_loaded = 1;
  17. if (file_exists("/usr/local/hestia/web/inc/login_url.php")) {
  18. require_once "/usr/local/hestia/web/inc/login_url.php";
  19. if (isset($_GET[$login_url])) {
  20. setcookie($login_url, "1", time() + 31536000, "/", $_SERVER["HTTP_HOST"], true);
  21. header("Location: /login/");
  22. exit();
  23. }
  24. if (!isset($_COOKIE[$login_url])) {
  25. exit();
  26. }
  27. }
  28. }
  29. }