Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace Revolution;
  4. if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
  5. class core implements iCore
  6. {
  7.  
  8. final public function getOnline()
  9. {
  10. global $engine;
  11. return $engine->result("SELECT users_online FROM server_status");
  12. }
  13.  
  14. final public function getStatus()
  15. {
  16. global $engine;
  17. return $engine->result("SELECT status FROM server_status");
  18. }
  19.  
  20. final public function systemError($who, $txt)
  21. {
  22. die('<b>' . $who . ' - RevCMS: </b><br /> <center>' . $txt . '</center>');
  23. }
  24.  
  25. final public function handleCall($k)
  26. {
  27. global $users, $template, $_CONFIG;
  28.  
  29. if($_CONFIG['hotel']['in_maint'] == false)
  30. {
  31. if(!isset($_SESSION['user']['id']))
  32. {
  33. switch($k)
  34. {
  35. case "index":
  36. case null:
  37. case "login":
  38. $users->login();
  39. break;
  40.  
  41. case "register":
  42. $users->register();
  43. break;
  44.  
  45.  
  46.  
  47. case "maintenance":
  48. case "ToS":
  49. //
  50. break;
  51.  
  52. case "me":
  53. case "account":
  54. case "news":
  55. case "shop":
  56. case "community":
  57. case "client":
  58. case "home":
  59. case "bots":
  60. header('Location: '.$_CONFIG['hotel']['url'].'/index');
  61. exit;
  62. break;
  63.  
  64. default:
  65. //Nothing
  66. break;
  67. }
  68. }
  69. else
  70. {
  71. if($_SESSION['user']['ip_last'] != $_SERVER['REMOTE_ADDR'])
  72. {
  73. header('Location: '.$_CONFIG['hotel']['url'].'/logout');
  74. }
  75.  
  76. switch($k)
  77. {
  78. case "index":
  79. case null:
  80. header('Location: '.$_CONFIG['hotel']['url'].'/me');
  81. exit;
  82. break;
  83.  
  84. case "register":
  85. header('Location: '.$_CONFIG['hotel']['url'].'/me');
  86. exit;
  87. break;
  88.  
  89.  
  90.  
  91. case "client":
  92. $users->createSSO($_SESSION['user']['id']);
  93. $users->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
  94. $template->setParams('sso', $users->getInfo($_SESSION['user']['id'], 'auth_ticket'));
  95. break;
  96.  
  97. case "help":
  98. $users->help();
  99. break;
  100.  
  101. case "account":
  102. $users->updateAccount();
  103. break;
  104.  
  105. default:
  106. //nothing
  107. break;
  108. }
  109. }
  110. }
  111. elseif($_GET['url'] != 'maintenance')
  112. {
  113. header('Location: '.$_CONFIG['hotel']['url'].'/maintenance');
  114. exit;
  115. }
  116. }
  117.  
  118. final public function handleCallHK($k)
  119. {
  120. global $users, $engine, $_CONFIG;
  121.  
  122. if($_SESSION["in_hk"] != true)
  123. {
  124. if(isset($_SESSION['user']['id']))
  125. {
  126. if($k == 'login')
  127. {
  128. $users->loginHK();
  129. }
  130. else
  131. {
  132. header("Location:".$_CONFIG['hotel']['url']."/ase/login");
  133. exit;
  134. }
  135. }
  136. else
  137. {
  138. header("Location:".$_CONFIG['hotel']['url']."/index");
  139. exit;
  140. }
  141. }
  142. else
  143. {
  144. if(!isset($k))
  145. {
  146. header("Location:".$_CONFIG['hotel']['url']."/ase/dash");
  147. exit;
  148. }
  149. else
  150. {
  151. if($k == 'balist')
  152. {
  153.  
  154. if(isset($_GET["unban"]))
  155. {
  156. $user = $engine->secure($_GET["unban"]);
  157. $engine->query("DELETE FROM bans WHERE id = '" . $user . "'");
  158. header("Location: ".$_CONFIG['hotel']['url']."/ase/banlist");
  159. exit;
  160. }
  161. }
  162. }
  163. }
  164. }
  165.  
  166. final public function hashed($password)
  167. {
  168. return sha1($password);
  169. }
  170. }
  171. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement