Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php
  2. include("../config/dbconf.php");
  3.  
  4. function encryptpw($user, $pass) {
  5. $user = strtoupper($user);
  6. $pass = strtoupper($user);
  7. return sha1($user.':'.$pass);
  8. }
  9.  
  10. $email = strtoupper($_POST['email']);
  11. $expansion = $_POST['exp'];
  12. $bnetindex = "1";
  13.  
  14.  
  15. // Battlenet Password
  16. $bnetpassword = strtoupper(bin2hex(strrev(hex2bin(strtoupper(hash("sha256",strtoupper(hash("sha256", strtoupper($email)).":".strtoupper($_POST['pass']))))))));
  17.  
  18. // Queries
  19. if($insbnet = $conn->prepare("SELECT id FROM battlenet_accounts WHERE email = ?")) {
  20. $insbnet->bind_param("s", $email);
  21. $insbnet->execute();
  22. echo "SA PLANTE ESPECE DE CONNARD";
  23. } else {
  24. echo $insbnet->error;
  25. }
  26. /*if($insbnet = $conn->prepare("INSERT INTO battlenet_accounts (email, sha_pass_hash) VALUES (?, ?);")) {
  27. $insbnet->bind_param("ss", $email, $bnetpassword);
  28. $insbnet->execute();
  29.  
  30. $getid = $conn->prepare("SELECT id FROM battlenet_accounts WHERE email = ?");
  31. $getid->bind_param("s", $email);
  32. $getid->execute();
  33. $getid->bind_result($id);
  34. $getid->store_result();
  35. if($getid->num_rows > 0) {
  36. while($getid->fetch()) {
  37. $bnetacc = $id;
  38. $username = $id."#".$bnetindex;
  39. $accpassword = encryptpw($username, $_POST['pass']);
  40. }
  41. echo "1";
  42. return;
  43. }
  44.  
  45. if($insacc = $conn->prepare("INSERT INTO account (username, sha_pass_hash, email, reg_mail, expansion, battlenet_account, battlenet_index) VALUES (?, ?, ?, ?, ?, ?);")) {
  46. $insacc->bind_param("ssssiii", $username, $accpassword, $email, $expansion, $bnetacc, $bnetindex);
  47. $insacc->execute();
  48. }else{
  49. echo $insacc->error;
  50. }
  51. echo "registered";
  52. }else{
  53. echo $insbnet->error;
  54. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement