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 '
-
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
Search Character | |||
-
|
Character Information | 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 '|||||||||||
'.$monster['name'].' | '.$monster['health'].' | '.$monster['exp'].' | '; + if($monster['summonable']) { - echo ''.$monster['mana'].' | '; + echo ''.$monster['mana'].' | '; } - else { - echo '--- | '; + else { + echo '--- | '; } if($monster['convinceable']) { - echo ''.$monster['mana'].' | '; + echo ''.$monster['mana'].' | '; } - else { - echo '--- | '; + else { + echo '--- | '; } - echo ''.ucwords($monster['race']).' | '.ucwords($monster['race']).' | '; } - echo '
Please enter your character name |
- - |
What do you want? |
- - - |
![]() |
Please enter e-mail to account |
- Character: - E-mail to account: - |
Please enter e-mail to account |
+ Character: + E-mail to account: + |
![]() |
![]() |
Account name: '.$account->getName().'
-'.BASE_URL.'/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'
-or open page: ' . BASE_URL . '/?subtopic=lostaccount&action=checkcode and in field "code" write '.$newcode.'
-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.
+
Account name: '.$account->getName().'
+'.BASE_URL.'/?subtopic=lostaccount&action=checkcode&code='.$newcode.'&character='.urlencode($nick).'
+or open page: ' . BASE_URL . '/?subtopic=lostaccount&action=checkcode and in field "code" write '.$newcode.'
+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 '
Details about steps required to recover your account has been sent to ' . $account_mail . '. You should receive this email within 15 minutes. Please check your inbox/spam directory.';
- }
- else
- {
- $account->setCustomField('email_next', (time() + 60));
- echo '
An error occorred while sending email! Try again or contact with admin. Error:
' . $mailer->ErrorInfo . '
![]() |
Please enter your recovery key |
- Character name: - Recovery key: - |
![]() |
An error occorred while sending email! Try again or contact with admin. Error:
' . $mailer->ErrorInfo . '
![]() |
Please enter new password and e-mail |
Please enter your recovery key |
- Account of character: - New password: - Repeat new password: - New e-mail address: - + Character name: + Recovery key: |
![]() |
![]() |
Your account name, new password and new e-mail |
- Account name: '.$account->getName().' - New password: '.$new_pass.' - New e-mail address: '.$new_email.' '; - if($account->getCustomField('email_next') < time()) - { - $mailBody = ' - Your account name and new password!-Changed password and e-mail to your account in Lost Account Interface on server '.$config['lua']['serverName'].' -Account name: '.$account->getName().' -New password: '.$new_pass.' -E-mail: '.$new_email.' (this e-mail) -- It\'s automatic e-mail from OTS Lost Account System. Do not reply! '; - - if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - New password to your account", $mailBody)) - { - echo '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!'; - } - else - { - echo ' An error occorred while sending email! You will not receive e-mail with this informations. Error: You will not receive e-mail with this informations.'; - } - echo ' - - |
![]() |
Code & character name |
- Your code: - Character: - |
Code & account name |
Please enter new password and e-mail |
- New password: - Repeat new password: + Account of character: + New password: + Repeat new password: + New e-mail address: + |
Code & character name |
- Your code: - Character: - |
![]() |
Changed password | |||
- New password: '.$newpassword.' - Account name: (Already on your e-mail) '; + $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. +
+ |
New password work! An error occorred while sending email! You will not receive e-mail with new password. Error:
' . $mailer->ErrorInfo . '
Code & character name |
- Your code: - Character: - |
![]() |
Code & character name |
+ Your code: + Character: + |
Code & account name |
+ New password: + Repeat new password: + |
Code & character name |
+ Your code: + Character: + |
Changed password |
+ New password: '.$newpassword.' + Account name: (Already on your e-mail) '; + + $mailBody = ' + Your account name and password!+Changed password to your account in Lost Account Interface on server '.$config['lua']['serverName'].' +Account name: '.$account->getName().' +New password: '.$newpassword.' ++ It\'s automatic e-mail from OTS Lost Account System. Do not reply! '; + + if(_mail($account->getCustomField('email'), $config['lua']['serverName']." - Your new password", $mailBody)) + { + echo '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 ' New password work! An error occorred while sending email! You will not receive e-mail with new password. Error: |
Code & character name |
+ Your code: + Character: + |
+
+
+
|
+
+
|
+
+
+
|
+
+
+
+
|
+
+
|
+
+
+
|
+
+
+
+
|
+
+
+
+
+
+ |
+
+
+
+
|
+
+
|
+
+
|
+
+
+
+
|
+
Please enter your character name | +
+ + |
+
What do you want? | +
+
+ + + + |
+
+ + | +
+
+ ![]() |
+
+ |
+
|
+
+ ![]() |
+ {{ welcome_message }} |
+ ![]() |
+
Hint: | +You can register your account for increased protection. Click on "Register Account" and get your free recovery key today! | +
+
+
+ |
+
Note: | +A request has beefffn submitted to change the email address of this account to {{ email_new }}. After {{ email_new_time|date("j F Y, G:i:s") }} 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! | +
+
+
+ |
+
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
+
|
+
+
+
|
+
Search Character | |||
+
|