Advertisement
Guest User

accountman

a guest
Oct 23rd, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 142.89 KB | None | 0 0
  1. <?php
  2. if(!$logged)
  3. if($action == "logout"){
  4. //LOGOUT
  5. $main_content .= '
  6. <div class="TableContainer">
  7. <table class="Table1" cellpadding="0" cellspacing="0" >
  8. <div class="CaptionContainer" >
  9. <div class="CaptionInnerContainer" >
  10. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  11. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  12. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  13. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  14. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  15. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  16. <div class="Text" >Logout Successful</div>
  17. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  18. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)></span>
  19. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  20. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  21. </div></div><tr><td>
  22. <div class="InnerTableContainer">
  23. <table style="width:100%;" ><tr><td>
  24. You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement">login</a> again.
  25. </td>
  26. </tr></table></div></table></div></td></tr>';
  27. }else{
  28. $link = "?subtopic=accountmanagement";
  29. $link_lost = "?subtopic=lostaccount";
  30. include("login.php");
  31. }else
  32. {
  33. if($account_logged->getCustomField("group_id") == 4)
  34. $main_content .='<meta http-equiv="refresh" content="0;url=index.php?subtopic=accountmanagement&action=logout">';
  35. else
  36. if(!$account_logged->getCustomField("vip_time"))
  37. $account_status = '<b>Free Account</b><br /><small>You do not have VIP <i>!</i></small>';
  38. else
  39. $account_status = '<b>VIP Account</b><br /><small>(Your premium time expired at '.date("M j Y, H:i:s", $account_logged->getCustomField("vip_time")).' CEST)</small>';
  40.  
  41. $account_vip = $account_logged->getPlayerVip_Time() ? 'VIP' : 'Free Account';
  42. if ($account_vip == "VIP")
  43. $account_vip_status = "green";
  44. else
  45. $account_vip_status = "red";
  46.  
  47. if($action == ""){
  48. $main_content .= '
  49. <div>
  50. <center>
  51. <table><tbody><tr><td>
  52. <img src="'.$layout_name.'/images/content/headline-bracer-left.gif">
  53. </td>
  54. <td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;">';
  55. $account_reckey = $account_logged->getRecoveryKey();
  56. if(empty($account_reckey)){
  57. $main_content .= 'Welcome to your account!';}
  58. else {
  59. $main_content .='Welcome to your account, ' . $account_logged->getCustomField("rlname") . '!';}
  60. $main_content .='
  61. <br />
  62. </td><td>
  63. <img src="'.$layout_name.'/images/content/headline-bracer-right.gif">
  64. </td></tr></tbody></table>
  65. </center>
  66. <br />';
  67. if($account_logged->getCustomField("page_access") > $config['site']['access_admin_panel']){
  68. $main_content .='
  69. <div class="InnerTableContainer">
  70. <table>
  71. <tbody>
  72. <tr>
  73. <td>
  74. <div class="TableShadowContainerRightTop">
  75. <div class="TableShadowRightTop" style="background-image: url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  76. </div>
  77. <div class="TableContentAndRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  78. <div class="TableContentContainer">
  79. <table class="TableContent" style="border: 1px solid #faf0d7;">
  80. <tbody>
  81. <tr style="background-color: #505050;">
  82. </tr>
  83. <tr class="Table" style="background-color: #d4c0a1;">
  84. <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7; padding: 4px;">
  85. <font style="font-size:16px; font-weight:bold;">
  86. Primeira vez utilizando nosso website?</font><br />Visite o <a href="index.php?subtopic=cpanel">painel de administração</a> para adicionar tabelas não existentes.<small><br />Assim tais como o <b>sistema automatico pagseguro</b> não possui as tabelas instaladas.</small>
  87. </font>
  88. </td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. </div>
  93. </div>
  94. <div class="TableShadowContainer">
  95. <div class="TableBottomShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  96. <div class="TableBottomLeftShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  97. <div class="TableBottomRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  98. </div>
  99. </div>
  100. </td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </div><br />';
  105. }
  106. $main_content .='
  107. <div class="TableContainer">
  108. <div class="CaptionContainer">
  109. <div class="CaptionInnerContainer">
  110. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  111. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  112. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  113. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  114. <div class="Text">Account Status</div>
  115. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  116. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  117. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  118. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  119. </div>
  120. </div>
  121. <table class="Table5" cellpadding="0" cellspacing="0">
  122. <tbody>
  123. <tr>
  124. <td>
  125. <div class="InnerTableContainer">
  126. <table style="width:100%;">
  127. <tbody>
  128. <tr>
  129. <td>
  130. <div class="TableShadowContainerRightTop">
  131. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  132. </div>
  133. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  134. <div class="TableContentContainer">
  135. <table class="TableContent" style="border:1px solid #faf0d7;" width="100%">
  136. <tbody>
  137. <tr>
  138. <td><img class="AccountStatusImage" src="images/account/account-status_'.$account_vip_status.'.gif" /></td>
  139. <td valign="middle" width="100%">
  140. <span class="BigBoldText">'.$account_vip.'</span>
  141. <br />';
  142.  
  143. if ($account_vip == "VIP")
  144. $main_content .='<small>Your premium time expired at '.date("M j Y, H:i:s", $account_logged->getCustomField("vip_time")).' CEST.</small>';
  145.  
  146. $main_content .='</td>
  147. <td><form action="?subtopic=accountmanagement&amp;action=logout" method="post" style="padding:0px;margin:0px;"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div><input class="ButtonText" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif" type="image"></div></div></form><div style="font-size:1px;height:4px;"></div><form action="?subtopic=accountmanagement&action=manage" method="post" style="padding:0px;margin:0px;"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div><input class="ButtonText" name="Manage Account" alt="Manage Account" src="'.$layout_name.'/images/buttons/_sbutton_manageaccount.gif" type="image"></div></div></form></td></tr> </tbody></table> </div></div><div class="TableShadowContainer"> <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);"> <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div> </div></div></td></tr> </tbody></table>
  148. </div>
  149. </td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. </div>';
  154. $main_content .='
  155. <div class="SmallBox"></div>
  156. <br />
  157. <div class="RowsWithOverEffect">
  158. <div class="TableContainer">
  159. <div class="CaptionContainer">
  160. <div class="CaptionInnerContainer">
  161. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  162. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  163. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  164. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  165. <div class="Text">Characters</div>
  166. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  167. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  168. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  169. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  170. </div>
  171. </div>
  172. <table class="Table3" cellpadding="0" cellspacing="0">
  173. <tbody>
  174. <tr>
  175. <td>
  176. <div class="InnerTableContainer">
  177. <table style="width:100%;">
  178. <tbody>
  179. <tr>
  180. <td>
  181. <div class="TableShadowContainerRightTop">
  182. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  183. </div>
  184. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  185. <div class="TableContentContainer">
  186. <table class="TableContent" width="100%">
  187. <tr class="LabelH" >
  188. <td style="width:5%" >&#160;</td>
  189. <td style="width:65%" >Name</td>
  190. <td style="width:15%" >World</td>
  191. <td style="width:7%">Status&#160;</td>
  192. <td style="width:5%">&#160;</td>
  193. </tr>';
  194. $account_players = $account_logged->getPlayersList();
  195. $account_players->orderBy('name');
  196. //show list of players on account
  197. foreach($account_players as $account_player)
  198. {
  199. $player_number_counter++;
  200. $main_content .= '
  201. <tr style="background-color:';
  202. if(is_int($player_number_counter / 2))
  203. $main_content .= $config['site']['darkborder'];
  204. else
  205. $main_content .= $config['site']['lightborder'];
  206. $main_content .= ';" >
  207. <td style="width:5%" >'.$player_number_counter.'.</td>
  208. <td><NOBR>'.$account_player->getName();
  209. if($account_player->isNameLocked())
  210. if($account_player->getOldName()){
  211. $main_content .= '<font color="red"><b> [ NAMELOCK:</b> Wait for GM, new name: <b>'.$account_player->getOldName().' ]</b></font>';
  212. }
  213. $main_content .= '<br />
  214. <small>'.$vocation_name[$account_player->getWorld()][$account_player->getPromotion()][$account_player->getVocation()].' - level '.$account_player->getLevel().'</small></td>
  215. <td><NOBR>'.$config['site']['worlds'][$account_player->getWorld()].'</td>
  216. <td>';
  217. if($account_player->isDeleted()){
  218. $main_content .= 'deleted';
  219. }elseif($account_player->getHideChar() == 1){
  220. $main_content .= 'hidden';
  221. }else{
  222. $main_content .= '';
  223. }$main_content .= '</td>
  224. <td style="text-align:center;vertical-align:middle;horizontal-align:center;" align="center"><p>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</p>
  225. <p>';
  226. if($account_player->isDeleted()){
  227. $main_content .= '[<a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">Undelete</a><a href="index.php?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'" ></a>]</p></td>';
  228. }else{
  229. $main_content .= '[<a href="?subtopic=accountmanagement&action=deletecharacter&name='.urlencode($account_player->getName()).'">Delete</a><a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" ></a>]</p></td>';
  230. }
  231. $main_content .= '</tr>';
  232. }
  233. $players_from_logged_acc = $account_logged->getPlayersList();
  234. if(count($players_from_logged_acc) == 0) {
  235. $main_content .='<tr bgcolor="'.$config['site']['lightborder'].'"><td colspan="5" align="center">You don\'t have any character on your account.</td></tr>';
  236. }
  237. $main_content .= '
  238. </table>
  239. </div></div><div class="TableShadowContainer"> <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);"> <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div> </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0"><tbody><tr><td></td><td style="padding-right:7px;width:100%;" align="right"><form action="?subtopic=accountmanagement&amp;action=createcharacter" method="post" style="padding:0px;margin:0px;"><input name="selectedcharacter" value="" type="hidden"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div><input class="ButtonText" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif" type="image"></div></div></form></td></tr></tbody></table></td></tr> </tbody></table></div> </td></tr></tbody></table></div></div><br /><br />
  240. </div>';
  241. }
  242. elseif($action== "manage"){
  243. $account_reckey = $account_logged->getRecoveryKey();
  244. if(empty($account_reckey))
  245. $account_registred = '<b><font color="red">No</font></b>';
  246. else
  247. if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])
  248. $account_registred = 'Yes <b>(<a href="index.php?subtopic=accountmanagement&action=newreckey">Buy new Rec key</a>)</b>';
  249. else
  250. $account_registred = 'Yes';
  251. $account_created = $account_logged->getCreated();
  252. $account_email = $account_logged->getEMail();
  253. $account_email_new_time = $account_logged->getCustomField("email_new_time");
  254. if($account_email_new_time > 1)
  255. $account_email_new = $account_logged->getCustomField("email_new");
  256. $account_vip = $account_logged->getPlayerVip_Time() ? '<b>VIP</b> - '.date("d/m/Y, H:i", $account_logged->getPlayerVip_Time()).'' : '<b>Free Account</b>';
  257. $account_rlname = $account_logged->getRLName();
  258. $account_location = $account_logged->getLocation();
  259. if($account_logged->isBanned())
  260. if($account_logged->getBanTime() > 0)
  261. $welcome_msg = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>';
  262. else
  263. $welcome_msg = '<font color="red">Your account is banished FOREVER!</font>';
  264. $main_content .= '
  265. <div class="SmallBox" >
  266. <div class="MessageContainer" >
  267. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" />
  268. </div>
  269. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  270. </div>
  271. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  272. </div><div class="Message" >
  273. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  274. </div>
  275. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  276. </div>
  277. <table>
  278. <td width="90%">&nbsp;</td>
  279. <td width="10%">
  280. <table border="0" cellspacing="0" cellpadding="0" >
  281. <form action="?subtopic=accountmanagement" method="post" >
  282. <tr>
  283. <td style="border:0px;" >
  284. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  285. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  286. <input class="ButtonText" type="image" name="Overview" alt="Overview" src="'.$layout_name.'/images/buttons/_sbutton_overview.gif" id="Overview" >
  287. </div>
  288. </div>
  289. </td>
  290. </tr>
  291. </form>
  292. </table>
  293. </td>
  294. </tr>
  295. </table>
  296. </div>
  297. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  298. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  299. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  300. </div>
  301. </div>
  302. <br />
  303. <br />';
  304. //if account dont have recovery key show hint
  305. if(empty($account_reckey))
  306. $main_content .= '<div class="SmallBox" >
  307. <div class="MessageContainer" >
  308. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  309. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  310. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  311. </div>
  312. <div class="Message" >
  313. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  314. </div>
  315. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  316. </div>
  317. <table>
  318. <tr>
  319. <td class="LabelV" >Hint:</td>
  320. <td style="width:100%;" >You can register your account for increased protection. Click on "Register Account" and get your free recovery key today!</td>
  321. </tr>
  322. </table>
  323. <div align="center" >
  324. <table border="0" cellspacing="0" cellpadding="0" >
  325. <form action="?subtopic=accountmanagement&action=registeraccount" method="post" >
  326. <tr>
  327. <td style="border:0px;" >
  328. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';
  329. if($account_email_new_time > 1)
  330. if($account_email_new_time < time())
  331. $account_email_change = '<br />(You can accept <b>'.$account_email_new.'</b> as a new email.)';
  332. else
  333. {
  334. $account_email_change = ' <br /><small>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b></small>";
  335. $main_content .= '<div class="SmallBox" >
  336. <div class="MessageContainer" >
  337. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  338. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  339. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  340. <div class="Message" >
  341. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  342. </div>
  343. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  344. </div>
  345. <table>
  346. <tr>
  347. <td class="LabelV" >Note:</td>
  348. <td style="width:100%;" >A request has been submitted to change the email address of this account to <b>'.$account_email_new.'</b>. After <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b> you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!</td>
  349. </tr>
  350. </table>
  351. <div align="center" >
  352. <table border="0" cellspacing="0" cellpadding="0" >
  353. <form action="?subtopic=accountmanagement&action=changeemail" method="post" >
  354. <tr>
  355. <td style="border:0px;" >
  356. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></div> </div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br /><br />';
  357. }
  358. $main_content .= '<a name="General+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" > <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" ><table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" >
  359. <tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Account Name:</td><td>'.$account_logged->getCustomField("name").'</td></tr>
  360. <tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Email Address:</td><td style="width:90%;" >'.$account_email.''.$account_email_change.'</td></tr>
  361. <tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Created:</td><td>'.date("j F Y, G:i:s", $account_created).'</td></tr>
  362. <tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr>
  363. <tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Account Status:</td><td>'.$account_status.'</td></tr>
  364. <tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Registered:</td><td>'.$account_registred.'</td></tr>
  365. </table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name=newemail value="" ><input type="hidden" name=newemaildate value=0 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form> </table></td><td width="100%"></td>';
  366.  
  367. //show button "register account"
  368. if(empty($account_reckey))
  369. $main_content .= '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>';
  370. $main_content .= '</tr></table></td></tr></table></div></table></div></td></tr><br />
  371. <a name="Public+Information" ></a>
  372. <div class="TopButtonContainer" >
  373. <div class="TopButton" >
  374. <a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a>
  375. </div>
  376. </div>
  377. <div class="TableContainer" >
  378. <table class="Table5" cellpadding="0" cellspacing="0" >
  379. <div class="CaptionContainer" >
  380. <div class="CaptionInnerContainer" >
  381. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  382. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  383. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  384. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  385. <div class="Text" >Public Information</div>
  386. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  387. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  388. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  389. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  390. </div>
  391. </div>
  392. <tr>
  393. <td>
  394. <div class="InnerTableContainer" >
  395. <table style="width:100%;" >
  396. <tr>
  397. <td>
  398. <div class="TableShadowContainerRightTop" >
  399. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  400. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  401. <div class="TableContentContainer" >
  402. <table class="TableContent" width="100%" >
  403. <tr>
  404. <td>
  405. <table style="width:100%;">
  406. <tr>
  407. <td class="LabelV" >Real Name:</td>
  408. <td style="width:90%;" >'.$account_rlname.'</td>
  409. </tr>
  410. <tr>
  411. <td class="LabelV" >Location:</td>
  412. <td style="width:90%;" >'.$account_location.'</td>
  413. </tr>
  414. </table>
  415. </td>
  416. <td align="right">
  417. <table border="0" cellspacing="0" cellpadding="0" >
  418. <form action="?subtopic=accountmanagement&action=changeinfo" method="post" >
  419. <tr>
  420. <td style="border:0px;" >
  421. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr> </table> </div></div>
  422. <div class="TableShadowContainer" >
  423. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  424. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  425. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  426. </div>
  427. </div>
  428. </td>
  429. </tr>
  430. </table>
  431. </div>
  432. </table>
  433. </div>
  434. </td>
  435. </tr>
  436. <br /><br />';
  437. $pagseguro_query = $SQL->query("SELECT COUNT(*) FROM `pagsegurotransacoes` WHERE ".$SQL->fieldName('referencia')." = ".$SQL->quote($account_logged->getCustomField("name"))."")->fetch();
  438. $pagseguro_history_received = $SQL->query('SELECT * FROM `pagsegurotransacoes` WHERE '.$SQL->fieldName('referencia').' = '.$SQL->quote($account_logged->getCustomField("name")).' ORDER BY `Data` DESC LIMIT 5;');
  439. if(is_object($pagseguro_history_received)) {
  440. foreach($pagseguro_history_received as $pagseguro_received) {
  441. if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
  442. $pagseguro_received_text .= '<tr bgcolor="'.$bgcolor.'"><td style="padding: 5px;">'.$pagseguro_received['TransacaoID'].'</td><td>';
  443. $pagseguro_received_text .= $pagseguro_received['TipoPagamento'];
  444. $pagseguro_received_text .= '</td><td><b>R$</b>'.$pagseguro_received['NumItens'].',00</td><td><b style="color:red;">'.$pagseguro_received['StatusTransacao'].'</b></td></tr>';
  445. }
  446. }
  447. if ($pagseguro_query[0] > 0){
  448. $main_content .='
  449. <div class="TableContainer" >
  450. <table class="Table5" cellpadding="0" cellspacing="0" >
  451. <div class="CaptionContainer" >
  452. <div class="CaptionInnerContainer" >
  453. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  454. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  455. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  456. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  457. <div class="Text" >Payments History</div>
  458. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  459. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  460. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  461. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  462. </div>
  463. </div>
  464. <tr>
  465. <td>
  466. <div class="InnerTableContainer" >
  467. <table style="width:100%;" >
  468. <tr>
  469. <td>
  470. <div class="TableShadowContainerRightTop" >
  471. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  472. </div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  473. <div class="TableContentContainer" >
  474. <table class="TableContent" width="100%" >
  475. <tr bgcolor="#D4C0A1">
  476. <td><b>Trans. ID:</b></td>
  477. <td><b>Type:</b></td>
  478. <td><b>Cost:</b></td>
  479. <td><b>Status</b></td>
  480. </tr>
  481. '.$pagseguro_received_text.'
  482. </table>
  483. </div>
  484. </div>
  485. <div class="TableShadowContainer" >
  486. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  487. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  488. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  489. </div>
  490. </div>
  491. </tr>
  492. <tr>
  493. <td>
  494. <form action="index.php?subtopic=history" method="post">
  495. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  496. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  497. <input class="ButtonText" type="image" name="View History" alt="View History" src="'.$layout_name.'/images/buttons/_sbutton_viewhistory.gif" >
  498. </div>
  499. </div>
  500. </form>
  501. </td>
  502. </td>
  503. </tr>
  504. </table>
  505. </div>
  506. </table>
  507. </div>
  508. </td>
  509.  
  510. </tr>
  511. ';
  512.  
  513. }
  514. }
  515. //########### CHANGE PASSWORD ##########
  516. if($action == "changepassword") {
  517. $new_password = trim($_POST['newpassword']);
  518. $new_password2 = trim($_POST['newpassword2']);
  519. $old_password = trim($_POST['oldpassword']);
  520. if(empty($new_password) && empty($new_password2) && empty($old_password)) {
  521. $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br /><br /><form action="index.php?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table></div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  522. }
  523. else
  524. {
  525. if(empty($new_password) || empty($new_password2) || empty($old_password)){
  526. $show_msgs[] = "Please fill in form.";
  527. }
  528. if($new_password != $new_password2) {
  529. $show_msgs[] = "The new passwords do not match!";
  530. }
  531. if(empty($show_msgs)) {
  532. if(!check_password($new_password)) {
  533. $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
  534. }
  535. $old_password = password_ency($old_password);
  536. if($old_password != $account_logged->getPassword()) {
  537. $show_msgs[] = "Current password is incorrect!";
  538. }
  539. }
  540. if(!empty($show_msgs)){
  541. //show errors
  542. $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br />';
  543. foreach($show_msgs as $show_msg) {
  544. $main_content .= '<li>'.$show_msg;
  545. }
  546. $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';
  547. //show form
  548. $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br /><br /><form action="index.php?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table></div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  549. }
  550. else
  551. {
  552. $org_pass = $new_password;
  553. $new_password = password_ency($new_password);
  554. $account_logged->setPassword($new_password);
  555. $account_logged->save();
  556. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Password Changed</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your password has been changed.';
  557. if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])
  558. {
  559. $mailBody = '<html>
  560. <body>
  561. <h3>Password to account changed!</h3>
  562. <p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a>.</p>
  563. <p>New password: <b>'.$org_pass.'</b></p>
  564. </body>
  565. </html>';
  566. require("phpmailer/class.phpmailer.php");
  567. $mail = new PHPMailer();
  568. if ($config['site']['smtp_enabled'] == "yes")
  569. {
  570. $mail->IsSMTP();
  571. $mail->Host = $config['site']['smtp_host'];
  572. $mail->Port = (int)$config['site']['smtp_port'];
  573. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  574. $mail->Username = $config['site']['smtp_user'];
  575. $mail->Password = $config['site']['smtp_pass'];
  576. }
  577. else
  578. $mail->IsMail();
  579. $mail->IsHTML(true);
  580. $mail->From = $config['site']['mail_address'];
  581. $mail->AddAddress($account_logged->getEMail());
  582. $mail->Subject = $config['server']['serverName']." - Changed password";
  583. $mail->Body = $mailBody;
  584. if($mail->Send())
  585. $main_content .= '<br /><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
  586. else
  587. $main_content .= '<br /><small>An error occorred while sending email with password!</small>';
  588. }
  589. $main_content .= '</td></tr> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  590. $_SESSION['password'] = $new_password;
  591. }
  592. }
  593. }
  594.  
  595. //############# CHANGE E-MAIL ###################
  596. if($action == "changeemail") {
  597. $account_email_new_time = $account_logged->getCustomField("email_new_time");
  598. if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); }
  599. if($account_email_new_time < 10){
  600. if($_POST['changeemailsave'] == 1) {
  601. $account_email_new = trim($_POST['new_email']);
  602. $post_password = trim($_POST['password']);
  603. if(empty($account_email_new)) {
  604. $change_email_errors[] = "Please enter your new email address.";
  605. }
  606. else
  607. {
  608. if(!check_mail($account_email_new)) {
  609. $change_email_errors[] = "E-mail address is not correct.";
  610. }
  611. }
  612. if(empty($post_password)) {
  613. $change_email_errors[] = "Please enter password to your account.";
  614. }
  615. else
  616. {
  617. $post_password = password_ency($post_password);
  618. if($post_password != $account_logged->getPassword()) {
  619. $change_email_errors[] = "Wrong password to account.";
  620. }
  621. }
  622. if(empty($change_email_errors)) {
  623. $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;
  624. $account_logged->setCustomField("email_new", $account_email_new);
  625. $account_logged->setCustomField("email_new_time", $account_email_new_time);
  626. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >New Email Address Requested</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have requested to change your email address to <b>'.$account_email_new.'</b>. The actual change will take place after <b>'.date("j F Y, H:i:s", $account_email_new_time).'</b>, during which you can cancel the request at any time.</td></tr> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  627. }
  628. else
  629. {
  630. //show errors
  631. $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br />';
  632. foreach($change_email_errors as $change_email_error) {
  633. $main_content .= '<li>'.$change_email_error;
  634. }
  635. $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';
  636. //show form
  637. $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br /><br /><form action="index.php?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Email Address</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table></div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  638. }
  639. }
  640. else
  641. {
  642. $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br /><br /><form action="index.php?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Email Address</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table></div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  643. }
  644. }
  645. else
  646. {
  647. if($account_email_new_time < time()) {
  648. if($_POST['changeemailsave'] == 1) {
  649. $account_logged->setCustomField("email_new", "");
  650. $account_logged->setCustomField("email_new_time", 0);
  651. $account_logged->setEmail($account_email_new);
  652. $account_logged->save();
  653. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Email Address Change Accepted</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have accepted <b>'.$account_logged->getEmail().'</b> as your new email adress.</td></tr> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  654. }
  655. else
  656. {
  657. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Email Address Change Accepted</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Do you accept <b>'.$account_email_new.'</b> as your new email adress?</td></tr> </table></div> </table></div></td></tr><br /><table width="100%"><tr><td width="30">&nbsp;</td><td align=left><form action="index.php?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$layout_name.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="index.php?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$layout_name.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30">&nbsp;</td></tr></table>';
  658. }
  659. }
  660. else
  661. {
  662. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change of Email Address</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>A request has been submitted to change the email address of this account to <b>'.$account_email_new.'</b>.<br />The actual change will take place on <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>.<br />If you do not want to change your email address, please click on "Cancel".</td></tr> </table></div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name="emailchangecancel" value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  663. }
  664. }
  665. if($_POST['emailchangecancel'] == 1) {
  666. $account_logged->setCustomField("email_new", "");
  667. $account_logged->setCustomField("email_new_time", 0);
  668. $main_content = '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Email Address Change Cancelled</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your request to change the email address of your account has been cancelled. The email address will not be changed.</td></tr> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  669. }
  670. }
  671.  
  672. //########### CHANGE PUBLIC INFORMATION (about account owner) ######################
  673. if($action == "changeinfo") {
  674. $new_rlname = htmlspecialchars(stripslashes(trim($_POST['info_rlname'])));
  675. $new_location = htmlspecialchars(stripslashes(trim($_POST['info_location'])));
  676. if($_POST['changeinfosave'] == 1) {
  677. //save data from form
  678. $account_logged->setRLName($new_rlname);
  679. $account_logged->setLocation($new_location);
  680. $account_logged->save();
  681. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information Changed</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your public information has been changed.</td></tr> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  682. }
  683. else
  684. {
  685. //show form
  686. $account_rlname = $account_logged->getRLName();
  687. $account_location = $account_logged->getLocation();
  688. $main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.<br /><br /><form action="index.php?subtopic=accountmanagement&action=changeinfo" method=post><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" ><input name="info_rlname" value="'.$account_rlname.'" size="30" maxlength="50" ></td></tr><tr><td class="LabelV" >Location:</td><td><input name="info_location" value="'.$account_location.'" size="30" maxlength="50" ></td></tr></table></div> </table></div></td></tr><br /><table width="100%"><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="changeinfosave" value="1" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  689. }
  690. }
  691.  
  692. //############## GENERATE RECOVERY KEY ###########
  693. if($action == "registeraccount")
  694. {
  695. $reg_password = password_ency(trim($_POST['reg_password']));
  696. $old_key = $account_logged->getRecoveryKey("key");
  697. if($_POST['registeraccountsave'] == "1")
  698. {
  699. if($reg_password == $account_logged->getPassword())
  700. {
  701. if(empty($old_key))
  702. {
  703. $dontshowtableagain = 1;
  704. $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890';
  705. $max = strlen($acceptedChars)-1;
  706. $new_rec_key = NULL;
  707. // 10 = number of chars in generated key
  708. for($i=0; $i < 22; $i++) {
  709. $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  710. $new_rec_key .= $cnum[$i];
  711. }
  712. $account_logged->setRecoveryKey($new_rec_key);
  713. $account_logged->save();
  714. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Account Registered</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" >Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following<br /><br /><font size="5">&nbsp;&nbsp;&nbsp;<b>Recovery Key: '.$new_rec_key.'</b></font><br /><br /><br /><b>Important:</b><ul><li>Write down this recovery key carefully.</li><li>Store it at a safe place!</li>';
  715. if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])
  716. {
  717. $mailBody = '<html>
  718. <body>
  719. <h3>New recovery key!</h3>
  720. <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a>.</p>
  721. <p>Recovery key: <b>'.$new_rec_key.'</b></p>
  722. </body>
  723. </html>';
  724. require("phpmailer/class.phpmailer.php");
  725. $mail = new PHPMailer();
  726. if ($config['site']['smtp_enabled'] == "yes")
  727. {
  728. $mail->IsSMTP();
  729. $mail->Host = $config['site']['smtp_host'];
  730. $mail->Port = (int)$config['site']['smtp_port'];
  731. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  732. $mail->Username = $config['site']['smtp_user'];
  733. $mail->Password = $config['site']['smtp_pass'];
  734. }
  735. else
  736. $mail->IsMail();
  737. $mail->IsHTML(true);
  738. $mail->From = $config['site']['mail_address'];
  739. $mail->AddAddress($account_logged->getEMail());
  740. $mail->Subject = $config['server']['serverName']." - recovery key";
  741. $mail->Body = $mailBody;
  742. if($mail->Send())
  743. $main_content .= '<br /><small>Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
  744. else
  745. $main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';
  746. }
  747. $main_content .= '</ul> </table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  748. }
  749. else
  750. $reg_errors[] = 'Your account is already registred.';
  751. }
  752. else
  753. $reg_errors[] = 'Wrong password to account.';
  754. }
  755. if($dontshowtableagain != 1)
  756. {
  757. //show errors if not empty
  758. if(!empty($reg_errors))
  759. {
  760. $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br />';
  761. foreach($reg_errors as $reg_error)
  762. $main_content .= '<li>'.$reg_error;
  763. $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';
  764. }
  765. //show form
  766. $main_content .= 'To generate recovery key for your account please enter your password.<br /><br />
  767. <form action="index.php?subtopic=accountmanagement&action=registeraccount" method="post" >
  768. <input type="hidden" name="registeraccountsave" value="1">
  769. <div class="TableContainer" >
  770. <table class="Table1" cellpadding="0" cellspacing="0" >
  771. <div class="CaptionContainer" >
  772. <div class="CaptionInnerContainer" >
  773. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  774. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  775. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  776. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  777. <div class="Text" >Generate recovery key</div>
  778. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  779. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  780. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  781. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  782. </div>
  783. </div>
  784. <tr>
  785. <td>
  786. <div class="InnerTableContainer" >
  787. <table style="width:100%;" >
  788. <tr>
  789. <td class="LabelV" ><span >Password:</td>
  790. <td><input type="password" name="reg_password" size="30" maxlength="29" ></td>
  791. </tr>
  792. </table>
  793. </div>
  794. </table>
  795. </div>
  796. </td>
  797. </tr>
  798. <br />
  799. <table style="width:100%" >
  800. <tr align="center" >
  801. <td>
  802. <table border="0" cellspacing="0" cellpadding="0" >
  803. <tr>
  804. <td style="border:0px;" >
  805. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  806. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  807. <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >
  808. </div>
  809. </div>
  810. </td>
  811. <tr>
  812. </form>
  813. </table>
  814. </td>
  815. <td>
  816. <table border="0" cellspacing="0" cellpadding="0" >
  817. <form action="?subtopic=accountmanagement&amp;action=manage" method="post" >
  818. <tr>
  819. <td style="border:0px;" >
  820. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  821. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  822. <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  823. </div>
  824. </div>
  825. </td>
  826. </tr>
  827. </form>
  828. </table>
  829. </td>
  830. </tr>
  831. </table>';
  832. }
  833. }
  834. //############## GENERATE NEW RECOVERY KEY ###########
  835. if($action == "newreckey"){
  836. $reg_password = password_ency(trim($_POST['reg_password']));
  837. $reckey = $account_logged->getRecoveryKey();
  838. if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))
  839. $main_content .= '
  840. <table border="0" cellspacing="1" cellpadding="4" width="100%">
  841. <tr bgcolor="'.$config['site']['vdarkborder'].'">
  842. <td class="white"><b>Error</b></td>
  843. </tr>
  844. <tr bgcolor='.$config['site']['darkborder'].'>
  845. <td>
  846. <table border="0" cellspacing="1" cellpadding="1">
  847. <tr>
  848. <td>You are not allowed to generate a new recovery key.</td>
  849. </tr>
  850. </table>
  851. </td>
  852. </tr>
  853. </table> ';
  854. else
  855. {
  856. $points = $account_logged->getPremiumPoints();
  857. if($_POST['registeraccountsave'] == "1")
  858. {
  859. if($reg_password == $account_logged->getPassword())
  860. {
  861. if($points >= $config['site']['generate_new_reckey_price'])
  862. {
  863. $dontshowtableagain = 1;
  864. $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890';
  865. $max = strlen($acceptedChars)-1;
  866. $new_rec_key = NULL;
  867. // 10 = number of chars in generated key
  868. for($i=0; $i < 22; $i++) {
  869. $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  870. $new_rec_key .= $cnum[$i];
  871. }
  872. $main_content .= '
  873. <div class="TableContainer" >
  874. <table class="Table1" cellpadding="0" cellspacing="0" >
  875. <div class="CaptionContainer" >
  876. <div class="CaptionInnerContainer" >
  877. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  878. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  879. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  880. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  881. <div class="Text" >Account Registered</div>
  882. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  883. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  884. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  885. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  886. </div>
  887. </div>
  888. <tr>
  889. <td>
  890. <div class="InnerTableContainer" >
  891. <table style="width:100%;" ><ul>';
  892. $mailBody = '
  893. <html>
  894. <body>
  895. <h3>New recovery key!</h3>
  896. <p>You or someone else generated recovery key to your account on server <b>'.$config['server']['serverName'].'</b>.</p>
  897. <p>Recovery key: <b>'.$new_rec_key.'</b></p>
  898. </body>
  899. </html>';
  900. require("phpmailer/class.phpmailer.php");
  901. $mail = new PHPMailer();
  902. if ($config['site']['smtp_enabled'] == "yes")
  903. {
  904. $mail->IsSMTP();
  905. $mail->Host = $config['site']['smtp_host'];
  906. $mail->Port = (int)$config['site']['smtp_port'];
  907. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  908. $mail->Username = $config['site']['smtp_user'];
  909. $mail->Password = $config['site']['smtp_pass'];
  910. }
  911. else
  912. $mail->IsMail();
  913. $mail->IsHTML(true);
  914. $mail->From = $config['site']['mail_address'];
  915. $mail->AddAddress($account_logged->getEMail());
  916. $mail->Subject = $config['server']['serverName']." - new recovery key";
  917. $mail->Body = $mailBody;
  918. if($mail->Send())
  919. {
  920. $account_logged->setRecoveryKey(new_rec_key);
  921. $account_logged->setPremiumPoints($account_logged->getPremiumPoints()-$config['site']['generate_new_reckey_price']);
  922. $account_logged->save();
  923. $main_content .= '<br />Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b> for '.$config['site']['generate_new_reckey_price'].' premium points.';
  924. }
  925. else
  926. $main_content .= 'An error occorred while sending email (<b>'.$account_logged->getEMail().'</b>) with recovery key! Recovery key not changed. Try again later.';
  927. $main_content .= '</ul></table></div> </table></div></td></tr><br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  928. }
  929. else
  930. $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';
  931. }
  932. else
  933. $reg_errors[] = 'Wrong password to account.';
  934. }
  935. if($dontshowtableagain != 1)
  936. {
  937. //show errors if not empty
  938. if(!empty($reg_errors))
  939. {
  940. $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br />';
  941. foreach($reg_errors as $reg_error)
  942. $main_content .= '<li>'.$reg_error;
  943. $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';
  944. }
  945. //show form
  946. $main_content .= 'To generate NEW recovery key for your account please enter your password.<br /><font color="red"><b>New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points.</font><br />You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><br /><br /><form action="index.php?subtopic=accountmanagement&action=newreckey" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Generate recovery key</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td>';
  947. if ($account_logged->getCustomField("premium_points") < $config['site']['generate_new_reckey_price']){
  948. $main_content .='<input type="text" name="" size="35" value="You no have premium points to buy" disabled="disabled" >';
  949. }
  950. else
  951. {
  952. $main_content .='<input type="password" name="reg_password" size="30" maxlength="29" >';
  953. }
  954. $main_content .='</td></tr> </table></div> </table></div></td></tr><br /><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&amp;action=manage" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  955. }
  956. }
  957. }
  958. //###### CHANGE CHARACTER COMMENT ######
  959. if($action == "changecomment") {
  960. $player_name = stripslashes($_REQUEST['name']);
  961. $new_comment = htmlspecialchars(stripslashes(substr(trim($_POST['comment']),0,2000)));
  962. $new_hideacc = (int) $_POST['accountvisible'];
  963. $new_showskills = (int) $_POST['showskills'];
  964. $show_outfit = (int) $_POST['show_outfit'];
  965. $show_eq = (int) $_POST['show_eq'];
  966.  
  967. if(check_name($player_name)) {
  968. $player = $ots->createObject('Player');
  969. $player->find($player_name);
  970. if($player->isLoaded()) {
  971. $player_account = $player->getAccount();
  972. if($account_logged->getId() == $player_account->getId()) {
  973. if($_POST['changecommentsave'] == 1) {
  974. $player->setCustomField("hide_char", $new_hideacc);
  975. $player->setCustomField("show_eq", $show_eq);
  976. $player->setCustomField("comment", $new_comment);
  977. $player->setCustomField("show_outfit", $show_outfit);
  978. $main_content .= '
  979. <form action="index.php?subtopic=accountmanagement" method="post">
  980. <div class="TableContainer" >
  981. <table class="Table1" cellpadding="0" cellspacing="0" >
  982. <div class="CaptionContainer" >
  983. <div class="CaptionInnerContainer" >
  984. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  985. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  986. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  987. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  988. <div class="Text" >Character Information Changed</div>
  989. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  990. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  991. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  992. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  993. </div>
  994. </div>
  995. <tr>
  996. <td>
  997. <div class="InnerTableContainer" >
  998. <table style="width:100%;" >
  999. <tr>
  1000. <td>The character information has been changed.</td>
  1001. </tr>
  1002. </table>
  1003. </div>
  1004. </table>
  1005. </div>
  1006. </td>
  1007. </tr>
  1008. <br />
  1009. <center>
  1010. <table border="0" cellspacing="0" cellpadding="0" >
  1011. <tr>
  1012. <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1013. }
  1014. else
  1015. {
  1016. $main_content .= 'Here you can see and edit the information about your character.<br />If you do not want to specify a certain field, just leave it blank.<br /><br />
  1017. <div class="TopButtonContainer" >
  1018. <div class="TopButton" >
  1019. <a href="#top" >
  1020. <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />
  1021. </a>
  1022. </div>
  1023. </div>
  1024. <div class="TableContainer" >
  1025. <table class="Table5" cellpadding="0" cellspacing="0" >
  1026. <div class="CaptionContainer" >
  1027. <div class="CaptionInnerContainer" >
  1028. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1029. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1030. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1031. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1032. <div class="Text" >Character Data</div>
  1033. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  1034. </span>
  1035. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1036. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1037. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1038. </div>
  1039. </div>
  1040. <tr>
  1041. <td>
  1042. <div class="InnerTableContainer" >
  1043. <table style="width:100%;" >
  1044. <tr>
  1045. <td>
  1046. <div class="TableShadowContainerRightTop" >
  1047. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1048. </div>
  1049. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  1050. <div class="TableContentContainer" >
  1051. <table class="TableContent" width="100%" >
  1052. <tr>
  1053. <td class="LabelV" style="vertical-align:middle;">Name:</td>
  1054. <td style="width:80%;" >'.$player_name.'</td>
  1055. </tr>
  1056. <tr>
  1057. <td class="LabelV" style="vertical-align:middle;" >World:</td>
  1058. <td style="width:80%;" >'.$config['server']['serverName'].'</td>
  1059. </tr>';
  1060. if ($player->getCustomField("sex") > 0){
  1061. $main_content .='
  1062. <tr>
  1063. <td class="LabelV" style="vertical-align:middle;">Sex:</td>
  1064. ';
  1065. $sex_types = array (1 => 'male', 0 => 'female');
  1066. $main_content .='
  1067. <td>'.$sex_types[$player->getCustomField("sex")].'</td>
  1068. </tr>';
  1069. }
  1070. $main_content .='
  1071. </table>
  1072. </div>
  1073. </div>
  1074. <div class="TableShadowContainer">
  1075. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  1076. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  1077. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  1078. </div>
  1079. </div>
  1080. </td>
  1081. </tr>
  1082. </td>
  1083. </tr>
  1084. </table>
  1085. </div>
  1086. </table>
  1087. </div>
  1088. </td>
  1089. </tr>
  1090. <br />
  1091. <form action="index.php?subtopic=accountmanagement&action=changecomment" method="post" >
  1092. <div class="TableContainer" >
  1093. <table class="Table5" cellpadding="0" cellspacing="0" >
  1094. <div class="CaptionContainer" >
  1095. <div class="CaptionInnerContainer" >
  1096. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1097. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1098. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1099. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1100. <div class="Text" >Edit Character Information</div>
  1101. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1102. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1103. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1104. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1105. </div>
  1106. </div>
  1107. <tr>
  1108. <td>
  1109. <div class="InnerTableContainer" >
  1110. <table style="width:100%;" >
  1111. <tr>
  1112. <td>
  1113. <div class="TableShadowContainerRightTop" >
  1114. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1115. </div>
  1116. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  1117. <div class="TableContentContainer">
  1118. <table class="TableContent" width="100%" >
  1119. <tr>
  1120. <td class="LabelV" >Equipment Shower:</td><td>
  1121. ';
  1122. if ($player->getCustomField("show_eq") == 1){
  1123. $main_content .='<input type="checkbox" name="show_eq" value="1" checked="checked">&nbsp;<small>Visível</small>';
  1124. }else{
  1125. $main_content .='<input type="checkbox" name="show_eq" value="1" >&nbsp;<small>Invisível</small>';
  1126. }
  1127. $main_content .= '</td>
  1128. </tr>
  1129. <tr>
  1130. <td class="LabelV" >Outfit Shower:</td><td>
  1131. ';
  1132. if ($player->getCustomField("show_outfit") == 1){
  1133. $main_content .='<input type="checkbox" name="show_outfit" value="1" checked="checked">&nbsp;<small>Visível</small>';
  1134. }else{
  1135. $main_content .='<input type="checkbox" name="show_outfit" value="1" >&nbsp;<small>Invisível</small>';
  1136. }
  1137. $main_content .= '</td>
  1138. </tr>
  1139. <tr>
  1140. <td class="LabelV" >Hide Account:</td><td>';
  1141. if($player->getCustomField("hide_char") == 1)
  1142. {
  1143. $main_content .= '<input type="checkbox" name="accountvisible" value="1" checked="checked">';
  1144. }
  1145. else
  1146. {
  1147. $main_content .= '<input type="checkbox" name="accountvisible" value="1" >';
  1148. }
  1149.  
  1150. $main_content .= ' check to hide your account information</td>
  1151. </tr>
  1152. <tr><td><b>Comment:</b></td>
  1153. <td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual">'.$player->getCustomField("comment").'</textarea><br />[max. length: 2000 chars, 50 lines (ENTERs)]<br />
  1154. <Small><b>BBCode:</b> OFF</small></td>
  1155. </tr>';
  1156.  
  1157.  
  1158. $main_content .= '</table>
  1159. </div>
  1160. </div>
  1161. <div class="TableShadowContainer" >
  1162. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  1163. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  1164. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  1165. </div>
  1166. </div>
  1167. </td>
  1168. </tr>
  1169. <tr>
  1170. <td>
  1171. </table>
  1172. </div>
  1173. </div>
  1174. </td>
  1175. </tr>
  1176. <tr>
  1177. <td>
  1178. </td>
  1179. </tr>
  1180. </td>
  1181. </tr>
  1182. </table>
  1183. </table>
  1184. </div>
  1185. </td>
  1186. </tr>
  1187. <br />
  1188. <table style="width:100%" >
  1189. <tr align="center" >
  1190. <td><table border="0" cellspacing="0" cellpadding="0" >
  1191. <tr><td style="border:0px;" ><input type="hidden" name="name" value="'.$player->getName().'"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1192. } }
  1193. else
  1194. {
  1195. $main_content .= '<div class="notice">Player <b>'.$player_name.'</b> is not on your account !</div><br />
  1196. <table border="0" cellpadding="0" cellspacing="0">
  1197. <tbody>
  1198. <tr>
  1199. <td style="border: 0px none;">
  1200. <a href="javascript:void();" onclick=location.href="index.php?subtopic=accountmanagement">
  1201. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  1202. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif); visibility: hidden;"></div>
  1203. <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
  1204. </table>';
  1205. }
  1206. }
  1207. else
  1208. {
  1209. $main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">
  1210. <tr BGCOLOR="'.$config['site']['vdarkborder'].'">
  1211. <td CLASS="white"><b>Error</b></td>
  1212. </tr>
  1213. <tr BGCOLOR='.$config['site']['darkborder'].'>
  1214. <td>Error. Character with this name doesn\'t exist.</td>
  1215. </tr>
  1216. </TABLE>
  1217. <br />
  1218. <center>
  1219. <table border="0" cellpadding="0" cellspacing="0">
  1220. <tbody>
  1221. <tr>
  1222. <td style="border: 0px none;">
  1223. <div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">
  1224. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  1225. <form action="?subtopic=accountmanagement" method="post">
  1226. <input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">
  1227. </form>
  1228. </div>
  1229. </div>
  1230. </td>
  1231. </tr>
  1232. </tbody>
  1233. </table>
  1234. </center>';
  1235. }
  1236. }
  1237. else
  1238. {
  1239. $main_content .= "Error. Name contain illegal characters.";
  1240. }
  1241. }
  1242.  
  1243. //### NEW NICK - set new nick proposition ###
  1244. if($action == "newnick")
  1245. {
  1246. $name = $_GET['name'];
  1247. $name_new = stripslashes(ucwords(strtolower(trim($_GET['name_new']))));
  1248. if(!empty($name) && !empty($name_new))
  1249. {
  1250. if(check_name_new_char($name_new))
  1251. {
  1252. $player = $ots->createObject('Player');
  1253. $player->find($name);
  1254. if($player->isLoaded() && $player->isNameLocked())
  1255. {
  1256. $player_account = $player->getAccount();
  1257. if($account_logged->getId() == $player_account->getId())
  1258. {
  1259. if(!$player->getOldName())
  1260. if(!$player->isOnline())
  1261. {
  1262. $player->setCustomField('old_name', $name_new);
  1263. $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >New nick proposition</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <b>'.$name.'</b> new nick proposition <b>'.$name_new.'</b> has been set. Now you must wait for acceptation from GM.</td></tr> </table></div> </table></div></td></tr>';
  1264. }
  1265. else
  1266. $main_content .= 'This character is online.';
  1267. else
  1268. $main_content .= 'You already set new name for this character ( <b>'.$player->getOldName().'</b> ). You must wait until GM accept/reject your proposition.';
  1269. }
  1270. else
  1271. $main_content .= 'Character <b>'.$player_name.'</b> is not on your account.';
  1272. }
  1273. else
  1274. $main_content .= 'Character with this name doesn\'t exist or isn\'t name locked.';
  1275. }
  1276. else
  1277. $main_content .= 'Name contain illegal characters. Invalid format or lenght.';
  1278. }
  1279. else
  1280. $main_content .= 'Please enter new char name.';
  1281. $main_content .= '<br /><center><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1282. }
  1283.  
  1284. //### DELETE character from account ###
  1285. if($action == "deletecharacter") {
  1286. $player_name = stripslashes(trim($_GET['name']));
  1287. $password_verify = trim($_POST['delete_password']);
  1288. $password_verify = password_ency($password_verify);
  1289. if($_POST['deletecharactersave'] == 1) {
  1290. if(!empty($player_name) && !empty($password_verify)) {
  1291. if(check_name($player_name)) {
  1292. $player = $ots->createObject('Player');
  1293. $player->find($player_name);
  1294. if($player->isLoaded()) {
  1295. $player_account = $player->getAccount();
  1296. if($account_logged->getId() == $player_account->getId()) {
  1297. if($password_verify == $account_logged->getPassword()) {
  1298. if(!$player->isOnline())
  1299. {
  1300. // show table "delete character" again
  1301. $dontshowtableagain = 1;
  1302. //delete player
  1303. $player->setCustomField('deleted', 1);
  1304. $main_content .= '
  1305. <div class="TableContainer" >
  1306. <table class="Table1" cellpadding="0" cellspacing="0" >
  1307. <div class="CaptionContainer" >
  1308. <div class="CaptionInnerContainer" >
  1309. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1310. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1311. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1312. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1313. <div class="Text" >Character Deleted</div>
  1314. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1315. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1316. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1317. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1318. </div>
  1319. </div>
  1320. <tr>
  1321. <td>
  1322. <div class="InnerTableContainer">
  1323. <table style="width:100%;" >
  1324. <tr>
  1325. <td>The character <b>'.$player_name.'</b> has been deleted.</td>
  1326. </tr>
  1327. </table>
  1328. </div>
  1329. </table>
  1330. </div>
  1331. </td>
  1332. </tr>
  1333. <br />
  1334. <center>
  1335. <table border="0" cellspacing="0" cellpadding="0" >
  1336. <form action="index.php?subtopic=accountmanagement" method="post" >
  1337. <tr>
  1338. <td style="border:0px;" >
  1339. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1340. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1341. <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  1342. </div>
  1343. </div>
  1344. </td>
  1345. </tr>
  1346. </form>
  1347. </table>
  1348. </center>';
  1349. }
  1350. else
  1351. $delete_errors[] = 'This character is online.';
  1352. }
  1353. else
  1354. {
  1355. $delete_errors[] = 'Wrong password to account.';
  1356. }
  1357. }
  1358. else
  1359. {
  1360. $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
  1361. }
  1362. }
  1363. else
  1364. {
  1365. $delete_errors[] = 'Character with this name doesn\'t exist.';
  1366. }
  1367. }
  1368. else
  1369. {
  1370. $delete_errors[] = 'Name contain illegal characters.';
  1371. }
  1372. }
  1373. else
  1374. {
  1375. $delete_errors[] = 'Character name or/and password is empty. Please fill in form.';
  1376. }
  1377. }
  1378. if($dontshowtableagain != 1) {
  1379. if(!empty($delete_errors)) {
  1380. $main_content .= '<div class="SmallBox" >
  1381. <div class="MessageContainer" >
  1382. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1383. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1384. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1385. <div class="ErrorMessage" >
  1386. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1387. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1388. <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br />';
  1389. foreach($delete_errors as $delete_error) {
  1390. $main_content .= '<li>'.$delete_error;
  1391. }
  1392. $main_content .= '</div>
  1393. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1394. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1395. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1396. </div>
  1397. </div>
  1398. <br />';
  1399. }
  1400. $main_content .= 'To delete this character enter your password and click on "Submit".
  1401. You can undelete the character within the first 2 months (60 days) after the deletion.
  1402. After this time the character is deleted for good and cannot be restored anymore!<br /><br />
  1403. <form action="index.php?subtopic=accountmanagement&action=deletecharacter&name='.$player_name.'" method="post" >
  1404. <input type="hidden" name="deletecharactersave" value="1">
  1405. <div class="TableContainer" >
  1406. <table class="Table1" cellpadding="0" cellspacing="0" >
  1407. <div class="CaptionContainer" >
  1408. <div class="CaptionInnerContainer" >
  1409. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1410. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1411. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1412. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1413. <div class="Text" >Delete Character</div>
  1414. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1415. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1416. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1417. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1418. </div>
  1419. </div>
  1420. <tr>
  1421. <td>
  1422. <div class="InnerTableContainer" >
  1423. <table style="width:100%;" >
  1424. <tr>
  1425. <td class="LabelV" ><span >Character Name:</td>
  1426. <td style="width:90%;" >'.$player_name.'</td>
  1427. </tr>
  1428. <tr>
  1429. <td class="LabelV" ><span >Password:</td>
  1430. <td><input type="password" name="delete_password" size="30" maxlength="29" ></td>
  1431. </tr>
  1432. </table>
  1433. </div>
  1434. </table>
  1435. </div>
  1436. </td>
  1437. </tr>
  1438. <br />
  1439. <table style="width:100%" >
  1440. <tr align="center" >
  1441. <td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1442. }
  1443. }
  1444.  
  1445.  
  1446. //### UNDELETE character from account ###
  1447. if($action == "undelete")
  1448. {
  1449. $player_name = stripslashes(trim($_GET['name']));
  1450. if(!empty($player_name))
  1451. {
  1452. if(check_name($player_name))
  1453. {
  1454. $player = $ots->createObject('Player');
  1455. $player->find($player_name);
  1456. if($player->isLoaded())
  1457. {
  1458. $player_account = $player->getAccount();
  1459. if($account_logged->getId() == $player_account->getId())
  1460. {
  1461. if(!$player->isOnline())
  1462. {
  1463. $player->setCustomField('deleted', 0);
  1464. $main_content .= '<div class="TableContainer" >
  1465. <table class="Table1" cellpadding="0" cellspacing="0" >
  1466. <div class="CaptionContainer" >
  1467. <div class="CaptionInnerContainer" >
  1468. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1469. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1470. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1471. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1472. <div class="Text" >Character Undeleted</div>
  1473. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1474. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1475. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1476. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1477. </div>
  1478. </div>
  1479. <tr>
  1480. <td><div class="InnerTableContainer" >
  1481. <table style="width:100%;" >
  1482. <tr>
  1483. <td>The character <b>'.$player_name.'</b> has been undeleted.</td>
  1484. </tr>
  1485. </table>
  1486. </div>
  1487. </table>
  1488. </div>
  1489. </td>
  1490. </tr>
  1491. <br />
  1492. <center>
  1493. <table border="0" cellspacing="0" cellpadding="0" >
  1494. <form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1495. }
  1496. else
  1497. $delete_errors[] = 'This character is online.';
  1498. }
  1499. else
  1500. $delete_errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
  1501. }
  1502. else
  1503. $delete_errors[] = 'Character with this name doesn\'t exist.';
  1504. }
  1505. else
  1506. $delete_errors[] = 'Name contain illegal characters.';
  1507. }
  1508. }
  1509. //## CREATE CHARACTER on account ###
  1510. if($action == "createcharacter"){
  1511. if(count($config['site']['worlds']) > 1){
  1512. if(isset($_REQUEST['world']))
  1513. $world_id = (int) $_REQUEST['world'];
  1514. }
  1515. else
  1516. $world_id = 0;
  1517. if(!isset($world_id)){
  1518. $main_content .= 'Before you can create character you must select world: ';
  1519. foreach($config['site']['worlds'] as $id => $world_n)
  1520. $main_content .= '<br /><a href="index.php?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.$world_n.'</a>';
  1521. $main_content .= '<br /><h3><a href="index.php?subtopic=accountmanagement">BACK</a></h3>';
  1522. }else{
  1523. $main_content .= '
  1524. <script type="text/javascript">
  1525. var nameHttp;
  1526.  
  1527. function checkName()
  1528. {
  1529. if(document.getElementById("newcharname").value=="")
  1530. {
  1531. document.getElementById("name_check").innerHTML = \'<font color="red">Please enter new character name.</font>\';
  1532. return;
  1533. }
  1534. nameHttp=GetXmlHttpObject();
  1535. if (nameHttp==null)
  1536. {
  1537. return;
  1538. }
  1539. var newcharname = document.getElementById("newcharname").value;
  1540. var url="ajax/check_name.php?name=" + newcharname + "&uid="+Math.random();
  1541. nameHttp.onreadystatechange=NameStateChanged;
  1542. nameHttp.open("GET",url,true);
  1543. nameHttp.send(null);
  1544. }
  1545.  
  1546. function NameStateChanged()
  1547. {
  1548. if (nameHttp.readyState==4)
  1549. {
  1550. document.getElementById("name_check").innerHTML=nameHttp.responseText;
  1551. }
  1552. }
  1553. </script>';
  1554. $newchar_name = stripslashes(ucwords(strtolower(trim($_POST['newcharname']))));
  1555. $newchar_sex = $_POST['newcharsex'];
  1556. $newchar_vocation = $_POST['newcharvocation'];
  1557. $newchar_town = $_POST['newchartown'];
  1558. if($_POST['savecharacter'] != 1)
  1559. {
  1560. $main_content .= 'Please choose a name';
  1561. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1562. $main_content .= ', vocation';
  1563. $main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="index.php?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br />';
  1564. if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
  1565. $main_content .= '<br /><TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
  1566. <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
  1567. <TD CLASS=white><b>Erro</b></td>
  1568. </TR>
  1569. <TR BGCOLOR='.$config['site']['darkborder'].'><TD><b><font color="red">You have maximum number of characters per account on your account. Delete one before you make new.</font></b></TD>
  1570. </TR></TABLE>';
  1571. $main_content .= '<br /><form action="index.php?subtopic=accountmanagement&action=createcharacter" method="post" >
  1572. <input type="hidden" name="world" value="'.$world_id.'" >
  1573. <input type="hidden" name=savecharacter value="1" >
  1574. <div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" >
  1575. <div class="CaptionContainer" >
  1576. <div class="CaptionInnerContainer" >
  1577. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1578. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1579. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1580. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1581. <div class="Text" >Create Character</div>
  1582. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1583. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1584. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1585. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1586. </div>
  1587. </div>
  1588. <tr>
  1589. <td>
  1590. <div class="InnerTableContainer" >
  1591. <table style="width:100%;" >
  1592. <tr>
  1593. <td>
  1594. <div class="TableShadowContainerRightTop" >
  1595. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1596. </div>
  1597. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  1598. <div class="TableContentContainer" >
  1599. <table class="TableContent" width="100%" >
  1600. <tr class="LabelH" >
  1601. <td style="width:50%;" ><span >Name</td>
  1602. <td><span >Sex</td>
  1603. </tr>
  1604. <tr class="Odd" >
  1605. <td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><br />
  1606. <font size="1" face="verdana,arial,helvetica">
  1607. <div id="name_check">Please enter your character name.</div>
  1608. </font>
  1609. </td>
  1610. <td>';
  1611. $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1612. if($newchar_sex == 1)
  1613. $main_content .= 'checked="checked" ';
  1614. $main_content .= '>male<br />';
  1615. $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1616. if($newchar_sex == "0")
  1617. $main_content .= 'checked="checked" ';
  1618. $main_content .= '>female<br /></td></tr></table></div></div></table></div>';
  1619. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1620. $main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';
  1621. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1622. {
  1623. $main_content .= '<td>
  1624. <table class="TableContent" width="100%" >
  1625. <tr class="Odd" valign="top">
  1626. <td width="160">
  1627. <br /><b>Select your vocation:</b></td>
  1628. <td><table class="TableContent" width="100%" >';
  1629. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1630. {
  1631. $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  1632. if($newchar_vocation == $char_vocation_key)
  1633. $main_content .= 'checked="checked" ';
  1634. $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
  1635. }
  1636. $main_content .= '</table></table></td>';
  1637. }
  1638. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1639. {
  1640. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1641. foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1642. {
  1643. $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  1644. if($newchar_town == $town_id)
  1645. $main_content .= 'checked="checked" ';
  1646. $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
  1647. }
  1648. $main_content .= '</table></table></td>';
  1649. }
  1650. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1651. $main_content .= '</tr></table></div>';
  1652. $main_content .= '</table></div></td></tr><br /><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1653. }
  1654. else
  1655. {
  1656. if(empty($newchar_name))
  1657. $newchar_errors[] = 'Please enter a name for your character!';
  1658. if(empty($newchar_sex) && $newchar_sex != "0")
  1659. $newchar_errors[] = 'Please select the sex for your character!';
  1660. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1661. {
  1662. if(empty($newchar_vocation))
  1663. $newchar_errors[] = 'Please select a vocation for your character.';
  1664. }
  1665. else
  1666. $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];
  1667. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1668. {
  1669. if(empty($newchar_town))
  1670. $newchar_errors[] = 'Please select a town for your character.';
  1671. }
  1672. else
  1673. $newchar_town = $config['site']['newchar_towns'][$world_id][0];
  1674. if(empty($newchar_errors))
  1675. {
  1676. if(!check_name_new_char($newchar_name))
  1677. $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
  1678. if($newchar_sex != 1 && $newchar_sex != "0")
  1679. $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
  1680. if(!in_array($newchar_town, $config['site']['newchar_towns'][$world_id]))
  1681. $newchar_errors[] = 'Please select valid town.';
  1682. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1683. {
  1684. $newchar_vocation_check = FALSE;
  1685. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1686. if($newchar_vocation == $char_vocation_key)
  1687. $newchar_vocation_check = TRUE;
  1688. if(!$newchar_vocation_check)
  1689. $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
  1690. }
  1691. else
  1692. $newchar_vocation = 0;
  1693. }
  1694. if(empty($newchar_errors))
  1695. {
  1696. $check_name_in_database = $ots->createObject('Player');
  1697. $check_name_in_database->find($newchar_name);
  1698. if($check_name_in_database->isLoaded())
  1699. $newchar_errors[] .= 'This name is already used. Please choose another name!';
  1700. $number_of_players_on_account = $account_logged->getPlayersList()->count();
  1701. if($number_of_players_on_account >= $config['site']['max_players_per_account'])
  1702. $newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';
  1703. }
  1704. if(empty($newchar_errors))
  1705. {
  1706. $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];
  1707. $char_to_copy = new OTS_Player();
  1708. $char_to_copy->find($char_to_copy_name);
  1709. if(!$char_to_copy->isLoaded())
  1710. $newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy'.$char_to_copy_name.'</b> doesn\'t exist.';
  1711. }
  1712. if(empty($newchar_errors))
  1713. {
  1714. if($newchar_sex == "0")
  1715. $char_to_copy->setLookType(136);
  1716. $player = $ots->createObject('Player');
  1717. $player->setName($newchar_name);
  1718. $player->setAccount($account_logged);
  1719. $player->setGroup($char_to_copy->getGroup());
  1720. $player->setSex($newchar_sex);
  1721. $player->setVocation($char_to_copy->getVocation());
  1722. $player->setConditions($char_to_copy->getConditions());
  1723. $player->setRank($char_to_copy->getRank());
  1724. $player->setLookAddons($char_to_copy->getLookAddons());
  1725. $player->setTownId($newchar_town);
  1726. $player->setExperience($char_to_copy->getExperience());
  1727. $player->setLevel($char_to_copy->getLevel());
  1728. $player->setMagLevel($char_to_copy->getMagLevel());
  1729. $player->setHealth($char_to_copy->getHealth());
  1730. $player->setHealthMax($char_to_copy->getHealthMax());
  1731. $player->setMana($char_to_copy->getMana());
  1732. $player->setManaMax($char_to_copy->getManaMax());
  1733. $player->setManaSpent($char_to_copy->getManaSpent());
  1734. $player->setSoul($char_to_copy->getSoul());
  1735. $player->setDirection($char_to_copy->getDirection());
  1736. $player->setLookBody($char_to_copy->getLookBody());
  1737. $player->setLookFeet($char_to_copy->getLookFeet());
  1738. $player->setLookHead($char_to_copy->getLookHead());
  1739. $player->setLookLegs($char_to_copy->getLookLegs());
  1740. $player->setLookType($char_to_copy->getLookType());
  1741. $player->setCap($char_to_copy->getCap());
  1742. $player->setPosX(0);
  1743. $player->setPosY(0);
  1744. $player->setPosZ(0);
  1745. $player->setLossExperience($char_to_copy->getLossExperience());
  1746. $player->setLossMana($char_to_copy->getLossMana());
  1747. $player->setLossSkills($char_to_copy->getLossSkills());
  1748. $player->setLossItems($char_to_copy->getLossItems());
  1749. $player->save();
  1750. unset($player);
  1751. $player = $ots->createObject('Player');
  1752. $player->find($newchar_name);
  1753. if($player->isLoaded())
  1754. {
  1755. $player->setCustomField('world_id', (int) $world_id);
  1756. $player->setSkill(0,$char_to_copy->getSkill(0));
  1757. $player->setSkill(1,$char_to_copy->getSkill(1));
  1758. $player->setSkill(2,$char_to_copy->getSkill(2));
  1759. $player->setSkill(3,$char_to_copy->getSkill(3));
  1760. $player->setSkill(4,$char_to_copy->getSkill(4));
  1761. $player->setSkill(5,$char_to_copy->getSkill(5));
  1762. $player->setSkill(6,$char_to_copy->getSkill(6));
  1763. $player->save();
  1764. $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
  1765. foreach($loaded_items_to_copy as $save_item)
  1766. $SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
  1767. $main_content .= '
  1768. <div class="TableContainer" >
  1769. <table class="Table1" cellpadding="0" cellspacing="0" >
  1770. <div class="CaptionContainer" >
  1771. <div class="CaptionInnerContainer" >
  1772. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  1773. </span>
  1774. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  1775. </span>
  1776. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1777. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1778. <div class="Text" >Character Created</div>
  1779. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1780. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1781. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1782. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1783. </div>
  1784. </div>
  1785. <tr>
  1786. <td>
  1787. <div class="InnerTableContainer" >
  1788. <table style="width:100%;" >
  1789. <tr>
  1790. <td>The character <b>'.$newchar_name.'</b> has been created.<br />Please select the outfit when you log in for the first time.<br /><br /><b>See you on '.$config['server']['serverName'].'!</b></td>
  1791. </tr>
  1792. </table>
  1793. </div>
  1794. </table>
  1795. </div>
  1796. </td>
  1797. </tr>
  1798. <br />
  1799. <center>
  1800. <table border="0" cellspacing="0" cellpadding="0" >
  1801. <form action="index.php?subtopic=accountmanagement" method="post" >
  1802. <tr>
  1803. <td style="border:0px;" >
  1804. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1805. }
  1806. else
  1807. {
  1808. echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
  1809. exit;
  1810. }
  1811. }
  1812. else
  1813. {
  1814. $main_content .= '
  1815. <div class="SmallBox" >
  1816. <div class="MessageContainer" >
  1817. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1818. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1819. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1820. <div class="ErrorMessage" >
  1821. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1822. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1823. <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  1824. <b>The Following Errors Have Occurred:</b><br />';
  1825. foreach($newchar_errors as $newchar_error)
  1826. $main_content .= '<li>'.$newchar_error;
  1827. $main_content .= '</div>
  1828. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1829. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1830. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1831. </div>
  1832. </div>
  1833. <br />';
  1834. $main_content .= 'Please choose a name';
  1835. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1836. $main_content .= ', vocation';
  1837. $main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="index.php?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br /><br /><form action="index.php?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><br /><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';
  1838. $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1839. if($newchar_sex == 1)
  1840. $main_content .= 'checked="checked" ';
  1841. $main_content .= '>male<br />';
  1842. $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1843. if($newchar_sex == "0")
  1844. $main_content .= 'checked="checked" ';
  1845. $main_content .= '>female<br /></td></tr></table></div></div></table></div>';
  1846. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1847. $main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';
  1848. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1849. {
  1850. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  1851. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1852. {
  1853. $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  1854. if($newchar_vocation == $char_vocation_key)
  1855. $main_content .= 'checked="checked" ';
  1856. $main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
  1857. }
  1858. $main_content .= '</table></table></td>';
  1859. }
  1860. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1861. {
  1862. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1863. foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1864. {
  1865. $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  1866. if($newchar_town == $town_id)
  1867. $main_content .= 'checked="checked" ';
  1868. $main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';
  1869. }
  1870. $main_content .= '</table></table></td>';
  1871. }
  1872. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1873. $main_content .= '</tr></table></div>';
  1874. $main_content .= '</table></div></td></tr><br /><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="index.php?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1875. }
  1876. }
  1877. }
  1878. }
  1879. }
  1880. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement