Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.39 KB | None | 0 0
  1. <?PHP
  2. //CREATE ACCOUNT FORM PAGE
  3. if($action == "")
  4. {
  5. $main_content .= '<script type="text/javascript">
  6. var accountHttp;
  7.  
  8. //sprawdza czy dane konto istnieje czy nie
  9. function checkAccount()
  10. {
  11. if(document.getElementById("account_name").value=="")
  12. {
  13. document.getElementById("acc_name_check").innerHTML = \'<image src="../images/false.gif"> <font color="red">Please enter account name.</font>\';
  14. return;
  15. }
  16. accountHttp=GetXmlHttpObject();
  17. if (accountHttp==null)
  18. {
  19. return;
  20. }
  21. var account = document.getElementById("account_name").value;
  22. var url="ajax/check_account.php?account=" + account + "&uid="+Math.random();
  23. accountHttp.onreadystatechange=AccountStateChanged;
  24. accountHttp.open("GET",url,true);
  25. accountHttp.send(null);
  26. }
  27.  
  28. function AccountStateChanged()
  29. {
  30. if (accountHttp.readyState==4)
  31. {
  32. document.getElementById("acc_name_check").innerHTML=accountHttp.responseText;
  33. }
  34. }
  35.  
  36. var emailHttp;
  37.  
  38. //sprawdza czy dane konto istnieje czy nie
  39. function checkEmail()
  40. {
  41. if(document.getElementById("email").value=="")
  42. {
  43. document.getElementById("email_check").innerHTML = \'<image src="../images/false.gif"> <font color="red">Please enter e-mail.</font>\';
  44. return;
  45. }
  46. emailHttp=GetXmlHttpObject();
  47. if (emailHttp==null)
  48. {
  49. return;
  50. }
  51. var email = document.getElementById("email").value;
  52. var url="ajax/check_email.php?email=" + email + "&uid="+Math.random();
  53. emailHttp.onreadystatechange=EmailStateChanged;
  54. emailHttp.open("GET",url,true);
  55. emailHttp.send(null);
  56. }
  57.  
  58. function EmailStateChanged()
  59. {
  60. if (emailHttp.readyState==4)
  61. {
  62. document.getElementById("email_check").innerHTML=emailHttp.responseText;
  63. }
  64. }
  65.  
  66. function validate_required(field,alerttxt)
  67. {
  68. with (field)
  69. {
  70. if (value==null||value==""||value==" ")
  71. {alert(alerttxt);return false;}
  72. else {return true}
  73. }
  74. }
  75.  
  76. function validate_email(field,alerttxt)
  77. {
  78. with (field)
  79. {
  80. apos=value.indexOf("@");
  81. dotpos=value.lastIndexOf(".");
  82. if (apos<1||dotpos-apos<2)
  83. {alert(alerttxt);return false;}
  84. else {return true;}
  85. }
  86. }
  87.  
  88. function validate_form(thisform)
  89. {
  90. with (thisform)
  91. {
  92. if (validate_required(account_name,"Please enter name of new account!")==false)
  93. {account_name.focus();return false;}
  94. if (validate_required(email,"Please enter your e-mail!")==false)
  95. {email.focus();return false;}
  96. if (validate_email(email,"Invalid e-mail format!")==false)
  97. {email.focus();return false;}
  98. if (verifpass==1)
  99. {
  100. if (validate_required(passor,"Please enter password!")==false)
  101. {passor.focus();return false;}
  102. if (validate_required(passor2,"Please repeat password!")==false)
  103. {passor2.focus();return false;}
  104. if (passor2.value!=passor.value)
  105. {alert(\'Repeated password is not equal to password!\');return false;}
  106. }
  107. if (verifya==1)
  108. {
  109. if (validate_required(verify,"Please enter verification code!")==false)
  110. {verify.focus();return false;}
  111. }
  112. if(rules.checked==false)
  113. {alert(\'To create account you must accept server rules!\');return false;}
  114. if(rulesServer.checked==false)
  115. {alert(\'To create account you must accept server rules!\');return false;}
  116. }
  117. }
  118. </script>';
  119. $referrers = $_REQUEST['ref'];
  120. $main_content .= 'To play on '.$config['server']['serverName'].' you need an account.
  121. All you have to do to create your new account is to enter your email address, password to new account, verification code from picture and to agree to the terms presented below.
  122. If you have done so, your account number, password and e-mail address will be shown on the following page and your account and password will be sent
  123. to your email address along with further instructions.<BR><BR>
  124. <FORM ACTION="index.php?subtopic=createaccount&action=saveaccount" onsubmit="return validate_form(this)" METHOD=post>
  125. <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
  126. <TR>
  127. <TD colspan="2" BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Create a '.$config['server']['serverName'].' Account</B></TD>
  128. </TR>
  129. <script type="text/javascript">var accountcustom=1;</script>
  130. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  131. <TD align="center" width="30%"><B>Account Name: </B></TD>
  132. <TD><INPUT id="account_name" NAME="reg_name" OnKeyUp="checkAccount();" VALUE="" SIZE="31" MAXLENGTH="50"><font size="1" face="verdana,arial,helvetica"><div id="acc_name_check">(Select your account number)</div></font></TD>
  133. </TR>
  134. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  135. <TD align="center" width="30%"><B>Email address: </B></TD>
  136. <TD><INPUT id="email" NAME="reg_email" onkeyup="checkEmail();" VALUE="" SIZE=31 MAXLENGTH=250><font size="1" face="verdana,arial,helvetica"><div id="email_check">(Your email address is required to recovery a '.$config['server']['serverName'].' account)</div></font></TD>
  137. </TR>';
  138. if($config['site']['choose_countr'])
  139. {
  140. $main_content .= '<TR BGCOLOR="'.$config['site']['darkborder'].'">
  141. <TD align="center" width="30%"><b>Select Country:</b></TD>
  142. <TD colspan="2"><b>
  143. <select name="reg_country">
  144. <option value="">(Please choose)</option><option value="af"> Afghanistan </option><option value="al"> Albania </option><option value="dz"> Algeria </option><option value="as"> American Samoa </option><option value="ad"> Andorra </option><option value="ao"> Angola </option><option value="ai"> Anguilla </option><option value="aq"> Antarctica </option><option value="ag"> Antigua and Barbuda </option><option value="ar"> Argentina </option>
  145. <option value="am"> Armenia </option><option value="aw"> Aruba </option><option value="au"> Australia </option><option value="at"> Austria </option><option value="az"> Azerbaijan </option><option value="bs"> Bahamas </option><option value="bh"> Bahrain </option><option value="bd"> Bangladesh </option><option value="bb"> Barbados </option><option value="by"> Belarus </option><option value="be"> Belgium </option><option value="bz"> Belize </option><option value="bj"> Benin </option><option value="bm"> Bermuda </option><option value="bt"> Bhutan </option><option value="bo"> Bolivia </option><option value="ba"> Bosnia and Herzegowina </option><option value="bw"> Botswana </option><option value="bv"> Bouvet Island </option><option value="br"> Brazil </option><option value="io"> British Indian Ocean Territory </option><option value="bn"> Brunei Darussalam </option><option value="bg"> Bulgaria </option><option value="bf"> Burkina Faso </option><option value="bi"> Burundi </option>
  146. <option value="kh"> Cambodia </option><option value="cm"> Cameroon </option><option value="ca"> Canada </option><option value="cv"> Cape Verde </option><option value="ky"> Cayman Islands </option><option value="cf"> Central African Republic </option><option value="td"> Chad </option><option value="cl"> Chile </option><option value="cn"> China </option><option value="cx"> Christmas Island </option><option value="cc"> Cocos Islands </option><option value="co"> Colombia </option><option value="km"> Comoros </option><option value="cd"> Congo </option><option value="cg"> Congo </option><option value="ck"> Cook Islands </option><option value="cr"> Costa Rica </option><option value="ci"> Cote DIvoire </option><option value="hr"> Croatia </option><option value="cu"> Cuba </option><option value="cy"> Cyprus </option><option value="cz"> Czech Republic </option><option value="dk"> Denmark </option><option value="dj"> Djibouti </option><option value="dm"> Dominica </option>
  147. <option value="do"> Dominican Republic </option><option value="tp"> East Timor </option><option value="ec"> Ecuador </option><option value="eg"> Egypt </option><option value="sv"> El Salvador </option><option value="gq"> Equatorial Guinea </option><option value="er"> Eritrea </option><option value="ee"> Estonia </option><option value="et"> Ethiopia </option><option value="fk"> Falkland Islands </option><option value="fo"> Faroe Islands </option><option value="fj"> Fiji </option><option value="fi"> Finland </option><option value="fr"> France </option><option value="gf"> French Guiana </option><option value="pf"> French Polynesia </option><option value="tf"> French Southern Territories </option><option value="ga"> Gabon </option><option value="gm"> Gambia </option><option value="ge"> Georgia </option><option value="de"> Germany </option><option value="gh"> Ghana </option><option value="gi"> Gibraltar </option><option value="gr"> Greece </option>
  148. <option value="gl"> Greenland </option><option value="gd"> Grenada </option><option value="gp"> Guadeloupe </option><option value="gu"> Guam </option><option value="gt"> Guatemala </option><option value="gn"> Guinea </option><option value="gw"> Guinea-Bissau </option><option value="gy"> Guyana </option><option value="ht"> Haiti </option><option value="hm"> Heard and Mc Donald Islands </option><option value="hn"> Honduras </option><option value="hk"> Hong Kong </option><option value="hu"> Hungary </option><option value="is"> Iceland </option><option value="in"> India </option><option value="id"> Indonesia </option><option value="ir"> Iran </option><option value="iq"> Iraq </option><option value="ie"> Ireland </option><option value="il"> Israel </option><option value="it"> Italy </option><option value="jm"> Jamaica </option><option value="jp"> Japan </option><option value="jo"> Jordan </option><option value="kz"> Kazakhstan </option><option value="ke"> Kenya </option>
  149. <option value="ki"> Kiribati </option><option value="kr"> Korea </option><option value="kp"> Korea </option><option value="kw"> Kuwait </option><option value="kg"> Kyrgyzstan </option><option value="la"> Lao Peoples Democratic Republic </option><option value="lv"> Latvia </option><option value="lb"> Lebanon </option><option value="ls"> Lesotho </option><option value="lr"> Liberia </option><option value="ly"> Libyan Arab Jamahiriya </option><option value="li"> Liechtenstein </option><option value="lt"> Lithuania </option><option value="lu"> Luxembourg </option><option value="mo"> Macau </option><option value="mk"> Macedonia </option><option value="mg"> Madagascar </option><option value="mw"> Malawi </option><option value="my"> Malaysia </option><option value="mv"> Maldives </option><option value="ml"> Mali </option><option value="mt"> Malta </option><option value="mh"> Marshall Islands </option><option value="mq"> Martinique </option>
  150. <option value="mr"> Mauritania </option><option value="mu"> Mauritius </option><option value="yt"> Mayotte </option><option value="mx"> Mexico </option><option value="fm"> Micronesia </option><option value="md"> Moldova </option><option value="mc"> Monaco </option><option value="mn"> Mongolia </option><option value="ms"> Montserrat </option><option value="ma"> Morocco </option><option value="mz"> Mozambique </option><option value="mm"> Myanmar </option><option value="na"> Namibia </option><option value="nr"> Nauru </option><option value="np"> Nepal </option><option value="nl"> Netherlands </option><option value="an"> Netherlands Antilles </option><option value="nc"> New Caledonia </option><option value="nz"> New Zealand </option><option value="ni"> Nicaragua </option><option value="ne"> Niger </option><option value="ng"> Nigeria </option><option value="nu"> Niue </option><option value="nf"> Norfolk Island </option><option value="mp"> Northern Mariana Islands </option>
  151. <option value="no"> Norway </option><option value="om"> Oman </option><option value="pk"> Pakistan </option><option value="pw"> Palau </option><option value="pa"> Panama </option><option value="pg"> Papua New Guinea </option><option value="py"> Paraguay </option><option value="pe"> Peru </option><option value="ph"> Philippines </option><option value="pn"> Pitcairn </option><option value="pl"> Poland </option><option value="pt"> Portugal </option><option value="pr"> Puerto Rico </option><option value="qa"> Qatar </option><option value="re"> Reunion </option><option value="ro"> Romania </option><option value="ru"> Russian Federation </option><option value="rw"> Rwanda </option><option value="kn"> Saint Kitts and Nevis </option><option value="lc"> Saint Lucia </option><option value="ws"> Samoa </option><option value="sm"> San Marino </option><option value="st"> Sao Tome and Principe </option><option value="sa"> Saudi Arabia </option><option value="sn"> Senegal </option>
  152. <option value="sc"> Seychelles </option><option value="sl"> Sierra Leone </option><option value="sg"> Singapore </option><option value="sk"> Slovakia </option><option value="si"> Slovenia </option><option value="sb"> Solomon Islands </option><option value="so"> Somalia </option><option value="za"> South Africa </option><option value="es"> Spain </option><option value="lk"> Sri Lanka </option><option value="sh"> St. Helena </option><option value="pm"> St. Pierre and Miquelon </option><option value="sd"> Sudan </option><option value="sr"> Suriname </option><option value="sj"> Svalbard and Jan Mayen Islands </option><option value="sz"> Swaziland </option><option value="se"> Sweden </option><option value="ch"> Switzerland </option><option value="sy"> Syrian Arab Republic </option><option value="tw"> Taiwan </option><option value="tj"> Tajikistan </option><option value="tz"> Tanzania </option>
  153. <option value="th"> Thailand </option><option value="tg"> Togo </option><option value="tk"> Tokelau </option><option value="to"> Tonga </option><option value="tt"> Trinidad and Tobago </option><option value="tn"> Tunisia </option><option value="tr"> Turkey </option><option value="tm"> Turkmenistan </option><option value="tc"> Turks and Caicos Islands </option><option value="tv"> Tuvalu </option><option value="ug"> Uganda </option><option value="ua"> Ukraine </option><option value="ae"> United Arab Emirates </option><option value="gb"> United Kingdom </option><option value="us"> United States </option><option value="uy"> Uruguay </option><option value="uz"> Uzbekistan </option><option value="vu"> Vanuatu </option><option value="va"> Vatican </option><option value="ve"> Venezuela </option><option value="vn"> Viet Nam </option><option value="vg"> Virgin Islands (British) </option><option value="vi"> Virgin Islands (US) </option>
  154. <option value="wf"> Wallis and Futuna Islands </option><option value="eh"> Western Sahara </option><option value="ye"> Yemen </option><option value="yu"> Yugoslavia </option><option value="zm"> Zambia </option><option value="zw"> Zimbabwe </option>
  155. </select>
  156. </td>
  157. </tr>';
  158. }
  159. if(!$config['site']['create_account_verify_mail'])
  160. $main_content .= '<script type="text/javascript">var verifpass=1;</script>
  161. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  162. <TD align="center" width="30%"><B>Password: </B></TD>
  163. <TD><INPUT TYPE="password" id="passor" NAME="reg_password" VALUE="" SIZE=31 MAXLENGTH=50><BR><font size="1" face="verdana,arial,helvetica">(Here write your password to new account on '.$config['server']['serverName'].')</font></TD>
  164. </TR>
  165. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  166. <TD align="center" width="30%"><B>Repeat password: </B></TD>
  167. <TD><INPUT TYPE="password" id="passor2" NAME="reg_password2" VALUE="" SIZE=31 MAXLENGTH=50><BR><font size="1" face="verdana,arial,helvetica">(Repeat your password)</font></TD>
  168. </TR>';
  169. else
  170. $main_content .= '<script type="text/javascript">var verifpass=0;</script>';
  171. if($config['site']['referrer'])
  172. $main_content .= '<TR BGCOLOR="'.$config['site']['darkborder'].'">
  173. <TD align="center" width="30%"><B>Referrer: </B></TD>
  174. <TD><INPUT TYPE="test" NAME="reg_referrer" VALUE="'.$referrers.'" SIZE=31 MAXLENGTH=50><BR><font size="1" face="verdana,arial,helvetica">(Here write your password to new account on '.$config['server']['serverName'].')</font></TD>
  175. </TR>';
  176. if($config['site']['verify_code'])
  177. {
  178. require_once('recaptchalib.php');
  179. $main_content .= '<script type="text/javascript">var verifya=1;</script>
  180. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  181. <TD align="center" colspan="2"><B>Verification Code</B></TD>
  182. </TR>
  183. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  184. <TD align="center" colspan="2">'.recaptcha_get_html($config['site']['publickey']).'</TD>
  185. </TR>';
  186. }
  187. else
  188. $main_content .= '<script type="text/javascript">var verifya=0;</script>';
  189. $main_content .= '
  190. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  191. <TD colspan="2">Please review the following terms and state your agreement below.</TD>
  192. </TR>
  193. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  194. <TD colspan="2">
  195. <INPUT TYPE="checkbox" NAME="rulesServer" id="rulesServer" value="true" /><label for="rulesServer"> <u>I agree to the <a href="index.php?subtopic=tibiarules">'.$config['server']['serverName'].' Rules</a>.</u></lable><BR>
  196. <INPUT TYPE="checkbox" NAME="rules" id="rules" value="true" /><label for="rules"> <u>I agree to the Tibia Rules.</u></lable><BR>
  197. </TD>
  198. </TR>
  199. <TR BGCOLOR="'.$config['site']['darkborder'].'">
  200. <TD colspan="2">
  201. If you fully agree to these terms, click on the "I Agree" button in order to create a '.$config['server']['serverName'].' account.<BR>
  202. If you do not agree to these terms or do not want to create a '.$config['server']['serverName'].' account, please click on the "Cancel" button.
  203. </TD>
  204. </TR>
  205. </TABLE><BR>
  206. <TABLE BORDER=0 WIDTH=100%>
  207. <TR>
  208. <TD ALIGN=center><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=120 HEIGHT=1 BORDER=0><BR></TD>
  209. <TD ALIGN=center VALIGN=top>
  210. <INPUT TYPE=image NAME="I Agree" SRC="'.$layout_name.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=18>
  211. </FORM> </TD>
  212. <TD ALIGN=center>
  213. <FORM ACTION="index.php?subtopic=latestnews" METHOD=post>
  214. <INPUT TYPE=image NAME="Cancel" SRC="'.$layout_name.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=18>
  215. </FORM>
  216. </TD>
  217. <TD ALIGN=center><IMG SRC="/images/general/blank.gif" WIDTH=120 HEIGHT=1 BORDER=0><BR></TD>
  218. </TR>
  219. </TABLE>
  220. </TD>
  221. <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD>
  222. </TR>
  223. </TABLE>';
  224. }
  225. //CREATE ACCOUNT PAGE (save account in database)
  226. if($action == "saveaccount")
  227. {
  228. $reg_name = strtoupper(trim($_POST['reg_name']));
  229. $reg_email = trim($_POST['reg_email']);
  230. if($config['site']['choose_countr'])
  231. {
  232. $reg_country = trim($_POST['reg_country']);
  233. }
  234. if($config['site']['referrer'])
  235. {
  236. $reg_referrer = (int) $_POST['reg_referrer'];
  237. }
  238. $reg_password = trim($_POST['reg_password']);
  239. $reg_code = trim($_POST['reg_code']);
  240. //FIRST check
  241. ## check name
  242. if(empty($reg_name))
  243. $reg_form_errors[] = "Please enter account name.";
  244. elseif(!check_account_name($reg_name))
  245. $reg_form_errors[] = "Invalid account name format. Use only A-Z and numbers 0-9.";
  246. ## check email
  247. if(empty($reg_email))
  248. $reg_form_errors[] = "Please enter your email address.";
  249. else
  250. {
  251. if(!check_mail($reg_email))
  252. $reg_form_errors[] = "E-mail address is not correct.";
  253. }
  254. ## check verification code
  255. if($config['site']['verify_code'])
  256. {
  257. require_once('recaptchalib.php');
  258. $resp = recaptcha_check_answer ($config['site']['privkey'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
  259. if (!$resp->is_valid)
  260. {
  261. die ("The reCAPTCHA wasn't entered correctly. Go back and try it again.". "(reCAPTCHA said: ".$resp->error.")");
  262. }
  263. }
  264. ## check password
  265. if(empty($reg_password) && !$config['site']['create_account_verify_mail'])
  266. $reg_form_errors[] = "Please enter password to your new account.";
  267. elseif(!$config['site']['create_account_verify_mail'])
  268. {
  269. if(!check_password($reg_password))
  270. $reg_form_errors[] = "Password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
  271. }
  272. //SECOND check
  273. ## check e-mail address in database
  274. if(empty($reg_form_errors))
  275. {
  276. if($config['site']['one_email'])
  277. {
  278. $test_email_account = $ots->createObject('Account');
  279. $test_email_account->findByEmail($reg_email);
  280. if($test_email_account->isLoaded())
  281. $reg_form_errors[] = "Account with this e-mail address already exist in database.";
  282. }
  283. $account_db = new OTS_Account();
  284. $account_db->find($reg_name);
  285. if($account_db->isLoaded())
  286. $reg_form_errors[] = 'Account with this name already exist.';
  287. if($config['site']['referrer'])
  288. {
  289. $ref_check = $SQL->query('SELECT id FROM accounts WHERE id = '.$reg_referrer.' LIMIT 1')->fetch();
  290. if (($reg_referrer > 0) && ($ref_check['id'] < 1))
  291. {
  292. $reg_form_errors[] = 'Uzywany przez Ciebie numer gracza, ktory polecil Ci nasz serwer nie istnieje. Popros go o poprawny link lub ponow rejestracje, aby kontynowac rejestracje bez polecajacego.';
  293. }
  294. }
  295. }
  296. // ----------creates account-------------(save in database)
  297. if(empty($reg_form_errors))
  298. {
  299. //create object 'account' and generate new acc. number
  300. if($config['site']['create_account_verify_mail'])
  301. {
  302. $reg_password = '';
  303. for ($i = 1; $i <= 6; $i++)
  304. $reg_password .= mt_rand(0,9);
  305. }
  306. $reg_account = $ots->createObject('Account');
  307. $number = $reg_account->create(0, 9999999, $reg_name);
  308. // saves account information in database
  309. $reg_account->setEMail($reg_email);
  310. if($config['site']['choose_countr'])
  311. {
  312. $reg_account->setCustomField("flag", $reg_country);
  313. }
  314. if($config['site']['referrer'])
  315. {
  316. $reg_account->setCustomField("ref", $reg_referrer);
  317. $SQL->query('INSERT INTO z_referers (account_id, ref_account_id) VALUES ('.$number.', '.$reg_referrer.')');
  318. }
  319. $reg_account->setPassword(password_ency($reg_password));
  320. $reg_account->unblock();
  321. $reg_account->save();
  322. $reg_account->setCustomField("created", time());
  323. $reg_account->setCustomField("lastday", time());
  324. if($config['site']['newaccount_premdays'])
  325. {
  326. $reg_account->setCustomField("premdays", $config['site']['newaccount_premdays']);
  327. }
  328. //show information about registration
  329. $main_content .= 'Your account has been created. Please write down the account number and password. See you in Tibia!<BR><BR>
  330. <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
  331. <TR>
  332. <TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Account Created</B></TD>
  333. </TR>
  334. <TR>
  335. <TD BGCOLOR="'.$config['site']['darkborder'].'">
  336. <TABLE BORDER=0 CELLPADDING=1>
  337. <TR>
  338. <TD>
  339. <FONT SIZE=5>Write down your account name: <B>'.$reg_name.'</B></FONT><BR><BR>Your password is <b>'.trim($_POST['reg_password']).'</b>.
  340. You will need the account name and your password to play on '.$config['server']['serverName'].'.
  341. Please keep your account name and password in a safe place and never give your account name or password to anybody.<BR><BR>';
  342. if($config['site']['send_emails'] && $config['site']['create_account_verify_mail'])
  343. {
  344. $mailBody = '<html>
  345. <body>
  346. <h3>Your account name and password!</h3>
  347. <p>You or someone else registred on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a> with this e-mail.</p>
  348. <p>Account name: <b>'.$reg_name.'</b></p>
  349. <p>Password: <b>'.trim($reg_password).'</b></p>
  350. <br />
  351. <p>After login you can:</p>
  352. <li>Create new characters
  353. <li>Change your current password
  354. <li>Change your current e-mail
  355. </body>
  356. </html>';
  357. require("phpmailer/class.phpmailer.php");
  358. $mail = new PHPMailer();
  359. if ($config['site']['smtp_enabled'] == "yes")
  360. {
  361. $mail->IsSMTP();
  362. $mail->Host = $config['site']['smtp_host'];
  363. $mail->Port = (int)$config['site']['smtp_port'];
  364. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  365. $mail->Username = $config['site']['smtp_user'];
  366. $mail->Password = $config['site']['smtp_pass'];
  367. }
  368. else
  369. $mail->IsMail();
  370. $mail->IsHTML(true);
  371. $mail->From = $config['site']['mail_address'];
  372. $mail->AddAddress($reg_email);
  373. $mail->Subject = $config['server']['serverName']." - Registration";
  374. $mail->Body = $mailBody;
  375. if($mail->Send())
  376. {
  377. $main_content .= 'Your account has been created. Check your e-mail. See you in Tibia!';
  378. }
  379. else
  380. {
  381. $main_content .= '<br /><small>An error occorred while sending email! Account not created. Try again.</small>';
  382. $reg_account->delete();
  383. }
  384. }
  385. elseif($config['site']['send_emails'] && $config['site']['send_register_email'])
  386. {
  387. $mailBody = '<html>
  388. <body>
  389. <h3>Your account name and password!</h3>
  390. <p>You or someone else registred on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a> with this e-mail.</p>
  391. <p>Account name: <b>'.$reg_name.'</b></p>
  392. <p>Password: <b>'.trim($_POST['reg_password']).'</b></p>
  393. <br />
  394. <p>After login you can:</p>
  395. <li>Create new characters
  396. <li>Change your current password
  397. <li>Change your current e-mail
  398. </body>
  399. </html>';
  400. require("phpmailer/class.phpmailer.php");
  401. $mail = new PHPMailer();
  402. if ($config['site']['smtp_enabled'] == "yes")
  403. {
  404. $mail->IsSMTP();
  405. $mail->Host = $config['site']['smtp_host'];
  406. $mail->Port = (int)$config['site']['smtp_port'];
  407. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  408. $mail->Username = $config['site']['smtp_user'];
  409. $mail->Password = $config['site']['smtp_pass'];
  410.  
  411. }
  412. else
  413. $mail->IsMail();
  414. $mail->IsHTML(true);
  415. $mail->From = $config['site']['mail_address'];
  416. $mail->AddAddress($reg_email);
  417. $mail->Subject = $config['server']['serverName']." - Registration";
  418. $mail->Body = $mailBody;
  419. if($mail->Send())
  420. $main_content .= '<br /><small>These informations were send on email address <b>'.$reg_email.'</b>. Please check your inbox.';
  421. else
  422. $main_content .= '<br /><small>An error occorred while sending email!';
  423. }
  424. $main_content .= '
  425. </TD>
  426. </TR>
  427. </TABLE>
  428. </TD>
  429. </TR>
  430. </TABLE>';
  431. }
  432. else
  433. {
  434. //SHOW ERRORs if data from form is wrong
  435. $main_content .= '
  436. <div class="SmallBox" >
  437. <div class="MessageContainer" >
  438. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  439. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  440. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  441. <div class="ErrorMessage" >
  442. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  443. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  444. <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  445. <b>The Following Errors Have Occurred:</b><br/>';
  446. foreach($reg_form_errors as $show_msg)
  447. {
  448. $main_content .= '<li>'.$show_msg;
  449. }
  450. $main_content .= '
  451. </div>
  452. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  453. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  454. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  455. </div>
  456. </div><BR><BR>
  457. <CENTER>
  458. <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
  459. <FORM ACTION=index.php?subtopic=createaccount METHOD=post>
  460. <TR>
  461. <TD>
  462. <INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$layout_name.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18>
  463. </TD>
  464. </TR>
  465. </FORM>
  466. </TABLE>
  467. </CENTER>';
  468. }
  469. }
  470. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement