Advertisement
Xom9ik

Register User For Unity

May 10th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. //After 778 string in /wp-login.php
  2. $errors = register_new_user($user_login, $user_email);
  3. //registerUserForUnity
  4.         require_once "db-unity/db.php";
  5.         $user = R::dispense('users');
  6.         if ($user) {
  7.             $user->username = $_POST['user_login'];
  8.             $user->email = $_POST['user_email'];
  9.             $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  10.             $charactersLength = strlen($characters);
  11.             $randomString = '';
  12.             for ($i = 0; $i < 10; $i++) {
  13.                 $randomString .= $characters[rand(0, $charactersLength - 1)];
  14.             }
  15.             $tmp = $randomString;
  16.             while(R::findOne('wp_users', 'UID = ?', [$tmp]))
  17.             {
  18.                 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  19.                 $charactersLength = strlen($characters);
  20.                 $randomString = '';
  21.                 for ($i = 0; $i < 10; $i++) {
  22.                     $randomString .= $characters[rand(0, $charactersLength - 1)];
  23.                 }
  24.                 $tmp = $randomString;
  25.             }
  26.             $user->uid = $tmp;
  27.             $user->gameDataJson0 = "Empty JSON";
  28.             $user->gameDataJson1 = "Empty JSON";
  29.             $user->gameDataJson2 = "Empty JSON";
  30.             $user->gameDataJson3 = "Empty JSON";
  31.  
  32.             $user->name = "";
  33.             $user->surname = "";
  34.             $user->middlename = "";
  35.  
  36.             $user->specialty_1 = "Empty";
  37.             $user->priority_1 = "0";
  38.             $user->zno_competition_score_1 = "0";
  39.  
  40.             $user->specialty_2 = "Empty";
  41.             $user->priority_2 = "0";
  42.             $user->zno_competition_score_2 = "0";
  43.  
  44.             $user->specialty_3 = "Empty";
  45.             $user->priority_3 = "0";
  46.             $user->zno_competition_score_3 = "0";
  47.  
  48.             R::store($user);
  49.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement