Advertisement
Guest User

poftim

a guest
Nov 21st, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. if(isset($requests->post_data['submit']) AND $_SERVER['REQUEST_METHOD'] == 'POST')
  2. {
  3. $login = $requests->post_data['Username'];
  4. $email = $requests->post_data['Email'];
  5. $secret_code = $requests->post_data['secret_code'];
  6. $rules = $requests->post_data['rules'];
  7. $captcha = substr($requests->post_data['captcha'], 0, 4);
  8. $raspuns1 = $requests->post_data['Raspuns1'];
  9. $raspuns2 = $requests->post_data['Raspuns2'];
  10. $raspuns3 = $requests->post_data['Raspuns3'];
  11. $raspuns4 = $requests->post_data['Raspuns4'];
  12.  
  13. if(empty($login) OR empty($email) OR empty($secret_code) OR empty($captcha) OR empty($raspuns1) OR empty($raspuns2) OR empty($raspuns3))
  14. {
  15. $pages->SetBodyContent($pages->GetMsgError('Fill all the fields!
  16. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  17. }
  18. else if(empty($login) OR empty($rules))
  19. {
  20. $pages->SetBodyContent($pages->GetMsgError('To register, please accept the terms!
  21. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  22. }
  23. else if(strlen($login) < 5 OR strlen($login) > 24)
  24. {
  25. $pages->SetBodyContent($pages->GetMsgError('Username must not be longer than 24 and not shorter than 5.
  26. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  27. }
  28. else if(strlen($email) < 10 OR strlen($email) > 128)
  29. {
  30. $pages->SetBodyContent($pages->GetMsgError('Email must not be longer than 128 and not shorter than 10.
  31. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  32. }
  33. else if(strlen($secret_code) < 5 OR strlen($secret_code) > 16)
  34. {
  35. $pages->SetBodyContent($pages->GetMsgError('Secret word must not be longer than 16 and not shorter than 5.
  36. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  37. }
  38. else if(preg_match( "/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\{\+]/", $login))
  39. {
  40. $pages->SetBodyContent($pages->GetMsgError('Invalid name (no signs)!
  41. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  42. }
  43. else if(!preg_match("/^[a-zA-Z_]+$/", $login))
  44. {
  45. $pages->SetBodyContent($pages->GetMsgError('Invalid name (only latin letters)!
  46. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  47. }
  48. else if(preg_match('/[^(\w)|(\@)|(\.)|(\-)]/', $email))
  49. {
  50. $pages->SetBodyContent($pages->GetMsgError('Invalid email!
  51. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  52. }
  53. else if($user_class->IsUserRegistered($login))
  54. {
  55. $pages->SetBodyContent($pages->GetMsgError('This name is already registered!
  56. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  57. }
  58. else if($user_class->IsEmailRegistered($email))
  59. {
  60. $pages->SetBodyContent($pages->GetMsgError('This email is already used!
  61. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  62. }
  63. else if($user_class->Register($login, $email, $secret_code, $raspuns1, $raspuns2, $raspuns3, $raspuns4))
  64. {
  65. $_SESSION['test_good'] = 0;
  66. $pages->SetBodyContent($pages->GetMsgSuccess('You have been registered. The password has been sent to your email.
  67. <META HTTP-EQUIV="REFRESH" CONTENT="5; URL=../../">'));
  68. }
  69. else
  70. {
  71. $pages->SetBodyContent($pages->GetMsgError('There is an error!
  72. <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
  73. }
  74. }
  75.  
  76. if(!$get_register)
  77. {
  78. $pages->SetBodyContent($pages->GetMsgNotice('Registrarile sunt inchise, reveniti mai tarziu.'));
  79. }
  80. else
  81. {
  82. $pages->SetBodyContent('<form class="contact-form" method="post">
  83. <div id="_info" class="ui-state-focus ui-corner-all" style="padding: 0 .7em;"> <p align="center"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>Please make sure you use a rememberable secret word<br>
  84. This secret word will help you if you lose your account.</p></div><br>
  85. <table width=70%>
  86. <tr>
  87. <td><b>Username:</b></td>
  88. <td><input type="text" name="Username" maxlength="24" size="36"></td>
  89. </tr>
  90. <tr>
  91. <td><b>Email:</b></td>
  92. <td><input type="text" name="Email" maxlength="128" size="36"></td>
  93. </tr>
  94. <tr>
  95. <td><b>Secret word</b></td>
  96. <td><input type="text" name="secret_code" maxlength="16" size="36"></td>
  97. </tr>
  98. <tr>
  99. <td><b>Captcha:</b></td>
  100. <td><input type="text" name="captcha" maxlength="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img id="captcha_img" src="/other/captcha/captcha.php" alt="Captcha" align="bottom" /></td>
  101. </tr>
  102. </table>
  103. <br>
  104. <b><p>Write a short background story about your character (must be at least 2 paragraphs).<p></b>
  105.  
  106. <center><textarea type="text" name="Raspuns1" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns1.'</textarea>
  107. <br></center>
  108.  
  109. <b><p>Tell us about your past experiences with SA-MP (fell free to provide your in-game names and server names).</p></b>
  110.  
  111. <center><textarea type="text" name="Raspuns2" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns2.'</textarea>
  112. <br></center>
  113.  
  114. <b><p>What is our policy regarding rape, robbing and scamming?</p></b>
  115.  
  116. <center><textarea type="text" name="Raspuns3" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns3.'</textarea>
  117. <br></center>
  118.  
  119. <b><p>What is our policy regarding rape, robbing and scamming?</p></b>
  120.  
  121. <center><textarea type="text" name="Raspuns4" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns4.'</textarea>
  122. <br></center>
  123. <br>
  124.  
  125. <center><br><div class="notice"> Odata ce cererea este depusa trebuie sa va conectati in joc pentru ca cererea sa fie revizuita. Imposibilitatea de a face acest lucru va avea ca rezultat neverificarea aplicatiei sau eventual respingerea acesteia.</div>
  126.  
  127. <input type="checkbox" name="rules" /> Sunt de acord cu <a href="http://na-rp.ro/forum" target="_blank">regulamentul serverului</a>.<br>
  128. <br><br>
  129. <center><input type="submit" name="submit" value="Send" /><br><br></center>
  130.  
  131. <br><br></form>');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement