Advertisement
Guest User

da

a guest
Nov 21st, 2019
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. function Register($login, $email, $secret_code, $raspuns1, $raspuns2, $raspuns3, $raspuns4)
  2. {
  3. global $db;
  4.  
  5. $password = ($this->generateCode(8));
  6.  
  7. $password_hash = explode($login, $password);
  8. $password_hash = strtoupper(hash('whirlpool', $password_hash[0].''.$password_hash[1]));
  9.  
  10. $reg = $db->sql("INSERT INTO `accounts` (`Username`, `Password`, `Email`, `secret_code`, `IP`, `RegisterDate`, `Raspuns1`, `Raspuns2`, `Raspuns3`, `Raspuns4`) VALUES ('$login', '$password_hash', '$email', '$secret_code', '".$this->getIP()."', '".time()."', '$raspuns1', '$raspuns2', '$raspuns3', '$raspuns4')");
  11. $id = mysql_insert_id();
  12.  
  13. $mailbox = $db->sql("INSERT INTO `accounts_mail` (`id`,`from`,`item`,`message`,`date`) VALUES ('".$id."', 'National Roleplay', 'Welcome to National Roleplay!', 'Welcome to Natural Roleplay, <b>".$login."</b>. We are happy that you choosed our server! We congrat you for passing the preliminatory questions, but there a few more steps for you! This account can not be used to connect in-game, and because of that you have to create a character. Once you will create it, you will have further information.', '".time()."')");
  14.  
  15. $title = ''.$login.' - Login informations';
  16. $headers = 'From: National Roleplay <no-reply@na-rp.ro>' . "\r\n" .
  17. 'Reply-To: National Roleplay <no-reply@na-rp.ro>' . "\r\n" .
  18. $headers = "Content-type: text/plain; charset=utf-8\r\n";
  19. $headers .= "Bine ai venit National Roleplay!";
  20. $letter = "Account ".$login." has been registered succesfully on ".$_SERVER["HTTP_HOST"].".\nThese are your login informations:\n\nUsername: ".$login."\nPassword: ".$password."\nSecret word: ".$secret_code."\n\nIf you did not registered the account ".$login.", you can ignore this mail or contact the National Roleplay Management..\n\nRegards,\nNational Roleplay.";
  21.  
  22. if($reg == TRUE)
  23. {
  24. if(mail($email, $title, $letter, $headers))
  25. {
  26. return TRUE;
  27. }
  28. else
  29. {
  30. return FALSE;
  31. }
  32.  
  33. }
  34. else
  35. {
  36. return FALSE;
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement