You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to log in again.
';
else
$main_content .= 'Please enter here your account number and password or create an account.
Change Password
New Password:
New Password Again:
Current Password:
';
else
{
if(empty($new_password) || empty($new_password2) || empty($old_password))
$show_msgs[] = "Please fill in form.";
if($new_password != $new_password2)
$show_msgs[] = "The new passwords do not match!";
if(empty($show_msgs))
{
if(!check_password($new_password))
$show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
$old_password = $old_password;
if($old_password != $account_logged->getPassword())
$show_msgs[] = "Current password is incorrect!";
}
if(!empty($show_msgs))
{
//show errors
$main_content .= '
The Following Errors Have Occurred: ';
foreach($show_msgs as $show_msg)
$main_content .= '
'.$show_msg;
$main_content .= ' ';
//show form
$main_content .= 'Wpisz aktualne hasło oraz nowe hasło. Dla twojego bezpieczeństwa, wpisz dwa razy nowe hasło.
You have requested to change your email address to '.$account_email_new.'. The actual change will take place after '.date("j F Y, G:i:s", $account_email_new_time).', during which you can cancel the request at any time.
';
}
else
{
//show errors
$main_content .= '
The Following Errors Have Occurred: ';
foreach($change_email_errors as $change_email_error)
$main_content .= '
'.$change_email_error;
$main_content .= ' ';
//show form
$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.
Change Email Address
New Email Address:
Password:
';
}
}
else
$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.
You have accepted '.$account_logged->getEmail().' as your new email adress.
';
}
else
$main_content .= '
Email Address Change Accepted
Do you accept '.$account_email_new.' as your new email adress?
';
}
else
$main_content .= '
Change of Email Address
A request has been submitted to change the email address of this account to '.$account_email_new.'. The actual change will take place on '.date("j F Y, G:i:s", $account_email_new_time).'. If you do not want to change your email address, please click on "Cancel".
Your request to change the email address of your account has been cancelled. The email address will not be changed.
';
}
}
//########### CHANGE PUBLIC INFORMATION (about account owner) ######################
if($action == "changeinfo")
{
$new_rlname = htmlspecialchars(stripslashes(trim($_POST['info_rlname'])));
$new_location = htmlspecialchars(stripslashes(trim($_POST['info_location'])));
if($_POST['changeinfosave'] == 1)
{
//save data from form
$account_logged->setRLName($new_rlname);
$account_logged->setLocation($new_location);
$account_logged->save();
$main_content .= '
Public Information Changed
Your public information has been changed.
';
}
else
{
//show form
$account_rlname = $account_logged->getRLName();
$account_location = $account_logged->getLocation();
$main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.
';
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
if ($config['site']['smtp_enabled'] == "yes")
{
$mail->IsSMTP();
$mail->Host = $config['site']['smtp_host'];
$mail->Port = (int)$config['site']['smtp_port'];
$mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
$mail->Username = $config['site']['smtp_user'];
$mail->Password = $config['site']['smtp_pass'];
}
else
$mail->IsMail();
$mail->IsHTML(true);
$mail->From = $config['site']['mail_address'];
$mail->AddAddress($account_logged->getEMail());
$mail->Subject = $config['server']['serverName']." - new recovery key";
$mail->Body = $mailBody;
if($mail->Send())
{
$account_logged->setRecoveryKey(new_rec_key);
$account_logged->save();
$main_content .= ' Your recovery key were send on email address '.$account_logged->getEMail().' for '.$config['site']['generate_new_reckey_price'].' premium points.';
}
else
$main_content .= ' An error occorred while sending email ( '.$account_logged->getEMail().' ) with recovery key! Recovery key not changed. Try again.';
$main_content .= '
';
}
else
$reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have '.$points.' premium points.';
}
else
$reg_errors[] = 'Wrong password to account.';
}
if($dontshowtableagain != 1)
{
//show errors if not empty
if(!empty($reg_errors))
{
$main_content .= '
The Following Errors Have Occurred: ';
foreach($reg_errors as $reg_error)
$main_content .= '
'.$reg_error;
$main_content .= ' ';
}
//show form
$main_content .= 'To generate NEW recovery key for your account please enter your password. New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points. You have '.$points.' premium points. You will receive e-mail with this recovery key.
';
}
else
{
$main_content .= 'Here you can see and edit the information about your character. If you do not want to specify a certain field, just leave it blank.
Edit Character Information
Name:
'.$player_name.'
Hide Account:
';
if($player->getHideChar() == 1)
$main_content .= '';
else
$main_content .= '';
$main_content .= ' check to hide your account information
Comment:
[max. length: 2000 chars, 50 lines]
';
}
}
else
$main_content .= "Error. Character ".$player_name." is not on your account.";
}
else
$main_content .= "Error. Character with this name doesn't exist.";
}
else
$main_content .= "Error. Name contain illegal characters.";
}
//## CREATE CHARACTER on account ###
if($action == "createcharacter")
{
$main_content .= '';
$newchar_name = stripslashes(ucwords(strtolower(trim($_POST['newcharname']))));
$newchar_sex = $_POST['newcharsex'];
$newchar_vocation = $_POST['newcharvocation'];
if($_POST['savecharacter'] != 1)
{
$main_content .= 'Please choose a name';
$main_content .= ', vocation';
$main_content .= ' and sex for your character. In any case the name must not violate the naming conventions stated in the '.$config['server']['serverName'].' Rules, or your character might get deleted or name locked.';
if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
$main_content .= ' You have maximum number of characters per account on your account. Delete one before you make new.';
$main_content .= '
';
}
else
{
if(strlen($newchar_name > 20))
$newchar_errors[] = 'Character name can not be logner then 20 characters.';
if(empty($newchar_name))
$newchar_errors[] = 'Please enter a name for your character!';
if(empty($newchar_sex) && $newchar_sex != "0")
$newchar_errors[] = 'Please select the sex for your character!';
if(empty($newchar_vocation) && $newchar_vocation = "0")
$newchar_errors[] = 'Please select a vocation for your character.';
if(strpos($newchar_name, 'Administrator') !== false)
$newchar_errors[] = 'This character name is forbidden.';
if(empty($newchar_errors))
{
if(!check_name_new_char($newchar_name))
$newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
if($newchar_sex != 1 && $newchar_sex != "0")
$newchar_errors[] = 'Sex must be equal 0 (female) or 1 (male).';
$newchar_vocation_check = FALSE;
foreach($config['site']['newchar_vocations'] as $char_vocation_key => $sample_char)
if($newchar_vocation == $char_vocation_key)
$newchar_vocation_check = TRUE;
if(!$newchar_vocation_check)
$newchar_errors[] = 'Unknown vocation. Please fill in form again.';
}
if(empty($newchar_errors))
{
$check_name_in_database = $ots->createObject('Player');
$check_name_in_database->find($newchar_name);
if($check_name_in_database->isLoaded())
$newchar_errors[] .= 'This name is already used. Please choose another name!';
$number_of_players_on_account = $account_logged->getPlayersList()->count();
if($number_of_players_on_account >= $config['site']['max_players_per_account'])
$newchar_errors[] .= 'You have too many characters on your account ('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')!';
}
if(empty($newchar_errors))
{
$char_to_copy_name = $config['site']['newchar_vocations'][$newchar_vocation];
$char_to_copy = new OTS_Player();
$char_to_copy->find($char_to_copy_name);
if(!$char_to_copy->isLoaded())
$newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy'.$char_to_copy_name.'
The character '.$newchar_name.' has been created. Please select the outfit when you log in for the first time.
See you in Tibia!
';
}
else
{
echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
exit;
}
}
else
{
$main_content .= '
The Following Errors Have Occurred: ';
foreach($newchar_errors as $newchar_error)
$main_content .= '
'.$newchar_error;
$main_content .= ' ';
$main_content .= 'Please choose a name';
$main_content .= ', vocation';
$main_content .= ' and sex for your character. In any case the name must not violate the naming conventions stated in the '.$config['server']['serverName'].' Rules, or your character might get deleted or name locked.