Advertisement
Guest User

Untitled

a guest
Mar 21st, 2021
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. <?php
  2. if (isset($_SESSION['id'])) exit(header('LOCATION: ./'));
  3. if (isset($_POST['registreer'])) {
  4. $inlognaam = $_POST['username'];
  5. $wachtwoord = $_POST['wachtwoord'];
  6. $wachtwoord_nogmaals = $_POST['wachtwoord_nogmaals'];
  7. $wachtwoordmd5 = password($wachtwoord);
  8. $email = $_POST['email'];
  9. $others = $_POST['others'];
  10. $ip = $_SERVER['REMOTE_ADDR'];
  11. $referer = $_POST['refferal'];
  12. $black_list = array('yopmail.com');
  13. $_yapMail = explode('@', $email);
  14.  
  15. $check = DB::exQuery("SELECT `ip_aangemeld`,`aanmeld_datum` FROM `rekeningen` WHERE `ip_aangemeld`='".$ip."' ORDER BY `acc_id` DESC LIMIT 1")->fetch_assoc();
  16. $registerdate = strtotime($check['aanmeld_datum']);
  17. $countdown_time = 43200 - (time() - $registerdate);
  18.  
  19. //if ($check['ip_aangemeld'] == $ip && $countdown_time > 0) $message = '<div class="red">'.$txt['alert_already_this_ip'].'</div>';
  20. if (!isset($others)) $message = '<div class="red">'.$txt['alert_accept_others'].'</div>';
  21. else if (empty($inlognaam)) $message = '<div class="red">'.$txt['alert_no_username'].'</div>';
  22. else if (strlen(trim($inlognaam)) < 3) $message = '<div class="red">'.$txt['alert_username_too_short'].'</div>';
  23. else if (strlen(trim($inlognaam)) > 10) $message = '<div class="red">'.$txt['alert_username_too_long'].'</div>';
  24. else if (!preg_match('/^([a-zA-Z0-9]+)$/is', $inlognaam)) $message = '<div class="red">'.$txt['alert_username_incorrect_signs'].'</div>';
  25. else if (DB::exQuery("SELECT `username` FROM `rekeningen` WHERE `username`='" . $inlognaam . "' LIMIT 1")->num_rows != 0) $message = '<div class="red">'.$txt['alert_username_exists'].'</div>';
  26. else if (empty($wachtwoord)) $message = '<div class="red">'.$txt['alert_no_password'].'</div>';
  27. else if (strlen(trim($wachtwoord)) < 6) $message = '<div class="red">'.$txt['alert_password_too_short'].'</div>';
  28. else if ($wachtwoord != $wachtwoord_nogmaals) $message = '<div class="red">'.$txt['alert_passwords_dont_match'].'</div>';
  29. else if (empty($email) || in_array($_yapMail[1], $black_list)) $message = '<div class="red">'.$txt['alert_no_email'].'</div>';
  30. else if (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i", $email)) $message = '<div class="red">'.$txt['alert_email_incorrect_signs'].'</div>';
  31. else if (DB::exQuery("SELECT `email` FROM `rekeningen` WHERE `email`='" . $email . "' LIMIT 1")->num_rows != 0) $message = '<div class="red">'.$txt['alert_email_exists'].'</div>';
  32. else {
  33. #Genereer activatiecode
  34. $activatiecode = 1;
  35.  
  36. $page = 'register';
  37.  
  38. #Gebruiker in de database
  39. DB::exQuery("INSERT INTO `rekeningen` (`account_code`,`username`,`datum`,`aanmeld_datum`,`wachtwoord`,`email`,`ip_aangemeld`) VALUES (".$activatiecode.",'".$inlognaam."',NOW(),NOW(),'".$wachtwoordmd5."','".$email."','".$ip."')");
  40.  
  41. $id = DB::insertID();
  42.  
  43. if (DB::exQuery("SELECT `username` FROM `gebruikers` WHERE `username`='".$referer."'")->num_rows > 0) {
  44. DB::exQuery("UPDATE gebruikers SET silver = silver +200, referidos = referidos +1 WHERE username = '".$referer."'");
  45. $pegaid = DB::exQuery("select `user_id` from `gebruikers` where `username`='".$referer."'")->fetch_assoc();
  46. DB::exQuery("UPDATE rekeningen SET refferal='".$pegaid['user_id']."' WHERE acc_id = '".$id."'");
  47.  
  48. }
  49.  
  50.  
  51. #Bericht opstellen
  52. $_SESSION['user'] = $inlognaam;
  53. header('location: ./activate');
  54. }
  55. }
  56. echo addNPCBox(1, $txt['titlenpc'], $txt['textnpc']);
  57. if (!empty($message)) echo $message
  58. ?>
  59.  
  60. <center>
  61. <form method="post" autocomplete="off" style="padding: 10px; width: 520px; z-index: 10">
  62. <table width="70%" cellspacing="0" celpadding="0" border="0">
  63. <tr>
  64. <td colspan="2">
  65. <input type="text" name="username" placeholder="<?=$txt['login_username'];?>:" style="width:99%; height: 40px; 5px; font-size: 14px" value="<?=$_SESSION['user'];?>" maxlength="10" minlength="3" required />
  66. <input type="email" name="email" placeholder="Email:" value="<?=$_POST['email'];?>" style="width:99%; height: 40px; 5px; font-size: 14px" required />
  67. <input type="password" placeholder="<?=$txt['login_password'];?>:" name="wachtwoord" style="width:49%; height: 40px; 5px; font-size: 14px" value="<?=$_POST['wachtwoord'];?>" required />
  68. <input type="password" placeholder="Repita a Senha:" name="wachtwoord_nogmaals" value="<?=$_POST['wachtwoord_nogmaals'];?>" style="width:49%; height: 40px; 5px; font-size: 14px" required />
  69. <input type="text" name="refferal" value="<?=$refferal;?>" style="padding-left: 10px;width:99%; height: 40px; 5px; font-size: 14px" placeholder="Quem convidou você ao Pokémon World Legends?">
  70. <center><input type="checkbox" name="others" id="others" required /> Declaro que li e concordo com a <a href='' class="colorbox-privacy">Política de Privacidade</a>, <a href='' class="colorbox-terms">Termos de Serviço</a> e com as <a href='' class="colorbox-rules">Regras e Punições</a> </center>
  71. </td>
  72. </tr>
  73. <tr style="font-style: italic;">
  74. <td style="padding-left: 5px; padding-top: 5px; width: 50%">
  75. <a href=''><img src="<?=$static_url?>/images/layout/seta1.png" style=" 3px; vertical-align: 1px;">Ative sua Conta</a>
  76. </td>
  77. <td style="width: 50%; text-align: right; padding-top: 5px; padding-right: 10px">
  78. <a href=''><img src="<?=$static_url?>/images/layout/seta1.png" style=" 3px; vertical-align: 1px">Recuperar Conta</a>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td colspan="2" style="padding-top: 10px">
  83. <button class="button-rounded ripple" name="registreer" type="submit" value="register">PARTICIPAR DA AVENTURA!</button>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td colspan="2" style="font-style: italic; text-align: center; padding-top: 5px">
  88. Já tem uma conta? <a href='' style="color: #6ac7ee; font-weight: bold">LOGUE-SE</a> agora mesmo!
  89. </td>
  90. </tr>
  91. </table>
  92. </form>
  93. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement