Advertisement
Guest User

Untitled

a guest
May 19th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.80 KB | None | 0 0
  1. <?php
  2. require('config.php');
  3. require_once('recaptchalib.php'); //REQUIRED IMPORT FOR RECAPTCHA ENGINE
  4. //Recaptcha public key that is needed to request recaptcha input dialog, change as needed, depending on site.
  5. $publickey = "6LfVTgwAAAAAAAXOeGyaKxCO0OGUn_Kwml30Qpy7";
  6.  
  7. if (!defined('AXE'))
  8. exit;
  9.  
  10.  
  11. if (!$a_user['is_guest'])
  12. {
  13. box ('Hmm','You are already logged in, why do you wan\'t new account? <br>I should ban u at the spot... But ill leave u be...');
  14. $tpl_footer = new Template("styles/".$style."/footer.php");
  15. $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  16. print $tpl_footer->toString();
  17. exit;
  18. }
  19. //common include
  20. $box_simple_wide = new Template("styles/".$style."/box_simple_wide.php");
  21. $box_wide = new Template("styles/".$style."/box_wide.php");
  22. $box_wide->setVar("imagepath", 'styles/'.$style.'/images/');
  23. $box_simple_wide->setVar("imagepath", 'styles/'.$style.'/images/');
  24. //end common include
  25. if (isset($_POST['action']))
  26. {
  27. //RECAPTCHA KEY FOR RETRIEVING RESPONSE
  28. $privatekey = "6LfVTgwAAAAAADdX1g-uUHZzJ8CFTKc9i4t2zts9";
  29. //boolean Response declaration from reCaptcha site to verify if user input is correct.
  30. $resp = recaptcha_check_answer ($privatekey,
  31. $_SERVER["REMOTE_ADDR"],
  32. $_POST["recaptcha_challenge_field"],
  33. $_POST["recaptcha_response_field"]);
  34. //do login stuff:
  35. $login = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['username'] ); //only letters and numbers
  36. if (!$resp->is_valid) { //Error Catching for Captcha
  37. $war5="<br><center><font color='red' size=5>Wrong Recaptcha</font></center>";
  38. }
  39. else {
  40. if ($login=='')
  41. {
  42. $war1="<font color='red'>Type in username/login</font>";
  43. }
  44. else //pass empty
  45. {
  46. $db->select_db($acc_db);
  47. $result = $db->query("SELECT ".$db_translation['login']." FROM ".$db_translation['accounts']." WHERE ".$db_translation['login']." = '".$db->escape($login)."' LIMIT 1") or die(mysql_error());
  48. $rows = $db->num_rows($result);
  49. if ($rows>=1)
  50. {
  51. $war1="<font color='red'>Username '".$login."' already exist!</font>";
  52. $db->select_db($db_name);
  53. }
  54. else //pass username
  55. {
  56. if ($smtp_h=='')
  57. {
  58. $pass1 = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['password'] ); //only letters and numbers
  59. $pass2 = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['password2'] ); //only letters and numbers
  60. if ($pass1=='')
  61. {
  62. box ('Fail',"Type in password.");
  63. $tpl_footer = new Template("styles/".$style."/footer.php");
  64. $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  65. print $tpl_footer->toString();
  66. exit;
  67. }
  68. else //pass empty
  69. {
  70. if ($pass1<>$pass2)
  71. {
  72. box ('Fail',"Passwords does not match.");
  73. $tpl_footer = new Template("styles/".$style."/footer.php");
  74. $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  75. print $tpl_footer->toString();
  76. exit;
  77. }
  78. }
  79. }
  80. $email = pun_htmlspecialchars($_POST['email']);
  81. if ($email=='')
  82. {
  83. $war3="<font color='red'>Type in email</font>";
  84. }
  85. else //pass empty
  86. {
  87. $db->select_db($acc_db);
  88. $result = $db->query("SELECT ".$db_translation['login']." FROM ".$db_translation['accounts']." WHERE ".$db_translation['email']." = '".$db->escape($email)."' LIMIT 1") or die(mysql_error());
  89. $rows = $db->num_rows($result);
  90. if ($rows>=1)
  91. {
  92. $war3="<font color='red'>Email '".$email."' is already in use!</font>";
  93. $db->select_db($db_name);
  94. }
  95. else //pass
  96. {
  97. $question = $_POST['question'];
  98. $answer = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['answer'] );
  99. if ($answer=='')
  100. {
  101. $war4="<font color='red'>Make sure you type in answer</font>";
  102. }
  103. else //pass final
  104. {
  105.  
  106. //random pass
  107. if ($smtp_h<>'' && $smtp_u<>'') //check if there is smtp info
  108. {
  109. $pass1=random_pass('6');
  110. }
  111.  
  112. $db->select_db($acc_db);
  113. //create_account($user,$pass,$email,$securityq,$securitya)
  114. $createacc=create_account($login,$pass1,$db->escape($email));
  115. if ($createacc)
  116. {
  117. box ('Fail',$createacc);
  118. $tpl_footer = new Template("styles/".$style."/footer.php");
  119. $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  120. print $tpl_footer->toString();
  121. exit;
  122. }
  123. $db->select_db($db_name);
  124. //add additional data
  125. $result2 = $db->query("INSERT INTO accounts_more (acc_login, vp, question_id, answer, dp) VALUES ('".strtoupper($login)."','0','".$question."','".$db->escape($answer)."','0')") or die(mysql_error());
  126.  
  127. if ($question=='1')
  128. {
  129. $questi="Your middle name?";
  130. }
  131. elseif ($question=='2')
  132. {
  133. $questi="Your birth town?";
  134. }
  135. elseif ($question=='3')
  136. {
  137. $questi="Your pet's name?";
  138. }
  139. elseif ($question=='4')
  140. {
  141. $questi="Your mother maiden name?";
  142. }
  143. else
  144. {
  145. print "Something went wrong with with your security question...";
  146. }
  147.  
  148. //SMTP START
  149. if ($smtp_h<>'' && $smtp_u<>'') //check if there is smtp info
  150. {
  151. $from =trim($email);
  152. $to = trim($email);
  153. $subject = $title." - Your Account Info";
  154. $body = "Hi, thank you for creating account, ".$login."!\n\nYour password: ".$pass1."\n\nEnjoy your stay!\n\n".$domain_url;
  155. require_once "smtp.php";
  156.  
  157. }
  158. //SMTP END
  159.  
  160. $thisboxstring.='<span class="colorgood">Account Create Success. You are Logged in, your account will be active ingame after 3 minutes.<br><b><strong> set realmlist logon.zhyperwow.com</strong></b></span><br><br>'.$smtpme;
  161. if ($smtp_h=='' && $smtp_u<>'') //check if there is smtp info
  162. {
  163. $thisboxstring.=' Your password is <strong>'.$pass1.'</strong>. You can change it from Account Panel.';
  164. }
  165.  
  166. $thisboxstring.='<a href="./quest.php?name=account">Go to Account Panel</a>';
  167. box ('Success',$thisboxstring);
  168. //login
  169. $_SESSION['user']=pun_htmlspecialchars($login);
  170.  
  171.  
  172.  
  173. $tpl_footer = new Template("styles/".$style."/footer.php");
  174. $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  175. print $tpl_footer->toString();
  176. exit;
  177. }
  178.  
  179. }
  180. }
  181.  
  182. }
  183. }
  184. }
  185. }
  186.  
  187. $cont2='
  188. <form action="" method="post">
  189. <style>input#recaptcha_response_field { background-color: white; }</style>
  190. <table align="center" border="0">
  191.  
  192. <tr>
  193. <td class="td">
  194. <label for="username" onMouseOver="$WowheadPower.showTooltip(event, \'Type in your username/login, this is your server login.\')" onMouseMove="$WowheadPower.moveTooltip(event)" onMouseOut="$WowheadPower.hideTooltip();">
  195. Username:
  196. </label>
  197. </td>
  198. <td>
  199. <input type="text" id="username" maxlength="20" name="username" /> '. $war1.'
  200. </td>
  201. </tr>';
  202.  
  203. if ($smtp_h=='') //check if there is smtp info
  204. {
  205. $cont2.='
  206. <tr>
  207. <td class="td">
  208. <label for="password" onMouseOver="$WowheadPower.showTooltip(event, \'Make sure it is secure, you can always change trough Account Panel later.\')" onMouseMove="$WowheadPower.moveTooltip(event)" onMouseOut="$WowheadPower.hideTooltip();">
  209. Password:
  210. </label>
  211. </td>
  212. <td>
  213. <input type="password" id="password" maxlength="20" name="password" />
  214. </td>
  215. </tr>
  216.  
  217. <tr>
  218. <td class="td">
  219. <label for="password2">
  220. Confirm Password:
  221. </label>
  222. </td>
  223. <td>
  224. <input type="password" id="password2" maxlength="20" name="password2" /> '. $war2.'
  225. </td>
  226. </tr>';
  227.  
  228. }
  229. $cont2.='
  230. <tr>
  231. <td class="td">
  232. <label for="email" onmouseover="$WowheadPower.showTooltip(event, \'Enter your e-mail address.';
  233. if ($smtp_h<>'') $cont2.= " Mail with your password will be sent to your e-mail."; $cont2.='\')" onmousemove="$WowheadPower.moveTooltip(event)" onmouseout="$WowheadPower.hideTooltip();">
  234. Email Address:
  235. </label>
  236. </td>
  237. <td>
  238. <input type="text" id="email" maxlength="40" name="email" /> '. $war3.'
  239. </td>
  240. </tr>
  241.  
  242. <tr>
  243. <td>
  244. <label for="question">
  245. Security Question:
  246. </label>
  247. </td>
  248. <td>
  249. <label><input name="question" type="radio" value="1" />&nbsp; Your middle name?</label><br />
  250. <label><input name="question" type="radio" value="2" checked="checked" />&nbsp; Your birth town?</label><br />
  251. <label><input name="question" type="radio" value="3" />&nbsp; Your pet\'s name?</label><br />
  252. <label><input name="question" type="radio" value="4" />&nbsp; Your mother maiden name?</label><br />
  253. </td>
  254. </tr>
  255.  
  256. <tr>
  257. <td class="td">
  258. <label for="answer">
  259. Security Answer:
  260. </label>
  261. </td>
  262. <td>
  263. <input type="text" id="answer" maxlength="100" name="answer" /> '.$war4.'
  264. </td>
  265. </tr>
  266. <tr>
  267. <th align="center" colspan=2><br/><br/>'.recaptcha_get_html($publickey).$war5.'</th>
  268. </tr>
  269. </table><br />
  270.  
  271. <center>
  272. <p>*Only alphabetic letters A-Z, a-z and numbers 0-9 are allowed*</p>
  273. <p>*Make sure you put valid informations such as emails and security questions as they will be used to recover your account.*</p>
  274. <p><strong><font color="#006600" size="5">Realmlist: logon.zhyperwow.com </font></strong><br />
  275.  
  276.  
  277. <br />
  278. <input type="submit" name="action" value="Create Account" class="button doit" />
  279. </p>
  280. </center>
  281. </form>
  282.  
  283. <!--<div class="post2" align="center">
  284. <div class="post_header2">
  285.  
  286. Server Information
  287. </div>
  288. <div class="post_body2">
  289. set realmlist connect.zhyperwow.com
  290. </div>
  291. <img src="res/post_bottom2.png" alt="" align="top" />
  292. </div>-->';
  293. $box_wide->setVar("content_title", "Account registration");
  294. $box_wide->setVar("content", $cont2);
  295. print $box_wide->toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement