diff --git a/install/install/chunks/chunk1.php b/install/chunks/chunk1.php similarity index 97% rename from install/install/chunks/chunk1.php rename to install/chunks/chunk1.php index 783fadf6..ff4e1e42 100644 --- a/install/install/chunks/chunk1.php +++ b/install/chunks/chunk1.php @@ -1,43 +1,43 @@ -), -'remember' => array( - 'cookie_name' => 'pmqesoxiw318374csb', - 'cookie_expiry' => 604800 //One week, feel free to make it longer -), -'session' => array( - 'session_name' => 'user', - 'token_name' => 'token', -) -); - -//If you changed your UserSpice or UserCake database prefix -//put it here. -$db_table_prefix = "uc_"; //Old database prefix - -//adding more ids to this array allows people to access everything, whether offline or not. Use caution. -$master_account = [1]; - -$currentPage = currentPage(); - -//Check to see if user has a remember me cookie -if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){ - $hash = Cookie::get(Config::get('remember/cookie_name')); - $hashCheck = DB::getInstance()->query("SELECT * FROM users_session WHERE hash = ? AND uagent = ?",array($hash,Session::uagent_no_version())); - - if ($hashCheck->count()) { - $user = new User($hashCheck->first()->user_id); - $user->login(); - - } -} - -//Check to see that user is logged in on a temporary password -$user = new User(); - -//Check to see that user is verified -if($user->isLoggedIn()){ - if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){ - Redirect::to($us_url_root.'users/verify.php'); - } -} - -require_once $abs_us_root.$us_url_root."users/includes/loader.php"; +), +'remember' => array( + 'cookie_name' => 'pmqesoxiw318374csb', + 'cookie_expiry' => 604800 //One week, feel free to make it longer +), +'session' => array( + 'session_name' => 'user', + 'token_name' => 'token', +) +); + +//If you changed your UserSpice or UserCake database prefix +//put it here. +$db_table_prefix = "uc_"; //Old database prefix + +//adding more ids to this array allows people to access everything, whether offline or not. Use caution. +$master_account = [1]; + +$currentPage = currentPage(); + +//Check to see if user has a remember me cookie +if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){ + $hash = Cookie::get(Config::get('remember/cookie_name')); + $hashCheck = DB::getInstance()->query("SELECT * FROM users_session WHERE hash = ? AND uagent = ?",array($hash,Session::uagent_no_version())); + + if ($hashCheck->count()) { + $user = new User($hashCheck->first()->user_id); + $user->login(); + + } +} + +//Check to see that user is logged in on a temporary password +$user = new User(); + +//Check to see that user is verified +if($user->isLoggedIn()){ + if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){ + Redirect::to($us_url_root.'users/verify.php'); + } +} + +require_once $abs_us_root.$us_url_root."users/includes/loader.php"; diff --git a/install/install/chunks/chunk2.php b/install/chunks/chunk2.php similarity index 97% rename from install/install/chunks/chunk2.php rename to install/chunks/chunk2.php index d299400e..0501e55b 100644 --- a/install/install/chunks/chunk2.php +++ b/install/chunks/chunk2.php @@ -1 +1 @@ -date_default_timezone_set($timezone_string); +date_default_timezone_set($timezone_string); diff --git a/install/cleanup.php b/install/cleanup.php index 20a69ac3..1dd58f33 100644 --- a/install/cleanup.php +++ b/install/cleanup.php @@ -1,57 +1,57 @@ -
");
- }else{
- echo ("Deleted $file
");
- }
-}
-
-function rrmdir($dir) {
- if (is_dir($dir)) {
- $objects = scandir($dir);
- foreach ($objects as $object) {
- if ($object != "." && $object != "..") {
- if (is_dir($dir."/".$object))
- rrmdir($dir."/".$object);
- else
- unlink($dir."/".$object);
- }
- }
- rmdir($dir);
- }
-}
-
-function randomstring($len){
- $len = $len++;
- $string = "";
- $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- for($i=0;$i<$len;$i++)
- $string.=substr($chars,rand(0,strlen($chars)),1);
- return $string;
-}
-
-//read the entire string
-$str=file_get_contents('../users/init.php');
-
-//replace something in the file string - this is a VERY simple example
-$str=str_replace('pmqesoxiw318374csb', randomString(20),$str);
-$str=str_replace("'session_name' => 'user'", "'session_name' => '".randomString(20)."'",$str);
-
-//write the entire string
-file_put_contents('../users/init.php', $str);
-rmdir("install");
-?>
-
If you made it this far, everything SHOULD be good to go. If you see any errors above, you will want to navigate to the install folder, and delete it manually. Don't forget to check out UserSpice.com if you need any help. Click the button below to make sure you have the latest updates to your database.
- - -");
+ }else{
+ echo ("Deleted $file
");
+ }
+}
+
+function rrmdir($dir) {
+ if (is_dir($dir)) {
+ $objects = scandir($dir);
+ foreach ($objects as $object) {
+ if ($object != "." && $object != "..") {
+ if (is_dir($dir."/".$object))
+ rrmdir($dir."/".$object);
+ else
+ unlink($dir."/".$object);
+ }
+ }
+ rmdir($dir);
+ }
+}
+
+function randomstring($len){
+ $len = $len++;
+ $string = "";
+ $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+ for($i=0;$i<$len;$i++)
+ $string.=substr($chars,rand(0,strlen($chars)),1);
+ return $string;
+}
+
+//read the entire string
+$str=file_get_contents('../users/init.php');
+
+//replace something in the file string - this is a VERY simple example
+$str=str_replace('pmqesoxiw318374csb', randomString(20),$str);
+$str=str_replace("'session_name' => 'user'", "'session_name' => '".randomString(20)."'",$str);
+
+//write the entire string
+file_put_contents('../users/init.php', $str);
+rmdir("install");
+?>
+
If you made it this far, everything SHOULD be good to go. If you see any errors above, you will want to navigate to the install folder, and delete it manually. Don't forget to check out UserSpice.com if you need any help. Click the button below to make sure you have the latest updates to your database.
+ + +