diff --git a/system/init.php b/system/init.php index e4e7d748..18c67048 100644 --- a/system/init.php +++ b/system/init.php @@ -39,6 +39,7 @@ $function = new Twig_SimpleFunction('getStyle', function ($i) { return getStyle($i); }); $twig->addFunction($function); +$twig->addGlobal('config', $config); // trim values we receive if(isset($_POST)) diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 4cd4bdf4..0f453042 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -21,111 +21,19 @@ $dontshowtableagain = false; $config_salt_enabled = fieldExist('salt', 'accounts'); if(!$logged) { - if($action == "logout") - echo '<div class="TableContainer">' . - '<table class="Table1" cellpadding="0" cellspacing="0" >' . - '<div class="CaptionContainer">' . - '<div class="CaptionInnerContainer" >' . - '<span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);"/></span>' . - '<span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);"/></span>' . - '<span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span>' . - '<span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);"/></span>' . - '<div class="Text">Logout Successful</div>' . - '<span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);"/></span> - <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> - <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);"/></span> - <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);"/></span> - </div> - </div> - <tr> - <td> - <div class="InnerTableContainer"> - <table style="width:100%;"> - <tr> - <td>You have logged out of your '.$config['lua']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td> - </tr> - </table> - </div> - </table> - </div> - </td> - </tr>'; + if($action == "logout") { + echo $twig->render('account.logout.html'); + } else { if(!empty($errors)) output_errors($errors); - ?> -Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/> - <form action="?subtopic=accountmanagement" method="post" > - <?php if(isset($_REQUEST['redirect'])): ?> - <input type="hidden" name="redirect" value="<?php echo $_REQUEST['redirect']; ?>" /> - <?php endif; ?> - <div class="TableContainer" > - <table class="Table1" cellpadding="0" cellspacing="0" > - <div class="CaptionContainer" > - <div class="CaptionInnerContainer" > - <span class="CaptionEdgeLeftTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionEdgeRightTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionBorderTop" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> - <span class="CaptionVerticalLeft" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> - <div class="Text" >Account Login</div> - <span class="CaptionVerticalRight" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> - <span class="CaptionBorderBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> - <span class="CaptionEdgeLeftBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionEdgeRightBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - </div> - </div> - <tr> - <td><div class="InnerTableContainer" > - <table style="width:100%;" > - <tr> - <td class="LabelV" > - <span<?php echo (isset($errors[0]) ? ' class="red"' : ''); ?>>Account <?php echo (USE_ACCOUNT_NAME ? 'Name' : 'Number'); ?>:</span> - </td> - <td style="width:100%;" ><input type="password" name="account_login" id="account-name-input" size="30" maxlength="30" ></td> - </tr> - <tr> - <td class="LabelV" > - <span<?php echo (isset($errors[0]) ? ' class="red"' : ''); ?>>Password:</span> - </td> - <td><input type="password" name="password_login" size="30" maxlength="29" ></td> - </tr> - <tr> - <td class="LabelV" ></td> - <td><input type="checkbox" id="remember_me" name="remember_me" value="true" /> - <label for="remember_me"> Remember me</label></td> - </tr> - <?php - if(isset($errors[0])) - echo '<tr><td></td><td><span class="FormFieldError">' . $errors[0] . '</span></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;" > - <div class="BigButton" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton.gif)" > - <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" > - <div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton_over.gif);" ></div> - <input class="ButtonText" type="image" name="Submit" alt="Submit" src="<?php echo $template_path; ?>/images/buttons/_sbutton_submit.gif" > - </div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" > - <form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" > - <div class="BigButton" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton.gif)" > - <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" > - <div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton_over.gif);" ></div> - <input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="<?php echo $template_path; ?>/images/buttons/_sbutton_accountlost.gif" > - </div></div></td></tr></form></table></td></tr></table> - - <script type="text/javascript"> - $(function() { - $('#account-name-input').focus(); - }); - </script> - <?php + + echo $twig->render('account.login.html', array( + 'redirect' => isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : null, + 'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number', + 'error' => isset($errors[0]) ? $errors[0] : null + )); return; } } @@ -133,192 +41,99 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa if(isset($_REQUEST['redirect'])) { $redirect = urldecode($_REQUEST['redirect']); -?> - <div class="TableContainer"> - <table class="Table1" cellpadding="0" cellspacing="0"> - <div class="CaptionContainer"> - <div class="CaptionInnerContainer"> - <span class="CaptionEdgeLeftTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionEdgeRightTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionBorderTop" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> - <span class="CaptionVerticalLeft" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> - <div class="Text" >Login Successful</div> - <span class="CaptionVerticalRight" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> - <span class="CaptionBorderBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> - <span class="CaptionEdgeLeftBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - <span class="CaptionEdgeRightBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> - </div> - </div> - <tr> - <td> - <div class="InnerTableContainer"> - <table style="width:100%;" > - <tr> - <td>You have logged in.<br/>Press <a href="<?php echo $redirect; ?>" >here</a> if you are not returned automatically.</td> - </tr> - </table> - </div> - </table> - </div> - </td> - </tr> -<script language="javascript" type="text/javascript"> -<!-- // Automatic redirect - setTimeout ("automaticRedirect()", 1000); - function automaticRedirect() { - window.location = "<?php echo $redirect; ?>"; - } -// --> -</script> -<?php + echo $twig->render('account.redirect.html', array( + 'redirect' => $redirect + )); return; } - if($action == "") + if($action == '') { $freePremium = isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium']); - $account_reckey = $account_logged->getCustomField("key"); + $recovery_key = $account_logged->getCustomField('key'); if(!$account_logged->isPremium()) $account_status = '<b><font color="red">Free Account</font></b>'; else $account_status = '<b><font color="green">Premium Account, ' . ($freePremium ? 'Unlimited' : $account_logged->getPremDays() . ' days left') . '</font></b>'; - if(empty($account_reckey)) - $account_registred = '<b><font color="red">No</font></b>'; + + if(empty($recovery_key)) + $account_registered = '<b><font color="red">No</font></b>'; else { if($config['generate_new_reckey'] && $config['mail_enabled']) - $account_registred = '<b><font color="green">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Recovery Key </a> )</font></b>'; + $account_registered = '<b><font color="green">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Recovery Key </a> )</font></b>'; else - $account_registred = '<b><font color="green">Yes</font></b>'; + $account_registered = '<b><font color="green">Yes</font></b>'; } $account_created = $account_logged->getCustomField("created"); $account_email = $account_logged->getEMail(); - $account_email_new_time = $account_logged->getCustomField("email_new_time"); - if($account_email_new_time > 1) - $account_email_new = $account_logged->getCustomField("email_new"); + $email_new_time = $account_logged->getCustomField("email_new_time"); + if($email_new_time > 1) + $email_new = $account_logged->getCustomField("email_new"); $account_rlname = $account_logged->getRLName(); $account_location = $account_logged->getLocation(); if($account_logged->isBanned()) if($account_logged->getBanTime() > 0) - $welcome_msg = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>'; + $welcome_message = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>'; else - $welcome_msg = '<font color="red">Your account is banished FOREVER!</font>'; + $welcome_message = '<font color="red">Your account is banished FOREVER!</font>'; else - $welcome_msg = 'Welcome to your account!'; - echo '<div class="SmallBox" > <div class="MessageContainer" ><div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div><div class="Message" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div><table><td width="100%"></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=logout" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$template_path.'/images/buttons/_sbutton_logout.gif" ></div></div></td></tr></form></table></td></tr></table> </div><div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/><center><table><tr><td><img src="'.$template_path.'/images/content/headline-bracer-left.gif" /></td><td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >'.$welcome_msg.'<br/></td><td><img src="'.$template_path.'/images/content/headline-bracer-right.gif" /></td></tr></table><br/></center>'; - //if account dont have recovery key show hint - if(empty($account_reckey)) - echo '<div class="SmallBox" ><div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" >You can register your account for increased protection. Click on "Register Account" and get your free recovery key today!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$template_path.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; + $welcome_message = 'Welcome to your account!'; - $account_email_change = ''; - if($account_email_new_time > 1) + $email_change = ''; + $email_request = false; + if($email_new_time > 1) { - if($account_email_new_time < time()) - $account_email_change = '<br>(You can accept <b>'.$account_email_new.'</b> as a new email.)'; + if($email_new_time < time()) + $email_change = '<br>(You can accept <b>'.$email_new.'</b> as a new email.)'; else { - $account_email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b>"; - echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="Message" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Note:</td><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></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$template_path.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></div> </div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/><br/>'; + $email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $email_new_time).".</b>"; + $email_request = true; } } - echo '<a name="General+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" > <img style="border:0px;" src="'.$template_path.'/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('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" > - <tr style="background-color:'.$config['lightborder'].';" > - <td class="LabelV" >Account ' . (USE_ACCOUNT_NAME ? 'Name' : 'Number') . ':</td> - <td style="width:90%;" >' . (USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()) . '</td> - </tr> - <tr style="background-color:'.$config['darkborder'].';" > - <td class="LabelV" >Email Address:</td> - <td style="width:90%;" >'.$account_email.''.$account_email_change.'</td> - </tr> - <tr style="background-color:'.$config['lightborder'].';" > - <td class="LabelV" >Created:</td> - <td>'.date("j F Y, G:i:s", $account_created).'</td> - </tr> - <tr style="background-color:'.$config['darkborder'].';" > - <td class="LabelV" >Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr><tr style="background-color:'.$config['lightborder'].';" ><td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['darkborder'].';" ><td class="LabelV" >Registred:</td><td>'.$account_registred.'</td></tr></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$template_path.'/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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$template_path.'/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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$template_path.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form> </table></td><td width="100%"></td>'; - //show button "register account" - if(empty($account_reckey)) - echo '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$template_path.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>'; - echo '</tr></table></td></tr></table></div></table></div></td></tr><br/><a name="Public+Information" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><img style="border:0px;" src="'.$template_path.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td><table style="width:100%;"><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" >'.$account_rlname.'</td></tr><tr><td class="LabelV" >Location:</td><td style="width:90%;" >'.$account_location.'</td></tr></table></td><td align=right><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeinfo" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$template_path.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr> </table> </div> </table></div></td></tr>'; - echo '<br/><a name="Account+Logs" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><img style="border:0px;" src="'.$template_path.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Account logs</div><span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > - <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:60%" >Action</td><td style="width:25%" >Date</td><td style="width:15%">IP</td></tr>'; - $player_number_counter = 0; - foreach($account_logged->getActionsLog(0, 1000) as $action) - { - echo '<tr style="background-color:' . getStyle($player_number_counter++) . '"><td>'.$action['action'] . '</td><td>' . date("jS F Y H:i:s",$action['date']) . '</td> - <td>' . ($action['ip'] != 0 ? long2ip($action['ip']) : inet_ntop($action['ipv6'])) . '</td></tr>'; + $actions = array(); + foreach($account_logged->getActionsLog(0, 1000) as $action) { + $actions[] = array('action' => $action['action'], 'date' => $action['date'], 'ip' => $action['ip'] != 0 ? long2ip($action['ip']) : inet_ntop($action['ipv6'])); } - echo '</table> - - - </td><td align=right></td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr> </table> </div> </table></td></tr><br/>'; - echo '<a name="Characters" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><img style="border:0px;" src="'.$template_path.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Characters</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:65%" >Name</td><td style="width:15%" >Level</td><td style="width:7%">Status</td><td style="width:5%"> </td></tr>'; + + $players = array(); $account_players = $account_logged->getPlayersList(); $account_players->orderBy('id'); //show list of players on account - $player_number_counter = 0; - foreach($account_players as $account_player) + foreach($account_players as $player) { - echo '<tr style="background-color:' . getStyle($player_number_counter++); - echo ';" ><td><NOBR>'.$player_number_counter.'. '.$account_player->getName(); - if($account_player->isDeleted()) - echo '<font color="red"><b> [ DELETED ] </b></font>'; - echo '</NOBR></td><td><NOBR>'.$account_player->getLevel().' '.$config['vocations'][$account_player->getVocation()].'</NOBR></td>'; - if(!$account_player->isOnline()) - echo '<td><font color="red"><b>Offline</b></font></td>'; - else - echo '<td><font color="green"><b>Online</b></font></td>'; - echo '<td>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</td></tr>'; + $players[] = array( + 'name' => $player->getName(), + 'name_encoded' => urlencode($player->getName()), + 'deleted' => $player->isDeleted(), + 'level' => $player->getLevel(), + 'vocation' => $config['vocations'][$player->getVocation()], + 'online' => $player->isOnline() + ); } - echo '</table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$template_path.'/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=createcharacter" method="post" > - <tr> - <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div> - <input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$template_path.'/images/buttons/_sbutton_createcharacter.gif" ></div> - </div> - </td> - </tr> - </form> - </table> - </td>'; - if($config['account_change_character_name']) { - echo ' - <td> - <table border="0" cellspacing="0" cellpadding="0" > - <form action="?subtopic=accountmanagement&action=changename" method="post" > - <tr> - <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div> - <input class="ButtonText" type="image" name="Change Name" alt="Change Name" src="images/buttons/_sbutton_change_name.gif" ></div> - </div> - </td> - </tr> - </form> - </table> - </td>'; - } - if($config['account_change_character_sex']) { - echo ' - <td> - <table border="0" cellspacing="0" cellpadding="0" > - <form action="?subtopic=accountmanagement&action=changesex" method="post" > - <tr> - <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div> - <input class="ButtonText" type="image" name="Change Sex" alt="Change Sex" src="images/buttons/_sbutton_change_sex.gif" ></div> - </div> - </td> - </tr> - </form> - </table> - </td>'; - } - echo ' - <td style="width:100%;" ></td> - <td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="'.$template_path.'/images/buttons/_sbutton_deletecharacter.gif" ></div></div></td></tr></form></table></td></tr></table></td></tr> </table> </div> </table></td></div></tr><br/><br/>'; + + echo $twig->render('account.management.html', array( + 'welcome_message' => $welcome_message, + 'recovery_key' => $recovery_key, + 'email_change' => $email_change, + 'email_request' => $email_request, + 'email_new_time' => $email_new_time, + 'email_new' => isset($email_new) ? $email_new : '', + 'account' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId(), + 'account_email' => $account_email, + 'account_created' => $account_created, + 'account_status' => $account_status, + 'account_registered' => $account_registered, + 'account_rlname' => $account_rlname, + 'account_location' => $account_location, + 'config' => $config, + 'actions' => $actions, + 'players' => $players + )); } //########### CHANGE PASSWORD ########## if($action == "changepassword") { @@ -326,7 +141,7 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa $new_password2 = isset($_POST['newpassword2']) ? $_POST['newpassword2'] : NULL; $old_password = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : NULL; if(empty($new_password) && empty($new_password2) && empty($old_password)) { - echo 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?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('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo $twig->render('account.changepassword.html'); } else { @@ -360,8 +175,9 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa echo '<li>'.$show_msg; } echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; + //show form - echo 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?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('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo $twig->render('account.changepassword.html'); } else { @@ -378,20 +194,24 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa $account_logged->setPassword($new_password); $account_logged->save(); $account_logged->logAction('Account password changed.'); - echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Password Changed</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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.'; + + $message = ''; if($config['mail_enabled'] && $config['send_mail_when_change_password']) { $mailBody = ' <h3>Password to account changed!</h3> <p>You or someone else changed password to your account on server <a href="'.BASE_URL.'"><b>'.$config['lua']['serverName'].'</b></a>.</p> <p>New password: <b>'.$org_pass.'</b></p>'; - + if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Changed password", $mailBody)) - echo '<br /><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>'; + $message = '<br/><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>'; else - echo '<br /><p class="error">An error occorred while sending email with password:<br/>' . $mailer->ErrorInfo . '</p>'; + $message = '<br/><p class="error">An error occorred while sending email with password:<br/>' . $mailer->ErrorInfo . '</p>'; } - echo '</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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>'; + + echo $twig->render('account.changepassword.success.html', array( + 'message' => $message + )); $_SESSION['password'] = $new_password; } } @@ -399,18 +219,18 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa //############# CHANGE E-MAIL ################### if($action == "changeemail") { - $account_email_new_time = $account_logged->getCustomField("email_new_time"); - if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); } - if($account_email_new_time < 10){ + $email_new_time = $account_logged->getCustomField("email_new_time"); + if($email_new_time > 10) {$email_new = $account_logged->getCustomField("email_new"); } + if($email_new_time < 10){ if(isset($_POST['changeemailsave']) && $_POST['changeemailsave'] == 1) { - $account_email_new = $_POST['new_email']; + $email_new = $_POST['new_email']; $post_password = $_POST['password']; - if(empty($account_email_new)) { + if(empty($email_new)) { $change_email_errors[] = "Please enter your new email address."; } else { - if(!check_mail($account_email_new)) { + if(!check_mail($email_new)) { $change_email_errors[] = "E-mail address is not correct."; } } @@ -425,47 +245,48 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa } } if(empty($change_email_errors)) { - $account_email_new_time = time() + $config['account_mail_change'] * 24 * 3600; - $account_logged->setCustomField("email_new", $account_email_new); - $account_logged->setCustomField("email_new_time", $account_email_new_time); - echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >New Email Address Requested</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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, G: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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>'; + $email_new_time = time() + $config['account_mail_change'] * 24 * 3600; + $account_logged->setCustomField("email_new", $email_new); + $account_logged->setCustomField("email_new_time", $email_new_time); + echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >New Email Address Requested</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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>'.$email_new.'</b>. The actual change will take place after <b>'.date("j F Y, G:i:s", $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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>'; } else { //show errors - echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$template_path.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>'; - foreach($change_email_errors as $change_email_error) { - echo '<li>'.$change_email_error; - } - echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; + echo $twig->render('account.error_box.html', array('errors' => $change_email_errors)); + //show form - echo '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['account_mail_change'].' days.</b><br/><br/><form action="?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('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo $twig->render('account.changemail.html', array( + 'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null + )); } } else { - echo '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['account_mail_change'].' days.</b><br/><br/><form action="?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('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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="'.(isset($_POST['new_email']) ? $_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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo $twig->render('account.changemail.html', array( + 'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null + )); } } else { - if($account_email_new_time < time()) { + if($email_new_time < time()) { if($_POST['changeemailsave'] == 1) { $account_logged->setCustomField("email_new", ""); $account_logged->setCustomField("email_new_time", 0); - $account_logged->setEmail($account_email_new); + $account_logged->setEmail($email_new); $account_logged->save(); - $account_logged->logAction('Account email changed to <b>' . $account_email_new . '</b>'); + $account_logged->logAction('Account email changed to <b>' . $email_new . '</b>'); echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Accepted</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>'; } else { - echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Accepted</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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"> </td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$template_path.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$template_path.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement" method="post" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30"> </td></tr></table>'; + echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Accepted</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Do you accept <b>'.$email_new.'</b> as your new email adress?</td></tr> </table> </div> </table></div></td></tr><br /><table width="100%"><tr><td width="30"> </td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$template_path.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$template_path.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement" method="post" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30"> </td></tr></table>'; } } else { - echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change of Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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="?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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$template_path.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change of Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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>'.$email_new.'</b>.<br/>The actual change will take place on <b>'.date("j F Y, G:i:s", $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="?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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$template_path.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; } } if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) { @@ -624,16 +445,14 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa } if(!$dontshowtableagain) { - //show errors if not empty if(!empty($reg_errors)) { - echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$template_path.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>'; - foreach($reg_errors as $reg_error) - echo '<li>'.$reg_error . '</li>'; - echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; + //show errors + echo $twig->render('account.error_box.html', array('errors' => $reg_errors)); } + //show form - echo 'To generate recovery key for your account please enter your password.<br/><br/><form action="?subtopic=accountmanagement&action=registeraccount" 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('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Generate recovery key</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/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><input type="password" name="reg_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;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>'; + echo $twig->render('account.register.html'); } } diff --git a/system/pages/characters.php b/system/pages/characters.php index 087ec532..6e98c38a 100644 --- a/system/pages/characters.php +++ b/system/pages/characters.php @@ -14,34 +14,16 @@ $title = 'Characters'; require(SYSTEM . 'item.php'); $groups = new OTS_Groups_List(); -function generate_search_table($script = false) +function generate_search_table($autofocus = false) { - global $config, $template_path; - $ret = ' - <form action="' . getPageLink('characters') . '" method="post"> - <table width="100%" border="0" cellspacing="1" cellpadding="4"> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Search Character</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - <TABLE BORDER=0 CELLPADDING=1> - <TR> - <TD>Name:</TD><TD><INPUT ID="name-input" NAME="name" VALUE="" SIZE=29 MAXLENGTH=29></TD> - <TD> - <INPUT TYPE=image NAME="Submit" SRC="' . $template_path . '/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18> - </TD> - </TR> - </TABLE> - </TD></TR> - </TABLE> - </FORM>'; - if($script) - $ret .= ' - <script type="text/javascript"> - $(function() { - $(\'#name-input\').focus(); - }); - </script>'; - - return $ret; + global $config, $template_path, $twig; + return $twig->render('characters.form.html', array( + 'link' => getPageLink('characters'), + 'vdarkborder' => $config['vdarkborder'], + 'darkborder' => $config['darkborder'], + 'autofocus' => $autofocus, + 'template_path' => $template_path + )); } function generate_player_lookup($player) @@ -129,7 +111,7 @@ if(isset($_REQUEST['name'])) if(empty($name)) { $tmp_link = getPlayerLink($name); - echo 'Here you can get detailed information about a certain player on '.$config['lua']['serverName'].'.<BR>'; + echo 'Here you can get detailed information about a certain player on ' . $config['lua']['serverName'] . '.<BR>'; echo generate_search_table(true); return; } @@ -165,7 +147,7 @@ if($player->isLoaded() && !$player->isDeleted()) <td> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <?php if($config['characters']['outfit']): ?> - <div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:<?php echo (in_array($player->getLookType(), array(75, 266, 302)) ? '-0px;margin-top:-0px;width:64px;height:64px;' : '-60px;margin-top:-60px;width:128px;height:128px;'); ?>" src="<?php echo $config['outfit_images_url'] . '?id=' . $player->getLookType() . (fieldExist('lookaddons', 'players') ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '"';?>></div> + <div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:<?php echo (in_array($player->getLookType(), array(75, 266, 302)) ? '-0px;margin-top:-0px;width:64px;height:64px;' : '-60px;margin-top:-60px;width:128px;height:128px;'); ?>" src="<?php echo $config['outfit_images_url'] . '?id=' . $player->getLookType() . (fieldExist('lookaddons', 'players') ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet(); ?>"></div> <?php endif; ?> <tr bgcolor="<?php echo $config['vdarkborder']; ?>"> <td colspan="2" class="white"><b>Character Information</b></td> diff --git a/system/pages/creatures.php b/system/pages/creatures.php index 3e163b63..1a6e6b57 100644 --- a/system/pages/creatures.php +++ b/system/pages/creatures.php @@ -170,7 +170,7 @@ if(empty($_REQUEST['creature'])) //generate sql query $desc = ''; if(isset($_REQUEST['desc']) && $_REQUEST['desc'] == 1) { - $desc = " DESC"; + $desc = " DESC"; } if($order == 'name') { $whereandorder = ' ORDER BY name'.$desc; @@ -229,24 +229,25 @@ if(empty($_REQUEST['creature'])) $number_of_rows = 0; foreach($monsters as $monster) { echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><TD><a href="?subtopic=creatures&creature='.urlencode($monster['name']).'">'.$monster['name'].'</a></TD><TD>'.$monster['health'].'</TD><TD>'.$monster['exp'].'</TD>'; + if($monster['summonable']) { - echo '<TD>'.$monster['mana'].'</TD>'; + echo '<TD>'.$monster['mana'].'</TD>'; } - else { - echo '<TD>---</TD>'; + else { + echo '<TD>---</TD>'; } if($monster['convinceable']) { - echo '<TD>'.$monster['mana'].'</TD>'; + echo '<TD>'.$monster['mana'].'</TD>'; } - else { - echo '<TD>---</TD>'; + else { + echo '<TD>---</TD>'; } - echo '<TD>'.ucwords($monster['race']).'</TD></TR>'; + echo '<td>'.ucwords($monster['race']).'</td></tr>'; } - echo '</TABLE>'; + echo '</table>'; return; } diff --git a/system/pages/lostaccount.php b/system/pages/lostaccount.php index 572fce4c..f2217e65 100644 --- a/system/pages/lostaccount.php +++ b/system/pages/lostaccount.php @@ -12,408 +12,194 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Lost Account Interface'; -$config_salt_enabled = fieldExist('salt', 'accounts'); -if($config['mail_enabled']) +if(!$config['mail_enabled']) { - if($action == '') + echo '<b>Account maker is not configured to send e-mails, you can\'t use Lost Account Interface. Contact with admin to get help.</b>'; + return; +} + +$config_salt_enabled = fieldExist('salt', 'accounts'); +$action_type = isset($_REQUEST['action_type']) ? $_REQUEST['action_type'] : ''; +if($action == '') +{ + echo $twig->render('account.lost.form.html', array( + 'vdarkborder' => $config['vdarkborder'], + 'darkborder' => $config['darkborder'], + 'template_path' => $template_path + )); +} +else if($action == 'step1' && $action_type == '') { + echo $twig->render('account.lost.noaction.html', array( + 'template_path' => $template_path + )); +} +elseif($action == 'step1' && $action_type == 'email') +{ + $nick = stripslashes($_REQUEST['nick']); + if(check_name($nick)) { - echo 'The Lost Account Interface can help you to get back your account name and password. Please enter your character name and select what you want to do.<BR> - <FORM ACTION="?subtopic=lostaccount&action=step1" METHOD=post> - <INPUT TYPE=hidden NAME="character" VALUE=""> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter your character name</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - <INPUT TYPE=text NAME="nick" id="name-input" VALUE="" SIZE="40"><BR> - </TD></TR> - </TABLE> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>What do you want?</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - <INPUT TYPE=radio NAME="action_type" id="action_type_email" VALUE="email"><label for="action_type_email"> Send me new password and my account name to account e-mail adress.</label><BR> - <INPUT TYPE=radio NAME="action_type" id="action_type_key" VALUE="reckey"><label for="action_type_key"> I got <b>recovery key</b> and want set new password and e-mail adress to my account.</label><BR> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - ?> - <script type="text/javascript"> - $(function() { - $('#name-input').focus(); - }); - </script> - <?php - } - elseif($action == 'step1' && $_REQUEST['action_type'] == '') - echo 'Please select action. - <BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; - elseif($action == 'step1' && $_REQUEST['action_type'] == 'email') - { - $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($nick); + if($player->isLoaded()) + $account = $player->getAccount(); + + if($account->isLoaded()) { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($nick); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) - { - if($account->getCustomField('email_next') < time()) - echo 'Please enter e-mail to account with this character.<BR> - <FORM ACTION="?subtopic=lostaccount&action=sendcode" METHOD=post> - <INPUT TYPE=hidden NAME="character" VALUE=""> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter e-mail to account</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Character: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR> - E-mail to account:<INPUT TYPE=text NAME="email" VALUE="" SIZE="40"><BR> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - else - { - $insec = $account->getCustomField('email_next') - time(); - $minutesleft = floor($insec / 60); - $secondsleft = $insec - ($minutesleft * 60); - $timeleft = $minutesleft.' minutes '.$secondsleft.' seconds'; - echo 'Account of selected character (<b>'.$nick.'</b>) received e-mail in last '.ceil($config['email_lai_sec_interval'] / 60).' minutes. You must wait '.$timeleft.' before you can use Lost Account Interface again.'; - } - } + if($account->getCustomField('email_next') < time()) + echo 'Please enter e-mail to account with this character.<BR> + <form action="?subtopic=lostaccount&action=sendcode" method=post> + <input type=hidden name="character"> + <table cellspacing=1 cellpadding=4 border=0 width=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter e-mail to account</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + Character: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR> + E-mail to account:<INPUT TYPE=text NAME="email" VALUE="" SIZE="40"><BR> + </TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; else - echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; + { + $insec = $account->getCustomField('email_next') - time(); + $minutesleft = floor($insec / 60); + $secondsleft = $insec - ($minutesleft * 60); + $timeleft = $minutesleft.' minutes '.$secondsleft.' seconds'; + echo 'Account of selected character (<b>'.$nick.'</b>) received e-mail in last '.ceil($config['email_lai_sec_interval'] / 60).' minutes. You must wait '.$timeleft.' before you can use Lost Account Interface again.'; + } } else - echo 'Invalid player name format. If you have other characters on account try with other name.'; - echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; + echo 'Player or account of player <b>' . $nick . '</b> doesn\'t exist.'; } - elseif($action == 'sendcode') + else + echo 'Invalid player name format. If you have other characters on account try with other name.'; + echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'sendcode') +{ + $email = $_REQUEST['email']; + $nick = stripslashes($_REQUEST['nick']); + if(check_name($nick)) { - $email = $_REQUEST['email']; - $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($nick); + if($player->isLoaded()) + $account = $player->getAccount(); + + if($account->isLoaded()) { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($nick); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) + if($account->getCustomField('email_next') < time()) { - if($account->getCustomField('email_next') < time()) + if($account->getEMail() == $email) { - if($account->getEMail() == $email) - { - $newcode = generateRandomString(30, true, false, true); - $mailBody = ' - You asked to reset your ' . $config['lua']['serverName'] . ' password.<br/> - <p>Account name: '.$account->getName().'</p> - <br /> - To do so, please click this link: - <p><a href="' . BASE_URL . '/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'">'.BASE_URL.'/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'</a></p> - <p>or open page: <i>' . BASE_URL . '/?subtopic=lostaccount&action=checkcode</i> and in field "code" write <b>'.$newcode.'</b></p> - <br/> - <p>If you did not request a password change, you may ignore this message and your password will remain unchanged.'; + $newcode = generateRandomString(30, true, false, true); + $mailBody = ' + You asked to reset your ' . $config['lua']['serverName'] . ' password.<br/> + <p>Account name: '.$account->getName().'</p> + <br /> + To do so, please click this link: + <p><a href="' . BASE_URL . '/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'">'.BASE_URL.'/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'</a></p> + <p>or open page: <i>' . BASE_URL . '/?subtopic=lostaccount&action=checkcode</i> and in field "code" write <b>'.$newcode.'</b></p> + <br/> + <p>If you did not request a password change, you may ignore this message and your password will remain unchanged.'; - $account_mail = $account->getCustomField('email'); - if(_mail($account_mail, $config['lua']['serverName'].' - Recover your account', $mailBody)) - { - $account->setCustomField('email_code', $newcode); - $account->setCustomField('email_next', (time() + $config['email_lai_sec_interval'])); - echo '<br />Details about steps required to recover your account has been sent to <b>' . $account_mail . '</b>. You should receive this email within 15 minutes. Please check your inbox/spam directory.'; - } - else - { - $account->setCustomField('email_next', (time() + 60)); - echo '<br /><p class="error">An error occorred while sending email! Try again or contact with admin. Error:<br/>' . $mailer->ErrorInfo . '</p>'; - } + $account_mail = $account->getCustomField('email'); + if(_mail($account_mail, $config['lua']['serverName'].' - Recover your account', $mailBody)) + { + $account->setCustomField('email_code', $newcode); + $account->setCustomField('email_next', (time() + $config['email_lai_sec_interval'])); + echo '<br />Details about steps required to recover your account has been sent to <b>' . $account_mail . '</b>. You should receive this email within 15 minutes. Please check your inbox/spam directory.'; } else - echo 'Invalid e-mail to account of character <b>'.$nick.'</b>. Try again.'; - } - else - { - $insec = $account->getCustomField('email_next') - time(); - $minutesleft = floor($insec / 60); - $secondsleft = $insec - ($minutesleft * 60); - $timeleft = $minutesleft.' minutes '.$secondsleft.' seconds'; - echo 'Account of selected character (<b>'.$nick.'</b>) received e-mail in last '.ceil($config['email_lai_sec_interval'] / 60).' minutes. You must wait '.$timeleft.' before you can use Lost Account Interface again.'; - } - } - else - echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; - } - else - echo 'Invalid player name format. If you have other characters on account try with other name.'; - echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount&action=step1&action_type=email&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - elseif($action == 'step1' && $_REQUEST['action_type'] == 'reckey') - { - $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) - { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($nick); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) - { - $account_key = $account->getCustomField('key'); - if(!empty($account_key)) - { - echo 'If you enter right recovery key you will see form to set new e-mail and password to account. To this e-mail will be send your new password and account name.<BR> - <FORM ACTION="?subtopic=lostaccount&action=step2" METHOD=post> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter your recovery key</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Character name: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR /> - Recovery key: <INPUT TYPE=text NAME="key" VALUE="" SIZE="40"><BR> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - else - echo 'Account of this character has no recovery key!'; - } - else - echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; - } - else - echo 'Invalid player name format. If you have other characters on account try with other name.'; - echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - elseif($action == 'step2') - { - $rec_key = trim($_REQUEST['key']); - $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) - { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($nick); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) - { - $account_key = $account->getCustomField('key'); - if(!empty($account_key)) - { - if($account_key == $rec_key) { - echo '<script type="text/javascript"> - function validate_required(field,alerttxt) - { - with (field) - { - if (value==null||value==""||value==" ") - {alert(alerttxt);return false;} - else {return true} - } - } - function validate_email(field,alerttxt) - { - with (field) - { - apos=value.indexOf("@"); - dotpos=value.lastIndexOf("."); - if (apos<1||dotpos-apos<2) - {alert(alerttxt);return false;} - else {return true;} - } - } - function validate_form(thisform) - { - with (thisform) - { - if (validate_required(email,"Please enter your e-mail!")==false) - {email.focus();return false;} - if (validate_email(email,"Invalid e-mail format!")==false) - {email.focus();return false;} - if (validate_required(passor,"Please enter password!")==false) - {passor.focus();return false;} - if (validate_required(passor2,"Please repeat password!")==false) - {passor2.focus();return false;} - if (passor2.value!=passor.value) - {alert(\'Repeated password is not equal to password!\');return false;} - } - } - </script>'; - echo 'Set new password and e-mail to your account.<BR> - <FORM ACTION="?subtopic=lostaccount&action=step3" onsubmit="return validate_form(this)" METHOD=post> - <INPUT TYPE=hidden NAME="character" VALUE=""> + $account->setCustomField('email_next', (time() + 60)); + echo '<br /><p class="error">An error occorred while sending email! Try again or contact with admin. Error:<br/>' . $mailer->ErrorInfo . '</p>'; + } + } + else + echo 'Invalid e-mail to account of character <b>'.$nick.'</b>. Try again.'; + } + else + { + $insec = $account->getCustomField('email_next') - time(); + $minutesleft = floor($insec / 60); + $secondsleft = $insec - ($minutesleft * 60); + $timeleft = $minutesleft.' minutes '.$secondsleft.' seconds'; + echo 'Account of selected character (<b>'.$nick.'</b>) received e-mail in last '.ceil($config['email_lai_sec_interval'] / 60).' minutes. You must wait '.$timeleft.' before you can use Lost Account Interface again.'; + } + } + else + echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; + } + else + echo 'Invalid player name format. If you have other characters on account try with other name.'; + echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <a href="?subtopic=lostaccount&action=step1&action_type=email&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'step1' && $action_type == 'reckey') +{ + $nick = stripslashes($_REQUEST['nick']); + if(check_name($nick)) + { + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($nick); + if($player->isLoaded()) + $account = $player->getAccount(); + if($account->isLoaded()) + { + $account_key = $account->getCustomField('key'); + if(!empty($account_key)) + { + echo 'If you enter right recovery key you will see form to set new e-mail and password to account. To this e-mail will be send your new password and account name.<BR> + <FORM ACTION="?subtopic=lostaccount&action=step2" METHOD=post> <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter new password and e-mail</B></TD></TR> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter your recovery key</B></TD></TR> <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Account of character: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR /> - New password: <INPUT id="passor" TYPE=password NAME="passor" VALUE="" SIZE="40"><BR> - Repeat new password: <INPUT id="passor2" TYPE=password NAME="passor" VALUE="" SIZE="40"><BR> - New e-mail address: <INPUT id="email" TYPE=text NAME="email" VALUE="" SIZE="40"><BR> - <INPUT TYPE=hidden NAME="key" VALUE="'.$rec_key.'"> + Character name: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR /> + Recovery key: <INPUT TYPE=text NAME="key" VALUE="" SIZE="40"><BR> </TD></TR> </TABLE> <BR> <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> </TD></TR></FORM></TABLE></TABLE>'; - } - else - echo 'Wrong recovery key!'; - } - else - echo 'Account of this character has no recovery key!'; } else - echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; + echo 'Account of this character has no recovery key!'; } else - echo 'Invalid player name format. If you have other characters on account try with other name.'; - echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; + echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; } - elseif($action == 'step3') + else + echo 'Invalid player name format. If you have other characters on account try with other name.'; + echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'step2') +{ + $rec_key = trim($_REQUEST['key']); + $nick = stripslashes($_REQUEST['nick']); + if(check_name($nick)) { - $rec_key = trim($_REQUEST['key']); - $nick = stripslashes($_REQUEST['nick']); - $new_pass = trim($_REQUEST['passor']); - $new_email = trim($_REQUEST['email']); - if(check_name($nick)) + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($nick); + if($player->isLoaded()) + $account = $player->getAccount(); + if($account->isLoaded()) { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($nick); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) + $account_key = $account->getCustomField('key'); + if(!empty($account_key)) { - $account_key = $account->getCustomField('key'); - if(!empty($account_key)) - { - if($account_key == $rec_key) - { - if(check_password($new_pass)) - { - if(check_mail($new_email)) - { - $account->setEMail($new_email); - - if($config_salt_enabled) - { - $salt = generateRandomString(10, false, true, true); - $new_pass_with_salt = $salt . $new_pass; - } - - $account->setPassword(encrypt($new_pass_with_salt)); - $account->save(); - - if($config_salt_enabled) - $account->setCustomField('salt', $salt); - - echo 'Your account name, new password and new e-mail.<BR> - <FORM ACTION="?subtopic=accountmanagement" onsubmit="return validate_form(this)" METHOD=post> - <INPUT TYPE=hidden NAME="character" VALUE=""> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Your account name, new password and new e-mail</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Account name: <b>'.$account->getName().'</b><BR> - New password: <b>'.$new_pass.'</b><BR> - New e-mail address: <b>'.$new_email.'</b><BR>'; - if($account->getCustomField('email_next') < time()) - { - $mailBody = ' - <h3>Your account name and new password!</h3> - <p>Changed password and e-mail to your account in Lost Account Interface on server <a href="'.BASE_URL.'"><b>'.$config['lua']['serverName'].'</b></a></p> - <p>Account name: <b>'.$account->getName().'</b></p> - <p>New password: <b>'.$new_pass.'</b></p> - <p>E-mail: <b>'.$new_email.'</b> (this e-mail)</p> - <br /> - <p><u>It\'s automatic e-mail from OTS Lost Account System. Do not reply!</u></p>'; - - if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - New password to your account", $mailBody)) - { - echo '<br /><small>Sent e-mail with your account name and password to new e-mail. You should receive this e-mail in 15 minutes. You can login now with new password!</small>'; - } - else - { - echo '<br /><p class="error">An error occorred while sending email! You will not receive e-mail with this informations. Error:<br/>' . $mailer->ErrorInfo . '</p>'; - } - } - else - { - echo '<br /><small>You will not receive e-mail with this informations.</small>'; - } - echo '<INPUT TYPE=hidden NAME="account_login" VALUE="'.$account->getId().'"> - <INPUT TYPE=hidden NAME="password_login" VALUE="'.$new_pass.'"> - </TD></TR></TABLE><BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - else - echo 'Wrong e-mail format.'; - } - else - echo 'Wrong password format. Use only a-Z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; - } - else - echo 'Wrong recovery key!'; - } - else - echo 'Account of this character has no recovery key!'; - } - else - echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; - } - else - echo 'Invalid player name format. If you have other characters on account try with other name.'; - echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - elseif($action == 'checkcode') - { - $code = trim($_REQUEST['code']); - $character = stripslashes(trim($_REQUEST['character'])); - if(empty($code) || empty($character)) - echo 'Please enter code from e-mail and name of one character from account. Then press Submit.<BR> - <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> - Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - else - { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($character); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) - { - if($account->getCustomField('email_code') == $code) + if($account_key == $rec_key) { echo '<script type="text/javascript"> function validate_required(field,alerttxt) @@ -425,11 +211,25 @@ if($config['mail_enabled']) else {return true} } } - + function validate_email(field,alerttxt) + { + with (field) + { + apos=value.indexOf("@"); + dotpos=value.lastIndexOf("."); + if (apos<1||dotpos-apos<2) + {alert(alerttxt);return false;} + else {return true;} + } + } function validate_form(thisform) { with (thisform) { + if (validate_required(email,"Please enter your e-mail!")==false) + {email.focus();return false;} + if (validate_email(email,"Invalid e-mail format!")==false) + {email.focus();return false;} if (validate_required(passor,"Please enter password!")==false) {passor.focus();return false;} if (validate_required(passor2,"Please repeat password!")==false) @@ -438,16 +238,18 @@ if($config['mail_enabled']) {alert(\'Repeated password is not equal to password!\');return false;} } } - </script> - Please enter new password to your account and repeat to make sure you remember password.<BR> - <FORM ACTION="?subtopic=lostaccount&action=setnewpassword" onsubmit="return validate_form(this)" METHOD=post> - <INPUT TYPE=hidden NAME="character" VALUE="'.$character.'"> - <INPUT TYPE=hidden NAME="code" VALUE="'.$code.'"> + </script>'; + echo 'Set new password and e-mail to your account.<BR> + <FORM ACTION="?subtopic=lostaccount&action=step3" onsubmit="return validate_form(this)" METHOD=post> + <INPUT TYPE=hidden NAME="character" VALUE=""> <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & account name</B></TD></TR> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Please enter new password and e-mail</B></TD></TR> <TR><TD BGCOLOR="'.$config['darkborder'].'"> - New password: <INPUT TYPE=password ID="passor" NAME="passor" VALUE="" SIZE="40")><BR /> - Repeat new password: <INPUT TYPE=password ID="passor2" NAME="passor2" VALUE="" SIZE="40")><BR /> + Account of character: <INPUT TYPE=text NAME="nick" VALUE="'.$nick.'" SIZE="40" readonly="readonly"><BR /> + New password: <INPUT id="passor" TYPE=password NAME="passor" VALUE="" SIZE="40"><BR> + Repeat new password: <INPUT id="passor2" TYPE=password NAME="passor" VALUE="" SIZE="40"><BR> + New e-mail address: <INPUT id="email" TYPE=text NAME="email" VALUE="" SIZE="40"><BR> + <INPUT TYPE=hidden NAME="key" VALUE="'.$rec_key.'"> </TD></TR> </TABLE> <BR> @@ -456,118 +258,298 @@ if($config['mail_enabled']) </TD></TR></FORM></TABLE></TABLE>'; } else - $error= 'Wrong code to change password.'; + echo 'Wrong recovery key!'; } else - $error = 'Account of this character or this character doesn\'t exist.'; + echo 'Account of this character has no recovery key!'; } - if(!empty($error)) - echo '<font color="red"><b>'.$error.'</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> - <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> - Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; - } - elseif($action == 'setnewpassword') - { - $newpassword = $_REQUEST['passor']; - $code = $_REQUEST['code']; - $character = stripslashes($_REQUEST['character']); - echo ''; - if(empty($code) || empty($character) || empty($newpassword)) - echo '<font color="red"><b>Error. Try again.</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> - <BR><FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; else + echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; + } + else + echo 'Invalid player name format. If you have other characters on account try with other name.'; + echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'step3') +{ + $rec_key = trim($_REQUEST['key']); + $nick = stripslashes($_REQUEST['nick']); + $new_pass = trim($_REQUEST['passor']); + $new_email = trim($_REQUEST['email']); + if(check_name($nick)) + { + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($nick); + if($player->isLoaded()) + $account = $player->getAccount(); + if($account->isLoaded()) { - $player = new OTS_Player(); - $account = new OTS_Account(); - $player->find($character); - if($player->isLoaded()) - $account = $player->getAccount(); - if($account->isLoaded()) + $account_key = $account->getCustomField('key'); + if(!empty($account_key)) { - if($account->getCustomField('email_code') == $code) + if($account_key == $rec_key) { - if(check_password($newpassword)) + if(check_password($new_pass)) { - if($config_salt_enabled) + if(check_mail($new_email)) { - $salt = generateRandomString(10, false, true, true); - $newpassword_with_salt = $salt . $newpassword; - $account->setCustomField('salt', $salt); - } - - $account->setPassword(encrypt($newpassword_with_salt)); - $account->save(); - $account->setCustomField('email_code', ''); - echo 'New password to your account is below. Now you can login.<BR> - <INPUT TYPE=hidden NAME="character" VALUE="'.$character.'"> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Changed password</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - New password: <b>'.$newpassword.'</b><BR /> - Account name: <i>(Already on your e-mail)</i><BR />'; + $account->setEMail($new_email); + + if($config_salt_enabled) + { + $salt = generateRandomString(10, false, true, true); + $new_pass_with_salt = $salt . $new_pass; + } + + $account->setPassword(encrypt($new_pass_with_salt)); + $account->save(); + + if($config_salt_enabled) + $account->setCustomField('salt', $salt); + + echo 'Your account name, new password and new e-mail.<BR> + <FORM ACTION="?subtopic=accountmanagement" onsubmit="return validate_form(this)" METHOD=post> + <INPUT TYPE=hidden NAME="character" VALUE=""> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Your account name, new password and new e-mail</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + Account name: <b>'.$account->getName().'</b><BR> + New password: <b>'.$new_pass.'</b><BR> + New e-mail address: <b>'.$new_email.'</b><BR>'; + if($account->getCustomField('email_next') < time()) + { + $mailBody = ' + <h3>Your account name and new password!</h3> + <p>Changed password and e-mail to your account in Lost Account Interface on server <a href="'.BASE_URL.'"><b>'.$config['lua']['serverName'].'</b></a></p> + <p>Account name: <b>'.$account->getName().'</b></p> + <p>New password: <b>'.$new_pass.'</b></p> + <p>E-mail: <b>'.$new_email.'</b> (this e-mail)</p> + <br /> + <p><u>It\'s automatic e-mail from OTS Lost Account System. Do not reply!</u></p>'; - $mailBody = ' - <h3>Your account name and password!</h3> - <p>Changed password to your account in Lost Account Interface on server <a href="'.BASE_URL.'"><b>'.$config['lua']['serverName'].'</b></a></p> - <p>Account name: <b>'.$account->getName().'</b></p> - <p>New password: <b>'.$newpassword.'</b></p> - <br /> - <p><u>It\'s automatic e-mail from OTS Lost Account System. Do not reply!</u></p>'; - - if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - Your new password", $mailBody)) - { - echo '<br /><small>New password work! Sent e-mail with your password and account name. You should receive this e-mail in 15 minutes. You can login now with new password!'; + if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - New password to your account", $mailBody)) + { + echo '<br /><small>Sent e-mail with your account name and password to new e-mail. You should receive this e-mail in 15 minutes. You can login now with new password!</small>'; + } + else + { + echo '<br /><p class="error">An error occorred while sending email! You will not receive e-mail with this informations. Error:<br/>' . $mailer->ErrorInfo . '</p>'; + } + } + else + { + echo '<br /><small>You will not receive e-mail with this informations.</small>'; + } + echo '<INPUT TYPE=hidden NAME="account_login" VALUE="'.$account->getId().'"> + <INPUT TYPE=hidden NAME="password_login" VALUE="'.$new_pass.'"> + </TD></TR></TABLE><BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; } else - { - echo '<br /><p class="error">New password work! An error occorred while sending email! You will not receive e-mail with new password. Error:<br/>' . $mailer->ErrorInfo . '</p>'; - } - echo '</TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <FORM ACTION="?subtopic=accountmanagement" METHOD=post> - <INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; + echo 'Wrong e-mail format.'; } else - $error= 'Wrong password format. Use only a-z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; + echo 'Wrong password format. Use only a-Z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; } else - $error= 'Wrong code to change password.'; + echo 'Wrong recovery key!'; } else - $error = 'Account of this character or this character doesn\'t exist.'; + echo 'Account of this character has no recovery key!'; } - if(!empty($error)) - echo '<font color="red"><b>'.$error.'</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> - <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> - <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> - <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> - <TR><TD BGCOLOR="'.$config['darkborder'].'"> - Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> - Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> - </TD></TR> - </TABLE> - <BR> - <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> - <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> - </TD></TR></FORM></TABLE></TABLE>'; + else + echo 'Player or account of player <b>'.$nick.'</b> doesn\'t exist.'; } + else + echo 'Invalid player name format. If you have other characters on account try with other name.'; + echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'checkcode') +{ + $code = trim($_REQUEST['code']); + $character = stripslashes(trim($_REQUEST['character'])); + if(empty($code) || empty($character)) + echo 'Please enter code from e-mail and name of one character from account. Then press Submit.<BR> + <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> + Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> + </TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; + else + { + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($character); + if($player->isLoaded()) + $account = $player->getAccount(); + if($account->isLoaded()) + { + if($account->getCustomField('email_code') == $code) + { + echo '<script type="text/javascript"> + function validate_required(field,alerttxt) + { + with (field) + { + if (value==null||value==""||value==" ") + {alert(alerttxt);return false;} + else {return true} + } + } + + function validate_form(thisform) + { + with (thisform) + { + if (validate_required(passor,"Please enter password!")==false) + {passor.focus();return false;} + if (validate_required(passor2,"Please repeat password!")==false) + {passor2.focus();return false;} + if (passor2.value!=passor.value) + {alert(\'Repeated password is not equal to password!\');return false;} + } + } + </script> + Please enter new password to your account and repeat to make sure you remember password.<BR> + <FORM ACTION="?subtopic=lostaccount&action=setnewpassword" onsubmit="return validate_form(this)" METHOD=post> + <INPUT TYPE=hidden NAME="character" VALUE="'.$character.'"> + <INPUT TYPE=hidden NAME="code" VALUE="'.$code.'"> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & account name</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + New password: <INPUT TYPE=password ID="passor" NAME="passor" VALUE="" SIZE="40")><BR /> + Repeat new password: <INPUT TYPE=password ID="passor2" NAME="passor2" VALUE="" SIZE="40")><BR /> + </TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; + } + else + $error= 'Wrong code to change password.'; + } + else + $error = 'Account of this character or this character doesn\'t exist.'; + } + if(!empty($error)) + echo '<font color="red"><b>'.$error.'</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> + <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> + Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> + </TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; +} +elseif($action == 'setnewpassword') +{ + $newpassword = $_REQUEST['passor']; + $code = $_REQUEST['code']; + $character = stripslashes($_REQUEST['character']); + echo ''; + if(empty($code) || empty($character) || empty($newpassword)) + echo '<font color="red"><b>Error. Try again.</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> + <BR><FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; + else + { + $player = new OTS_Player(); + $account = new OTS_Account(); + $player->find($character); + if($player->isLoaded()) + $account = $player->getAccount(); + if($account->isLoaded()) + { + if($account->getCustomField('email_code') == $code) + { + if(check_password($newpassword)) + { + if($config_salt_enabled) + { + $salt = generateRandomString(10, false, true, true); + $newpassword_with_salt = $salt . $newpassword; + $account->setCustomField('salt', $salt); + } + + $account->setPassword(encrypt($newpassword_with_salt)); + $account->save(); + $account->setCustomField('email_code', ''); + echo 'New password to your account is below. Now you can login.<BR> + <INPUT TYPE=hidden NAME="character" VALUE="'.$character.'"> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Changed password</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + New password: <b>'.$newpassword.'</b><BR /> + Account name: <i>(Already on your e-mail)</i><BR />'; + + $mailBody = ' + <h3>Your account name and password!</h3> + <p>Changed password to your account in Lost Account Interface on server <a href="'.BASE_URL.'"><b>'.$config['lua']['serverName'].'</b></a></p> + <p>Account name: <b>'.$account->getName().'</b></p> + <p>New password: <b>'.$newpassword.'</b></p> + <br /> + <p><u>It\'s automatic e-mail from OTS Lost Account System. Do not reply!</u></p>'; + + if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - Your new password", $mailBody)) + { + echo '<br /><small>New password work! Sent e-mail with your password and account name. You should receive this e-mail in 15 minutes. You can login now with new password!'; + } + else + { + echo '<br /><p class="error">New password work! An error occorred while sending email! You will not receive e-mail with new password. Error:<br/>' . $mailer->ErrorInfo . '</p>'; + } + echo '</TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <FORM ACTION="?subtopic=accountmanagement" METHOD=post> + <INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; + } + else + $error= 'Wrong password format. Use only a-z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; + } + else + $error= 'Wrong code to change password.'; + } + else + $error = 'Account of this character or this character doesn\'t exist.'; + } + if(!empty($error)) + echo '<font color="red"><b>'.$error.'</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR> + <FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post> + <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Code & character name</B></TD></TR> + <TR><TD BGCOLOR="'.$config['darkborder'].'"> + Your code: <INPUT TYPE=text NAME="code" VALUE="" SIZE="40")><BR /> + Character: <INPUT TYPE=text NAME="character" VALUE="" SIZE="40")><BR /> + </TD></TR> + </TABLE> + <BR> + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center> + <INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center> + </TD></TR></FORM></TABLE></TABLE>'; } -else - echo '<b>Account maker is not configured to send e-mails, you can\'t use Lost Account Interface. Contact with admin to get help.</b>'; ?> diff --git a/system/template.php b/system/template.php index d3bdc56d..92978c82 100644 --- a/system/template.php +++ b/system/template.php @@ -92,4 +92,6 @@ if($config['forum'] != '') else $template['link_forum'] = "<a href='" . $config['forum'] . "' target='_blank'>"; } + +$twig->addGlobal('template_path', $template_path); ?> diff --git a/system/templates/account.changemail.html b/system/templates/account.changemail.html new file mode 100644 index 00000000..3bece4d2 --- /dev/null +++ b/system/templates/account.changemail.html @@ -0,0 +1,72 @@ +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.account_mail_change }} days.</b><br/><br/> +<form action="?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({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Change Email Address</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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="{% if new_email is defined %}{{ new_email }}{% endif %}" size="30" maxlength="50" autofocus/> + </td> + </tr> + <tr> + <td class="LabelV"> + <span >Password:</span> + </td> + <td> + <input type="password" name="password" size="30" maxlength="29"> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<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({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div> + </div> + </td> + <tr> + </table> + </td> +</form> + <td> + <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({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> +</table> \ No newline at end of file diff --git a/system/templates/account.changepassword.html b/system/templates/account.changepassword.html new file mode 100644 index 00000000..53c917ad --- /dev/null +++ b/system/templates/account.changepassword.html @@ -0,0 +1,80 @@ +Please enter your current password and a new password. For your security, please enter the new password twice.<br/> +<br/> +<form action="?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({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Change Password</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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> + </td> + </tr> + </table> + </div> + <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({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div> + </div> + </td> + <tr> + </table> + </td> +</form> + <td> + <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({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> \ No newline at end of file diff --git a/system/templates/account.changepassword.success.html b/system/templates/account.changepassword.success.html new file mode 100644 index 00000000..7f775a80 --- /dev/null +++ b/system/templates/account.changepassword.success.html @@ -0,0 +1,43 @@ +<div class="TableContainer"> + <table class="Table1" cellpadding="0" cellspacing="0"> + <div class="CaptionContainer"> + <div class="CaptionInnerContainer"> + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Password Changed</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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.{{ message|raw }}</td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<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({{ template_path }}/images/buttons/sbutton.gif)"> + <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" > + </div> + </div> + </td> + </tr> + </form> + </table> +</center> \ No newline at end of file diff --git a/system/templates/account.error_box.html b/system/templates/account.error_box.html new file mode 100644 index 00000000..0f841eee --- /dev/null +++ b/system/templates/account.error_box.html @@ -0,0 +1,20 @@ +<div class="SmallBox" > + <div class="MessageContainer"> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="ErrorMessage"> + <div class="BoxFrameVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <div class="BoxFrameVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <div class="AttentionSign" style="background-image:url({{ template_path }}/images/content/attentionsign.gif);"></div> + <b>The Following Errors Have Occurred:</b><br/> + {% for error in errors %} + <li>{{ error }}</li> + {% endfor %} + </div> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + </div> +</div> +<br/> \ No newline at end of file diff --git a/system/templates/account.login.html b/system/templates/account.login.html new file mode 100644 index 00000000..0cdcf850 --- /dev/null +++ b/system/templates/account.login.html @@ -0,0 +1,82 @@ +Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/> +<form action="?subtopic=accountmanagement" method="post" > + {% if redirect is not null %} + <input type="hidden" name="redirect" value="{{ redirect }}" /> + {% endif %} + <div class="TableContainer" > + <table class="Table1" cellpadding="0" cellspacing="0" > + <div class="CaptionContainer" > + <div class="CaptionInnerContainer" > + <span class="CaptionEdgeLeftTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionEdgeRightTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionBorderTop" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> + <span class="CaptionVerticalLeft" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> + <div class="Text" >Account Login</div> + <span class="CaptionVerticalRight" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span> + <span class="CaptionBorderBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionEdgeRightBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span> + </div> + </div> + <tr> + <td> + <div class="InnerTableContainer"> + <table style="width:100%;" > + <tr> + <td class="LabelV" > + <span{% if error is not null %} class="red"{% endif %}>Account {{ account }}:</span> + </td> + <td style="width:100%;" ><input type="password" name="account_login" size="30" maxlength="30" autofocus/></td> + </tr> + <tr> + <td class="LabelV" > + <span{% if error is not null %} class="red"{% endif %}>Password:</span> + </td> + <td><input type="password" name="password_login" size="30" maxlength="29" ></td> + </tr> + <tr> + <td class="LabelV" ></td> + <td><input type="checkbox" id="remember_me" name="remember_me" value="true" /> + <label for="remember_me"> Remember me</label></td> + </tr> + {% if error is not null %} + <tr><td></td><td><span class="FormFieldError">{{ error }}</span></td></tr> + {% endif %} + </table> + </div> + </td> + </tr> + </table> + </div> + <br/> + <table 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({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" > + </div> + </div> + </td> + <tr> + </form> + </table> + </td> + <td> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=lostaccount" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="{{ template_path }}/images/buttons/_sbutton_accountlost.gif" > + </div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> \ No newline at end of file diff --git a/system/templates/account.logout.html b/system/templates/account.logout.html new file mode 100644 index 00000000..9bacfed9 --- /dev/null +++ b/system/templates/account.logout.html @@ -0,0 +1,28 @@ +<div class="TableContainer"> + <table class="Table1" cellpadding="0" cellspacing="0" > + <div class="CaptionContainer"> + <div class="CaptionInnerContainer" > + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"/></span> + <div class="Text">Logout Successful</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"/></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span> + </div> + </div> + <tr> + <td> + <div class="InnerTableContainer"> + <table style="width:100%;"> + <tr> + <td>You have logged out of your {{ config.serverName }} account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> \ No newline at end of file diff --git a/system/templates/account.lost.form.html b/system/templates/account.lost.form.html new file mode 100644 index 00000000..d8283cab --- /dev/null +++ b/system/templates/account.lost.form.html @@ -0,0 +1,35 @@ +The Lost Account Interface can help you to get back your account name and password. Please enter your character name and select what you want to do.<br/> +<form action="?subtopic=lostaccount&action=step1" method=post> + <input type="hidden" name="character" value=""> + <table cellspacing="1" cellpadding="4" border="0" width="100%"> + <tr> + <td bgcolor="{{ vdarkborder }}" class="white"><b>Please enter your character name</b></td> + </tr> + <tr> + <td bgcolor="{{ darkborder }}"> + <input type="text" name="nick" size="40" autofocus/><br> + </td> + </tr> + </table> + <table cellspacing="1" cellpadding="4" border="0" width="100%"> + <tr> + <td bgcolor="{{ vdarkborder }}" class="white"><b>What do you want?</b></td> + </tr> + <tr> + <td bgcolor="{{ darkborder }}"> + <input type="radio" name="action_type" id="action_type_email" value="email"> + <label for="action_type_email"> Send me new password and my account name to account e-mail adress.</label><br/> + <input type=radio name="action_type" id="action_type_key" value="reckey"> + <label for="action_type_key"> I got <b>recovery key</b> and want set new password and e-mail adress to my account.</label><br/> + </td> + </tr> + </table> + <br/> + <table cellspacing="0" cellpadding="0" border="0" width="100%"> + <tr> + <td align="center"> + <input type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/sbutton_submit.gif" border="0" width="120" height="18"> + </td> + </tr> + </table> +</form> \ No newline at end of file diff --git a/system/templates/account.lost.noaction.html b/system/templates/account.lost.noaction.html new file mode 100644 index 00000000..bfec0d31 --- /dev/null +++ b/system/templates/account.lost.noaction.html @@ -0,0 +1,10 @@ +Please select action.<br/> +<table cellspacing="0" cellpadding="0" border="0" width="100%"> + <tr> + <td align="center"> + <a href="?subtopic=lostaccount" border="0"> + <img src="{{ template_path }}/images/buttons/sbutton_back.gif" name="back" alt="back" border="0" width="120" height="18"> + </a> + </td> + </tr> +</table> \ No newline at end of file diff --git a/system/templates/account.management.html b/system/templates/account.management.html new file mode 100644 index 00000000..9eb3939a --- /dev/null +++ b/system/templates/account.management.html @@ -0,0 +1,533 @@ +<div class="SmallBox"> + <div class="MessageContainer"> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="Message"> + <div class="BoxFrameVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <div class="BoxFrameVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <table> + <tr> + <td width="100%"></td> + <td> + <table border="0" cellspacing="0" cellpadding="0" > + <form action="?subtopic=accountmanagement&action=logout" method="post" > + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Logout" alt="Logout" src="{{ template_path }}/images/buttons/_sbutton_logout.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> + </div> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + </div> +</div> +<br/> +<center> + <table> + <tr> + <td> + <img src="{{ template_path }}/images/content/headline-bracer-left.gif" /> + </td> + <td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >{{ welcome_message }}<br/></td> + <td><img src="{{ template_path }}/images/content/headline-bracer-right.gif" /></td> + </tr> + </table> + <br/> +</center> +{# if account dont have recovery key show hint #} +{% if recovery_key is empty %} +<div class="SmallBox"> + <div class="MessageContainer"> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="Message"> + <div class="BoxFrameVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <div class="BoxFrameVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <table> + <tr> + <td class="LabelV" >Hint:</td> + <td style="width:100%;" >You can register your account for increased protection. Click on "Register Account" and get your free recovery key today!</td> + </tr> + </table> + <div align="center"> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=accountmanagement&action=registeraccount" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="{{ template_path }}/images/buttons/_sbutton_registeraccount.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </div> + </div> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);" /></div> + <div class="BoxFrameEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></div> + <div class="BoxFrameEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></div> + </div> +</div> +<br/> +{% endif %} + +{% if email_request %} +<div class="SmallBox"> + <div class="MessageContainer"> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="Message"> + <div class="BoxFrameVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <div class="BoxFrameVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></div> + <table> + <tr> + <td class="LabelV" >Note:</td> + <td style="width:100%;" >A request has beefffn submitted to change the email address of this account to <b>{{ email_new }}</b>. After <b>{{ email_new_time|date("j F Y, G:i:s") }}</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> + </tr> + </table> + <div align="center"> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=accountmanagement&action=changeemail" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Edit" alt="Edit" src="{{ template_path }}/images/buttons/_sbutton_edit.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </div> + </div> + <div class="BoxFrameHorizontal" style="background-image:url({{ template_path }}/images/content/box-frame-horizontal.gif);"></div> + <div class="BoxFrameEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + <div class="BoxFrameEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></div> + </div> +</div> +<br/><br/> +{% endif %} +<a name="General+Information" ></a> +<div class="TopButtonContainer"> + <div class="TopButton"> + <a href="#top"> + <img style="border:0px;" src="{{ template_path }}/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({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >General Information</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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({{ template_path }}/images/content/table-shadow-rt.gif);"></div> + </div> + <div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);"> + <div class="TableContentContainer"> + <table class="TableContent" width="100%"> + <tr style="background-color: {{ config.lightborder }};" > + <td class="LabelV" >Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</td> + <td style="width:90%;" >{{ account }}</td> + </tr> + <tr style="background-color: {{ config.darkborder }};" > + <td class="LabelV" >Email Address:</td> + <td style="width:90%;" >{{ account_email ~ email_change}}</td> + </tr> + <tr style="background-color: {{ config.lightborder }};" > + <td class="LabelV" >Created:</td> + <td>{{ account_created|date("j F Y, G:i:s") }}</td> + </tr> + <tr style="background-color: {{ config.darkborder }};" > + <td class="LabelV" >Last Login:</td> + <td>{{ "now"|date("j F Y, G:i:s") }}</td> + </tr> + {% autoescape false %} + <tr style="background-color: {{ config.lightborder }};" > + <td class="LabelV" >Account Status:</td> + <td>{{ account_status }}</td> + </tr> + <tr style="background-color: {{ config.darkborder }};" > + <td class="LabelV" >Registred:</td> + <td>{{ account_registered }}</td> + </tr> + {% endautoescape %} + </table> + </div> + </div> + <div class="TableShadowContainer"> + <div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bm.gif);" > + <div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div> + <div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/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({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="{{ template_path }}/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({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="{{ template_path }}/images/buttons/_sbutton_changeemail.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + <td width="100%"></td> + {# show button "register account" #} + {% if recovery_key is empty %} + <td> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=accountmanagement&action=registeraccount" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="{{ template_path }}/images/buttons/_sbutton_registeraccount.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + {% endif %} + </tr> + </table> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<br/> +<a name="Public+Information"></a> +<div class="TopButtonContainer"> + <div class="TopButton"> + <a href="#top"> + <img style="border:0px;" src="{{ template_path }}/images/content/back-to-top.gif"/> + </a> + </div> +</div> +<div class="TableContainer"> + <table class="Table5" cellpadding="0" cellspacing="0"> + <div class="CaptionContainer"> + <div class="CaptionInnerContainer"> + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Public Information</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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({{ template_path }}/images/content/table-shadow-rt.gif);" ></div> + </div> + <div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);" > + <div class="TableContentContainer"> + <table class="TableContent" width="100%"> + <tr> + <td> + <table style="width:100%;"> + <tr> + <td class="LabelV" >Real Name:</td> + <td style="width:90%;" >{{ account_rlname }}</td> + </tr> + <tr> + <td class="LabelV" >Location:</td> + <td style="width:90%;" >{{ account_location }}</td> + </tr> + </table> + </td> + <td align=right> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=accountmanagement&action=changeinfo" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="{{ template_path }}/images/buttons/_sbutton_edit.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> + </div> + </div> + <div class="TableShadowContainer"> + <div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bm.gif);"> + <div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div> + <div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-br.gif);"></div> </div> + </div> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<br/> +<a name="Account+Logs" ></a> +<div class="TopButtonContainer"> + <div class="TopButton"> + <a href="#top"> + <img style="border:0px;" src="{{ template_path }}/images/content/back-to-top.gif"/> + </a> + </div> +</div> +<div class="TableContainer"> + <table class="Table5" cellpadding="0" cellspacing="0"> + <div class="CaptionContainer"> + <div class="CaptionInnerContainer"> + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Account logs</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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({{ template_path }}/images/content/table-shadow-rt.gif);"></div> + </div> + <div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);" > + <div class="TableContentContainer" > + <table class="TableContent" width="100%"> + <tr class="LabelH"> + <td style="width:60%">Action</td> + <td style="width:25%">Date</td> + <td style="width:15%">IP</td> + </tr> + {% autoescape false %} + {% set i = 0 %} + {% for action in actions %} + {% set i = i + 1 %} + <tr style="background-color: {{ getStyle(i) }}"> + <td>{{ action.action }}</td> + <td>{{ action.date|date("jS F Y H:i:s") }}</td> + <td>{{ action.ip }}</td> + </tr> + {% endfor %} + {% endautoescape %} + </table> + </div> + </div> + <div class="TableShadowContainer" > + <div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bm.gif);" > + <div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div> + <div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-br.gif);"></div> + </div> + </div> + </td> + <td align=right> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<br/> +<a name="Characters" ></a> +<div class="TopButtonContainer"> + <div class="TopButton" > + <a href="#top"> + <img style="border:0px;" src="{{ template_path }}/images/content/back-to-top.gif" /> + </a> + </div> +</div> +<div class="TableContainer"> + <table class="Table5" cellpadding="0" cellspacing="0"> + <div class="CaptionContainer" > + <div class="CaptionInnerContainer"> + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text">Characters</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/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({{ template_path }}/images/content/table-shadow-rt.gif);"></div> + </div> + <div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);"> + <div class="TableContentContainer"> + <table class="TableContent" width="100%"> + <tr class="LabelH"> + <td style="width:65%">Name</td> + <td style="width:15%">Level</td> + <td style="width:7%">Status</td> + <td style="width:5%"> </td> + </tr> + {% set i = 0 %} + {% for player in players %} + {% set i = i + 1 %} + <tr style="background-color: {{ getStyle(i) }};"> + <td> + <nobr>{{ i }}. {{ player.name }}{% if player.deleted %}<font color="red"><b> [ DELETED ] </b></font>{% endif %}</nobr> + </td> + <td> + <nobr>{{ player.level }} {{ player.vocation }}</nobr> + </td> + {% if player.online %} + <td><font color="green"><b>Online</b></font></td> + {% else %} + <td><font color="red"><b>Offline</b></font></td> + {% endif %} + <td>[<a href="?subtopic=accountmanagement&action=changecomment&name={{ player.name_encoded }}" >Edit</a>]</td> + </tr> + {% endfor %} + </table> + </div> + </div> + <div class="TableShadowContainer"> + <div class="TableBottomShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-bm.gif);" > + <div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div> + <div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/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=createcharacter" method="post" > + <tr> + <td style="border:0px;" ><div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="{{ template_path }}/images/buttons/_sbutton_createcharacter.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + {% if config.account_change_character_name %} + <td> + <table border="0" cellspacing="0" cellpadding="0" > + <form action="?subtopic=accountmanagement&action=changename" method="post" > + <tr> + <td style="border:0px;" ><div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Change Name" alt="Change Name" src="images/buttons/_sbutton_change_name.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + {% endif %} + {% if config.account_change_character_sex %} + <td> + <table border="0" cellspacing="0" cellpadding="0" > + <form action="?subtopic=accountmanagement&action=changesex" method="post" > + <tr> + <td style="border:0px;" ><div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div> + <input class="ButtonText" type="image" name="Change Sex" alt="Change Sex" src="images/buttons/_sbutton_change_sex.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + {% endif %} + <td style="width:100%;" ></td> + <td> + <table border="0" cellspacing="0" cellpadding="0"> + <form action="?subtopic=accountmanagement&action=deletecharacter" method="post"> + <tr> + <td style="border:0px;"> + <div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="{{ template_path }}/images/buttons/_sbutton_deletecharacter.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<br/><br/> \ No newline at end of file diff --git a/system/templates/account.redirect.html b/system/templates/account.redirect.html new file mode 100644 index 00000000..daf830c2 --- /dev/null +++ b/system/templates/account.redirect.html @@ -0,0 +1,36 @@ +<div class="TableContainer"> + <table class="Table1" cellpadding="0" cellspacing="0"> + <div class="CaptionContainer"> + <div class="CaptionInnerContainer"> + <span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span> + <div class="Text" >Login Successful</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span> + </div> + </div> + <tr> + <td> + <div class="InnerTableContainer"> + <table style="width:100%;" > + <tr> + <td>You have logged in.<br/>Press <a href="{{ redirect }}" >here</a> if you are not returned automatically.</td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> + +<script language="javascript" type="text/javascript"> + // Automatic redirect + setTimeout ("automaticRedirect()", 1000); + function automaticRedirect() { + window.location = "{{ redirect }}"; + } +</script> \ No newline at end of file diff --git a/system/templates/account.register.html b/system/templates/account.register.html new file mode 100644 index 00000000..94e1e59e --- /dev/null +++ b/system/templates/account.register.html @@ -0,0 +1,64 @@ +To generate recovery key for your account please enter your password.<br/><br/> +<form action="?subtopic=accountmanagement&action=registeraccount" 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({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <div class="Text" >Generate recovery key</div> + <span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span> + <span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span> + <span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + <span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span> + </div> + </div> + <tr> + <td> + <div class="InnerTableContainer"> + <table style="width:100%;" > + <tr> + <td class="LabelV"> + <span>Password:</span> + </td> + <td> + <input type="password" name="reg_password" size="30" maxlength="29" autofocus/> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> +</div> +<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({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div> + </div> + </td> + <tr> + </table> + </td> +</form> + <td> + <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({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div> + </div> + </td> + </tr> + </form> + </table> + </td> + </tr> +</table> \ No newline at end of file diff --git a/system/templates/characters.form.html b/system/templates/characters.form.html new file mode 100644 index 00000000..9fcc0fae --- /dev/null +++ b/system/templates/characters.form.html @@ -0,0 +1,15 @@ +<form action="{{ link }}" method="post"> + <table width="100%" border="0" cellspacing="1" cellpadding="4"> + <tr><td bgcolor="{{ vdarkborder }}" class="white"><B>Search Character</B></TD></TR> + <tr><td bgcolor="{{ darkborder }}"> + <table border="0" cellpadding="1"> + <tr> + <td>Name:</td><td><input name="name" value="" size="29" maxlength="29"{% if autofocus %} autofocus{% endif %}></TD> + <td> + <input type=image name="Submit" src="{{ template_path }}/images/buttons/sbutton_submit.gif" border="0" width="120" height="18"/> + </td> + </tr> + </table> + </td></tr> + </table> +</form> \ No newline at end of file diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index 3d134e88..84a9567f 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -29,6 +29,7 @@ defined('MYAAC') or die('Direct access not allowed!'); <body onload="initMenu();"> <?php echo template_place_holder('body_start'); ?> + <div id="top"></div> <div id="page"> <!-- Keep all on center of browser --> diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php index c822a84a..eb926a5b 100644 --- a/templates/tibiacom/index.php +++ b/templates/tibiacom/index.php @@ -13,12 +13,11 @@ if(isset($config['boxes'])) <script type="text/javascript" src="tools/basic.js"></script> <script type="text/javascript" src="<?php echo $template_path; ?>/ticker.js"></script> <script type="text/javascript"> - <?php echo 'var loginStatus="' . ($logged ? 'true' : 'false') . '"; - var activeSubmenuItem="' . PAGE . '"; - var IMAGES="' . $template_path . '/images"; - var LINK_ACCOUNT="' . BASE_URL . '";'; - ?> - + var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>"; + var activeSubmenuItem="<?php echo PAGE; ?>"; + var IMAGES="<?php echo $template_path; ?>/images"; + var LINK_ACCOUNT="<?php echo BASE_URL; ?>"; + function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } @@ -26,20 +25,7 @@ if(isset($config['boxes'])) function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } - - <!-- // Framekiller - setTimeout ("changePage()", 6000); - function changePage() - { - if (parent.frames.length > 2) { - if (browserTyp == "ie") - parent.location=document.location; - else - self.top.location=document.location; - } - } - // --> - + function InitializePage() { LoadLoginBox(); LoadMenu(); @@ -348,16 +334,14 @@ if(isset($config['boxes'])) <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> </a> -<?php -echo "<a href='" . $template['link_downloads'] . "'> +<a href='<?php echo $template['link_downloads']; ?>'> <div id='submenu_downloads' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_downloads' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_downloads' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Downloads</div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> -</a>"; -?> +</a> </div> </div> @@ -576,34 +560,36 @@ if(isset($config['freehouses'])): ?> endif; ?> -<?php -echo "<a href='" . $template['link_screenshots'] . "'> +<a href="<?php echo $template['link_screenshots']; ?>"> <div id='submenu_screenshots' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_screenshots' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_screenshots' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Screenshots</div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> -</a>"; -if(isset($config['movies'])) -echo "<a href='" . $template['link_movies'] . "'> - <div id='submenu_movies' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_movies' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> - <div class='SubmenuitemLabel'>Movies</div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - </div> -</a>"; +</a> -echo "<a href='" . $template['link_serverInfo'] . "'> - <div id='submenu_serverinfo' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_serverinfo' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> - <div class='SubmenuitemLabel'>Server Info</div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> +<?php +if(isset($config['movies'])): ?> +echo "<a href='<?php echo $template['link_movies']; ?>'> + <div id='submenu_movies' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_movies' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> + <div class='SubmenuitemLabel'>Movies</div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> -</a>"; -?> +</a> +<?php endif; ?> + +<a href='<?php echo $template['link_serverInfo']; ?>'> + <div id='submenu_serverinfo' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_serverinfo' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> + <div class='SubmenuitemLabel'>Server Info</div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + </div> +</a> + <a href='<?php echo $template['link_experienceTable']; ?>'> <div id='submenu_experiencetable' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> @@ -615,53 +601,55 @@ echo "<a href='" . $template['link_serverInfo'] . "'> </div> </div> <?php -if($config['gifts_system']) -{ -echo "<div id='shops' class='menuitem'> -<span onClick=\"MenuItemAction('shops')\"> - <div class='MenuButton' style='background-image:url(".$template_path."/images/menu/button-background.gif);'> - <div onMouseOver='MouseOverMenuItem(this);' onMouseOut='MouseOutMenuItem(this);'><div class='Button' style='background-image:url(".$template_path."/images/menu/button-background-over.gif);'></div> +if($config['gifts_system']): +?> +<div id='shops' class='menuitem'> +<span onClick="MenuItemAction('shops')"> + <div class='MenuButton' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background.gif);'> + <div onMouseOver='MouseOverMenuItem(this);' onMouseOut='MouseOutMenuItem(this);'><div class='Button' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background-over.gif);'></div> <span id='shops_Lights' class='Lights'> - <div class='light_lu' style='background-image:url(".$template_path."/images/menu/green-light.gif);'></div> - <div class='light_ld' style='background-image:url(".$template_path."/images/menu/green-light.gif);'></div> - <div class='light_ru' style='background-image:url(".$template_path."/images/menu/green-light.gif);'></div> + <div class='light_lu' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div> + <div class='light_ld' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div> + <div class='light_ru' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div> </span> - <div id='shops_Icon' class='Icon' style='background-image:url(".$template_path."/images/menu/icon-shops.gif);'></div> - <div id='shops_Label' class='Label' style='background-image:url(".$template_path."/images/menu/label-shops.gif);'></div> - <div id='shops_Extend' class='Extend' style='background-image:url(".$template_path."/images/general/plus.gif);'></div> + <div id='shops_Icon' class='Icon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-shops.gif);'></div> + <div id='shops_Label' class='Label' style='background-image:url(<?php echo $template_path; ?>/images/menu/label-shops.gif);'></div> + <div id='shops_Extend' class='Extend' style='background-image:url(<?php echo $template_path; ?>/images/general/plus.gif);'></div> </div> </div> </span> </div> <div id='shops_Submenu' class='Submenu'> -<a href='" . $template['link_points'] . "'> +<a href='<?php echo $template['link_points']; ?>'> <div id='submenu_points' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_points' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> - <div class='SubmenuitemLabel'><font style=\"color: red;\">Buy Points</font></div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_points' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> + <div class='SubmenuitemLabel'><font style="color: red;">Buy Points</font></div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> </a> -<a href='" . $template['link_gifts'] . "'> +<a href='<?php echo $template['link_gifts']; ?>'> <div id='submenu_gifts' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> - <div class='SubmenuitemLabel'><div style=\"color: green;\">\$hop Offer</div></div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> + <div class='SubmenuitemLabel'><div style="color: green;">\$hop Offer</div></div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> </div> -</a>"; -if($logged) -echo "<a href='" . $template['link_gifts_history'] . "'> - <div id='submenu_gifts' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> - <div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - <div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div> - <div class='SubmenuitemLabel'>Trans. History</div> - <div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div> - </div> -</a>"; -echo "</div>"; -} +</a> +<?php +if($logged): ?> +<a href='<?php echo $template['link_gifts_history']; ?>'> + <div id='submenu_gifts' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> + <div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + <div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div> + <div class='SubmenuitemLabel'>Trans. History</div> + <div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div> + </div> +</a> +<?php endif; ?> +</div> +<?php endif; ?> <div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div> </div>