herogat

Untitled

Mar 13th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. <?php
  2. /*================================================================+\
  3. || # PHPRetro - An extendable virtual hotel site and management
  4. |+==================================================================
  5. || # Copyright (C) 2009 Yifan Lu. All rights reserved.
  6. || # http://www.yifanlu.com
  7. || # Parts Copyright (C) 2009 Meth0d. All rights reserved.
  8. || # http://www.meth0d.org
  9. || # All images, scripts, and layouts
  10. || # Copyright (C) 2009 Sulake Ltd. All rights reserved.
  11. |+==================================================================
  12. || # PHPRetro is provided "as is" and comes without
  13. || # warrenty of any kind. PHPRetro is free software!
  14. || # License: GNU Public License 3.0
  15. || # http://opensource.org/licenses/gpl-license.php
  16. \+================================================================*/
  17.  
  18. define("IN_HOLOCMS", TRUE);
  19.  
  20.  
  21.  
  22. if(strpos($_SERVER['SERVER_SOFTWARE'],"Win") == false){ $page['dir'] = str_replace('\\','/',$page['dir']); }
  23. chdir(str_replace($page['dir'], "", getcwd()));
  24.  
  25. if(strpos($page['dir'],'habblet') && (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') && $page['no_ajax'] != true){ header('Location: ../'); exit; }
  26.  
  27. if(!include_once('./includes/config.php')){ if(file_exists('./install/config.php')){ echo "<h1>Please move ./install/config.php to ./includes/config.php to continue.</h1>"; }elseif(file_exists('./install/index.php')){ header('Location: ./install/'); }else{ echo "<h1>Cannot find config.php in includes folder. Cannot find the install folder either. Did you copy all the files?"; } exit; }
  28. define("PREFIX", $conn['main']['prefix']);
  29. require_once('./includes/classes.php');
  30. $db = new $conn['main']['server']($conn['main']);
  31. if($conn['server']['enabled'] == true){ $serverdb = new $conn['server']['server']($conn['server']); }else{ $serverdb = $db; }
  32. $settings = new HoloSettings;
  33. $input = new HoloInput;
  34. $lang = new HoloLocale;
  35.  
  36. session_start();
  37.  
  38. define("PATH", $settings->find("site_path"));
  39. define("SHORTNAME", $settings->find("site_shortname"));
  40. define("FULLNAME", $settings->find("site_name"));
  41. //define("DEBUG", true); //Uncomment this line to show detailed database error messages.
  42.  
  43. require('./includes/data/'.$settings->find("hotel_server").'.php');
  44. $core = new core_sql;
  45. require('./includes/functions.php');
  46. //require('./includes/version.php');
  47.  
  48. if($page['housekeeping'] != true){ if(is_object($_SESSION['user'])){ $user = $_SESSION['user']; }else{ $user = new HoloUser(null,null); } }else{ if(is_object($_SESSION['hk_user'])){ $user = $_SESSION['hk_user']; }else{ $user = new HoloUser(null,null); } }
  49.  
  50. if($user->error == 1 && $page['bypass_user_check'] != true && $_COOKIE['rememberme'] == "true" && $page['housekeeping'] != true){ $_SESSION['page'] = $_SERVER["REQUEST_URI"]; header("Location: ".PATH."/security_check_token"); }
  51.  
  52. if($settings->find("site_closed") == "1" && $page['id'] != "maintenance" && $page['housekeeping'] != true && $user->user("rank") < 5){
  53. header("Location: ".PATH."/maintenance"); exit;
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment