daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Feb 9th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require_once 'classes/class.autoloader.php';
  3. session_start();
  4.  
  5. $abs_us_root=$_SERVER['DOCUMENT_ROOT'];
  6.  
  7. $self_path=explode("/", $_SERVER['PHP_SELF']);
  8. $self_path_length=count($self_path);
  9. $file_found=FALSE;
  10.  
  11. for($i = 1; $i < $self_path_length; $i++){
  12.     array_splice($self_path, $self_path_length-$i, $i);
  13.     $us_url_root=implode("/",$self_path)."/";
  14.  
  15.     if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
  16.         $file_found=TRUE;
  17.         break;
  18.     }else{
  19.         $file_found=FALSE;
  20.     }
  21. }
  22.  
  23. require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';
  24.  
  25. // Set config
  26. $GLOBALS['config'] = array(
  27.     'mysql'      => array(
  28. 'host'         => 'localhost',
  29. 'username'     => '******',
  30. 'password'     => '******',
  31. 'db'           => '******',
  32. ),
  33. 'remember'        => array(
  34.   'cookie_name'   => 'pmqesoxiw318374csb',
  35.   'cookie_expiry' => 604800  //One week, feel free to make it longer
  36. ),
  37. 'session' => array(
  38.   'session_name' => 'user',
  39.   'token_name' => 'token',
  40. )
  41. );
  42.  
  43. //If you changed your UserSpice or UserCake database prefix
  44. //put it here.
  45. $db_table_prefix = "uc_";  //Old database prefix
  46.  
  47. //adding more ids to this array allows people to access everything, whether offline or not. Use caution.
  48. $master_account = [1];
  49.  
  50. $currentPage = currentPage();
  51.  
  52. //Check to see if user has a remember me cookie
  53. if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){
  54.     $hash = Cookie::get(Config::get('remember/cookie_name'));
  55.     $hashCheck = DB::getInstance()->query("SELECT * FROM users_session WHERE hash = ? AND uagent = ?",array($hash,Session::uagent_no_version()));
  56.  
  57.     if ($hashCheck->count()) {
  58.         $user = new User($hashCheck->first()->user_id);
  59.         $user->login();
  60.  
  61.     }
  62. }
  63.  
  64. //Check to see that user is logged in on a temporary password
  65. $user = new User();
  66.  
  67. //Check to see that user is verified
  68. if($user->isLoggedIn()){
  69.     if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){
  70.         Redirect::to('users/verify.php');
  71.     }
  72. }
  73. $timezone_string = 'Asia/Jerusalem';
  74. date_default_timezone_set($timezone_string);
  75. 'host'         => 'localhost',
  76. 'username'     => '******',
  77. 'password'     => '******',
  78. 'db'           => '******',
  79. ),
  80. 'remember'        => array(
  81.   'cookie_name'   => 'pmqesoxiw318374csb',
  82.   'cookie_expiry' => 604800  //One week, feel free to make it longer
  83. ),
  84. 'session' => array(
  85.   'session_name' => 'user',
  86.   'token_name' => 'token',
  87. )
  88. );
  89.  
  90. //If you changed your UserSpice or UserCake database prefix
  91. //put it here.
  92. $db_table_prefix = "uc_";  //Old database prefix
  93.  
  94. //adding more ids to this array allows people to access everything, whether offline or not. Use caution.
  95. $master_account = [1];
  96.  
  97. $currentPage = currentPage();
  98.  
  99. //Check to see if user has a remember me cookie
  100. if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){
  101.     $hash = Cookie::get(Config::get('remember/cookie_name'));
  102.     $hashCheck = DB::getInstance()->query("SELECT * FROM users_session WHERE hash = ? AND uagent = ?",array($hash,Session::uagent_no_version()));
  103.  
  104.     if ($hashCheck->count()) {
  105.         $user = new User($hashCheck->first()->user_id);
  106.         $user->login();
  107.  
  108.     }
  109. }
  110.  
  111. //Check to see that user is logged in on a temporary password
  112. $user = new User();
  113.  
  114. //Check to see that user is verified
  115. if($user->isLoggedIn()){
  116.     if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){
  117.         Redirect::to('users/verify.php');
  118.     }
  119. }
  120. $timezone_string = 'Asia/Jerusalem';
  121. date_default_timezone_set($timezone_string);
  122. 'host'         => 'localhost',
  123. 'username'     => '*******',
  124. 'password'     => '*******',
  125. 'db'           => '*******',
  126. ),
  127. 'remember'        => array(
  128.   'cookie_name'   => 'pmqesoxiw318374csb',
  129.   'cookie_expiry' => 604800  //One week, feel free to make it longer
  130. ),
  131. 'session' => array(
  132.   'session_name' => 'user',
  133.   'token_name' => 'token',
  134. )
  135. );
  136.  
  137. //If you changed your UserSpice or UserCake database prefix
  138. //put it here.
  139. $db_table_prefix = "uc_";  //Old database prefix
  140.  
  141. //adding more ids to this array allows people to access everything, whether offline or not. Use caution.
  142. $master_account = [1];
  143.  
  144. $currentPage = currentPage();
  145.  
  146. //Check to see if user has a remember me cookie
  147. if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){
  148.     $hash = Cookie::get(Config::get('remember/cookie_name'));
  149.     $hashCheck = DB::getInstance()->query("SELECT * FROM users_session WHERE hash = ? AND uagent = ?",array($hash,Session::uagent_no_version()));
  150.  
  151.     if ($hashCheck->count()) {
  152.         $user = new User($hashCheck->first()->user_id);
  153.         $user->login();
  154.  
  155.     }
  156. }
  157.  
  158. //Check to see that user is logged in on a temporary password
  159. $user = new User();
  160.  
  161. //Check to see that user is verified
  162. if($user->isLoggedIn()){
  163.     if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){
  164.         Redirect::to('users/verify.php');
  165.     }
  166. }
  167. $timezone_string = 'Asia/Jerusalem';
  168. date_default_timezone_set($timezone_string);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top