Advertisement
Guest User

Untitled

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