* new account.login view for tibiacom template
* added new indicator icons for create account, create character and change character name * attempt to fix incorrect views counter behavior (its resetting to 0 in some cases) * moved check_* functions to class Validator * from now all validators ajax requests will fire onblur instead of onkeyup * ajax requests returns now json instead of xml * added 404 response when file is not found * fixed gallery
BIN
images/global/general/blank.gif
Executable file
After Width: | Height: | Size: 71 B |
BIN
images/global/general/box-bottom.gif
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/global/general/box-top.gif
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/global/general/chain.gif
Executable file
After Width: | Height: | Size: 845 B |
BIN
images/global/general/favicon.ico
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
images/global/general/hide.gif
Executable file
After Width: | Height: | Size: 469 B |
BIN
images/global/general/minus.gif
Executable file
After Width: | Height: | Size: 224 B |
BIN
images/global/general/nok.gif
Executable file
After Width: | Height: | Size: 117 B |
BIN
images/global/general/ok.gif
Executable file
After Width: | Height: | Size: 113 B |
BIN
images/global/general/plus.gif
Executable file
After Width: | Height: | Size: 224 B |
BIN
images/global/general/show.gif
Executable file
After Width: | Height: | Size: 681 B |
18
index.php
@ -30,6 +30,11 @@
|
|||||||
// ini_set('display_startup_errors', 1);
|
// ini_set('display_startup_errors', 1);
|
||||||
// error_reporting(E_ALL);
|
// error_reporting(E_ALL);
|
||||||
|
|
||||||
|
if(preg_match("/^(.*)\.(gif|png|jpg|jpeg|tiff|bmp|css|js|less|map|html|php|zip|rar|gz)$/i", $_SERVER['REQUEST_URI'])) {
|
||||||
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
require_once('common.php');
|
require_once('common.php');
|
||||||
require_once(BASE . 'config.local.php');
|
require_once(BASE . 'config.local.php');
|
||||||
|
|
||||||
@ -80,11 +85,6 @@ else {
|
|||||||
'/^characters\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'characters', 'name' => '$1'),
|
'/^characters\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'characters', 'name' => '$1'),
|
||||||
'/^commands\/add\/?$/' => array('subtopic' => 'commands', 'action' => 'add'),
|
'/^commands\/add\/?$/' => array('subtopic' => 'commands', 'action' => 'add'),
|
||||||
'/^commands\/edit\/?$/' => array('subtopic' => 'commands', 'action' => 'edit'),
|
'/^commands\/edit\/?$/' => array('subtopic' => 'commands', 'action' => 'edit'),
|
||||||
'/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'),
|
|
||||||
'/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'),
|
|
||||||
'/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'),
|
|
||||||
'/^news\/archive\/[0-9]+\/?$/' => array('subtopic' => 'newsarchive', 'id' => '$2'),
|
|
||||||
'/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'),
|
|
||||||
'/^faq\/add\/?$/' => array('subtopic' => 'faq', 'action' => 'add'),
|
'/^faq\/add\/?$/' => array('subtopic' => 'faq', 'action' => 'add'),
|
||||||
'/^faq\/edit\/?$/' => array('subtopic' => 'faq', 'action' => 'edit'),
|
'/^faq\/edit\/?$/' => array('subtopic' => 'faq', 'action' => 'edit'),
|
||||||
'/^forum\/add_board\/?$/' => array('subtopic' => 'forum', 'action' => 'add_board'),#
|
'/^forum\/add_board\/?$/' => array('subtopic' => 'forum', 'action' => 'add_board'),#
|
||||||
@ -93,11 +93,19 @@ else {
|
|||||||
'/^forum\/board\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_board', 'id' => '$2', 'page' => '$3'),
|
'/^forum\/board\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_board', 'id' => '$2', 'page' => '$3'),
|
||||||
'/^forum\/thread\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2'),
|
'/^forum\/thread\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2'),
|
||||||
'/^forum\/thread\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2', 'page' => '$3'),
|
'/^forum\/thread\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2', 'page' => '$3'),
|
||||||
|
'/^gallery\/add\/?$/' => array('subtopic' => 'gallery', 'action' => 'add'),
|
||||||
|
'/^gallery\/edit\/?$/' => array('subtopic' => 'gallery', 'action' => 'edit'),
|
||||||
|
'/^gallery\/[0-9]+\/?$/' => array('subtopic' => 'gallery', 'image' => '$1'),
|
||||||
'/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'),
|
'/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'),
|
||||||
|
'/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'),
|
||||||
'/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2', 'page' => '$3'),
|
'/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2', 'page' => '$3'),
|
||||||
'/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'page' => '$2'),
|
'/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'page' => '$2'),
|
||||||
'/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'),
|
'/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'),
|
||||||
'/^highscores\/[A-Za-z0-9-_\']+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'),
|
'/^highscores\/[A-Za-z0-9-_\']+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'),
|
||||||
|
'/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'),
|
||||||
|
'/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'),
|
||||||
|
'/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'),
|
||||||
|
'/^news\/archive\/[0-9]+\/?$/' => array('subtopic' => 'newsarchive', 'id' => '$2'),
|
||||||
'/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1')
|
'/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
//ini_set('display_errors', false);
|
//ini_set('display_errors', false);
|
||||||
ini_set('max_execution_time', 300);
|
ini_set('max_execution_time', 300);
|
||||||
$error = false;
|
$error = false;
|
||||||
@ -221,11 +222,11 @@ if(!$error) {
|
|||||||
|
|
||||||
$content .= '$config[\'mail_enabled\'] = true;';
|
$content .= '$config[\'mail_enabled\'] = true;';
|
||||||
$content .= PHP_EOL;
|
$content .= PHP_EOL;
|
||||||
if(!check_mail($_SESSION['var_mail_admin'])) {
|
if(!Validator::email($_SESSION['var_mail_admin'])) {
|
||||||
error($locale['step_config_mail_admin_error']);
|
error($locale['step_config_mail_admin_error']);
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
if(!check_mail($_SESSION['var_mail_address'])) {
|
if(!Validator::email($_SESSION['var_mail_address'])) {
|
||||||
error($locale['step_config_mail_address_error']);
|
error($locale['step_config_mail_address_error']);
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
@ -15,19 +15,20 @@ $views_counter = 1; // default value, must be here!
|
|||||||
if($cache->enabled())
|
if($cache->enabled())
|
||||||
{
|
{
|
||||||
$value = 0;
|
$value = 0;
|
||||||
if(!$cache->fetch('views_counter', $value))
|
if(!$cache->fetch('views_counter', $value) || $value <= 1)
|
||||||
{
|
{
|
||||||
$value = 0;
|
$value = 0;
|
||||||
if(fetchDatabaseConfig('views_counter', $value))
|
if(fetchDatabaseConfig('views_counter', $value))
|
||||||
$views_counter = $value;
|
$views_counter = $value;
|
||||||
else
|
else
|
||||||
registerDatabaseConfig('views_counter', 1); // save in the database
|
registerDatabaseConfig('views_counter', 2); // save in the database
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
$views_counter = $value;
|
$views_counter = $value;
|
||||||
|
}
|
||||||
|
|
||||||
$cache->set('views_counter', ++$views_counter, 60 * 60);
|
$cache->set('views_counter', ++$views_counter, 60 * 60);
|
||||||
if(($views_counter % COUNTER_SYNC) == 0) // sync with database
|
if($views_counter > 1 && ($views_counter % COUNTER_SYNC) == 0) // sync with database
|
||||||
updateDatabaseConfig('views_counter', $views_counter);
|
updateDatabaseConfig('views_counter', $views_counter);
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
|
@ -383,294 +383,6 @@ function delete_guild($id)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate character name.
|
|
||||||
* Name lenght must be 3-25 chars
|
|
||||||
*
|
|
||||||
* @param string $name Name to check
|
|
||||||
* @param string $error Error description will be placed here
|
|
||||||
* @return bool Is name valid?
|
|
||||||
*/
|
|
||||||
function check_name($name, &$error = '')
|
|
||||||
{
|
|
||||||
if(!isset($name[0]))
|
|
||||||
{
|
|
||||||
$error = 'Please enter character name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$length = strlen($name);
|
|
||||||
if($length < 3)
|
|
||||||
{
|
|
||||||
$error = 'Character name is too short. Min. lenght <b>3</b> characters.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($length > 25)
|
|
||||||
{
|
|
||||||
$error = 'Character name is too long. Max. lenght <b>25</b> characters.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- [ ] '") != $length)
|
|
||||||
{
|
|
||||||
$error = 'Invalid name format. Use only A-Z.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return preg_match("/[A-z ']/", $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate account id
|
|
||||||
* Id lenght must be 6-10 chars
|
|
||||||
*
|
|
||||||
* @param string $name Account name to check
|
|
||||||
* @param string $error Error description will be placed here
|
|
||||||
* @return bool Is account name valid?
|
|
||||||
*/
|
|
||||||
function check_account_id($id, &$error = '')
|
|
||||||
{
|
|
||||||
if(!isset($id[0]))
|
|
||||||
{
|
|
||||||
$error = 'Please enter an account.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!check_number($id)) {
|
|
||||||
$error = 'Invalid account name format. Use only numbers 0-9.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$length = strlen($id);
|
|
||||||
if($length < 6)
|
|
||||||
{
|
|
||||||
$error = 'Account is too short (min. 6 chars).';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($length > 10)
|
|
||||||
{
|
|
||||||
$error = 'Account is too long (max. 10 chars).';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate account name
|
|
||||||
* Name lenght must be 3-32 chars
|
|
||||||
*
|
|
||||||
* @param string $name Account name to check
|
|
||||||
* @param string $error Error description will be placed here
|
|
||||||
* @return bool Is account name valid?
|
|
||||||
*/
|
|
||||||
function check_account_name($name, &$error = '')
|
|
||||||
{
|
|
||||||
if(!isset($name[0]))
|
|
||||||
{
|
|
||||||
$error = 'Please enter an account name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$length = strlen($name);
|
|
||||||
if($length < 3)
|
|
||||||
{
|
|
||||||
$error = 'Account name is too short (min. 3 chars).';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($length > 32)
|
|
||||||
{
|
|
||||||
$error = 'Account name is too long (max. 32 chars).';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strspn($name, "QWERTYUIOPASDFGHJKLZXCVBNM0123456789") != $length)
|
|
||||||
{
|
|
||||||
$error = 'Invalid account name format. Use only A-Z and numbers 0-9.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return preg_match("/[A-Z0-9]/", $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
//is it valid nick for new char?
|
|
||||||
function check_name_new_char($name, &$error = '')
|
|
||||||
{
|
|
||||||
global $db, $config;
|
|
||||||
|
|
||||||
$name_lower = strtolower($name);
|
|
||||||
|
|
||||||
$first_words_blocked = array('admin ', 'administrator ', 'gm ', 'cm ', 'god ','tutor ', "'", '-');
|
|
||||||
foreach($first_words_blocked as $word)
|
|
||||||
{
|
|
||||||
if($word == substr($name_lower, 0, strlen($word))) {
|
|
||||||
$error = 'Your name contains blocked words.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-") {
|
|
||||||
$error = 'Your name contains illegal characters.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(substr($name_lower, 1, 1) == ' ') {
|
|
||||||
$error = 'Your name contains illegal space.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(substr($name_lower, -2, 1) == " ") {
|
|
||||||
$error = 'Your name contains illegal space.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strtolower($config['lua']['serverName']) == $name_lower) {
|
|
||||||
$error = 'Your name cannot be same as server name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$names_blocked = array('admin', 'administrator', 'gm', 'cm', 'god', 'tutor');
|
|
||||||
foreach($names_blocked as $word)
|
|
||||||
{
|
|
||||||
if($word == $name_lower) {
|
|
||||||
$error = 'Your name contains blocked words.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$words_blocked = array('admin', 'administrator', 'gamemaster', 'game master', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor');
|
|
||||||
foreach($words_blocked as $word)
|
|
||||||
{
|
|
||||||
if(!(strpos($name_lower, $word) === false)) {
|
|
||||||
$error = 'Your name contains illegal words.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$name_length = strlen($name_lower);
|
|
||||||
for($i = 0; $i < $name_length; $i++)
|
|
||||||
{
|
|
||||||
if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2]) {
|
|
||||||
$error = 'Your name is invalid.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for($i = 0; $i < $name_length; $i++)
|
|
||||||
{
|
|
||||||
if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ') {
|
|
||||||
$error = 'Your name contains too many spaces.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($config['monsters']))
|
|
||||||
{
|
|
||||||
if(in_array($name_lower, $config['monsters'])) {
|
|
||||||
$error = 'Your name cannot contains monster name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$player = new OTS_Player();
|
|
||||||
$player->find($name);
|
|
||||||
if($player->isLoaded()) {
|
|
||||||
$error = 'Character with this name already exist.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if was namelocked previously
|
|
||||||
if(tableExist('player_namelocks') && fieldExist('name', 'player_namelocks')) {
|
|
||||||
$namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name));
|
|
||||||
if($namelock->rowCount() > 0) {
|
|
||||||
$error = 'Character with this name has been namelocked.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower));
|
|
||||||
if($monsters->rowCount() > 0) {
|
|
||||||
$error = 'Your name cannot contains monster name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower));
|
|
||||||
if($spells_name->rowCount() > 0) {
|
|
||||||
$error = 'Your name cannot contains spell name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower));
|
|
||||||
if($spells_words->rowCount() > 0) {
|
|
||||||
$error = 'Your name cannot contains spell name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($config['npc']))
|
|
||||||
{
|
|
||||||
if(in_array($name_lower, $config['npc'])) {
|
|
||||||
$error = 'Your name cannot contains NPC name.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) {
|
|
||||||
$error = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($name_length < 3 || $name_length > 28) {
|
|
||||||
$error = 'Your name cannot be shorter than 3 characters and longer than 28 characters.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!preg_match("/[A-z ']{3,28}/", $name)) {
|
|
||||||
$error = 'Your name containst illegal characters.';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_rank_name($name)
|
|
||||||
{
|
|
||||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-[ ] ") != strlen($name))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return preg_match("/[A-z ]{1,32}/", $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_guild_name($name)
|
|
||||||
{
|
|
||||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789- ") != strlen($name))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return preg_match("/[A-z ]{3,32}/", $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_password($pass)
|
|
||||||
{
|
|
||||||
if(strspn($pass, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($pass))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return preg_match("/[A-z0-9]/", $pass);
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_mail($email)
|
|
||||||
{
|
|
||||||
return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email);
|
|
||||||
//return preg_match("/[A-z0-9._-]+@[A-z0-9-]+\.[A-z]{2,4}/", $email);
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_number($number)
|
|
||||||
{
|
|
||||||
return preg_match ("/^([0-9]+)$/", $number);
|
|
||||||
}
|
|
||||||
|
|
||||||
//################### DISPLAY FUNCTIONS #####################
|
//################### DISPLAY FUNCTIONS #####################
|
||||||
//return shorter text (news ticker)
|
//return shorter text (news ticker)
|
||||||
function short_text($text, $limit)
|
function short_text($text, $limit)
|
||||||
@ -1230,4 +942,7 @@ function str_replace_first($search, $replace, $subject) {
|
|||||||
}
|
}
|
||||||
return $subject;
|
return $subject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validator functions
|
||||||
|
require_once(LIBS . 'validator.php');
|
||||||
?>
|
?>
|
||||||
|
@ -32,7 +32,7 @@ require_once(SYSTEM . 'libs/cache.php');
|
|||||||
$cache = Cache::getInstance($config['cache_engine'], $config['cache_prefix']);
|
$cache = Cache::getInstance($config['cache_engine'], $config['cache_prefix']);
|
||||||
|
|
||||||
// twig
|
// twig
|
||||||
require_once LIBS . 'Twig/Autoloader.php';
|
require_once(LIBS . 'Twig/Autoloader.php');
|
||||||
Twig_Autoloader::register();
|
Twig_Autoloader::register();
|
||||||
|
|
||||||
$twig_loader = new Twig_Loader_Filesystem(SYSTEM . 'templates');
|
$twig_loader = new Twig_Loader_Filesystem(SYSTEM . 'templates');
|
||||||
|
@ -2363,7 +2363,7 @@ class OTS_Player extends OTS_Row_DAO
|
|||||||
'skill_shielding' => POT::SKILL_SHIELD,
|
'skill_shielding' => POT::SKILL_SHIELD,
|
||||||
'skill_fishing' => POT::SKILL_FISH
|
'skill_fishing' => POT::SKILL_FISH
|
||||||
);
|
);
|
||||||
if(check_number($skill))
|
if(Validator::number($skill))
|
||||||
$this->skills[ (int) $skill]['value'] = (int) $value;
|
$this->skills[ (int) $skill]['value'] = (int) $value;
|
||||||
else {
|
else {
|
||||||
$this->skills[ (int) $skill_ids[$skill]]['value'] = (int) $value;
|
$this->skills[ (int) $skill_ids[$skill]]['value'] = (int) $value;
|
||||||
@ -2409,7 +2409,7 @@ class OTS_Player extends OTS_Row_DAO
|
|||||||
'skill_fishing' => POT::SKILL_FISH
|
'skill_fishing' => POT::SKILL_FISH
|
||||||
);
|
);
|
||||||
|
|
||||||
if(check_number($skill))
|
if(Validator::number($skill))
|
||||||
$this->skills[ (int) $skill]['tries'] = (int) $tries;
|
$this->skills[ (int) $skill]['tries'] = (int) $tries;
|
||||||
else {
|
else {
|
||||||
$this->skills[ (int) $skill_ids[$skill]]['tries'] = (int) $tries;
|
$this->skills[ (int) $skill_ids[$skill]]['tries'] = (int) $tries;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Spells {
|
class Spells {
|
||||||
public static function loadFromXML($show = false) {
|
public static function loadFromXML($show = false) {
|
||||||
global $config, $db;
|
global $config, $db;
|
||||||
@ -35,7 +34,7 @@ class Spells {
|
|||||||
$vocations_to_db = "";
|
$vocations_to_db = "";
|
||||||
$voc_nr = 0;
|
$voc_nr = 0;
|
||||||
foreach($vocations as $vocation_to_add) {
|
foreach($vocations as $vocation_to_add) {
|
||||||
if(check_number($vocation_to_add)) {
|
if(Validator::number($vocation_to_add)) {
|
||||||
$vocations_to_db .= $vocation_to_add;
|
$vocations_to_db .= $vocation_to_add;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -98,7 +97,7 @@ class Spells {
|
|||||||
$vocations_to_db = "";
|
$vocations_to_db = "";
|
||||||
$voc_nr = 0;
|
$voc_nr = 0;
|
||||||
foreach($vocations as $vocation_to_add) {
|
foreach($vocations as $vocation_to_add) {
|
||||||
if(check_number($vocation_to_add)) {
|
if(Validator::number($vocation_to_add)) {
|
||||||
$vocations_to_db .= $vocation_to_add;
|
$vocations_to_db .= $vocation_to_add;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -12,15 +12,393 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
|
|
||||||
class Validator
|
class Validator
|
||||||
{
|
{
|
||||||
|
private static $lastError = '';
|
||||||
|
public static function number($number) {
|
||||||
|
if(!preg_match("/^([0-9]+)$/", $number)) {
|
||||||
|
self::$lastError = 'Invalid number format.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate account id
|
||||||
|
* Id lenght must be 6-10 chars
|
||||||
|
*
|
||||||
|
* @param string $id Account id to check
|
||||||
|
* @return bool Is account name valid?
|
||||||
|
*/
|
||||||
|
public static function accountId($id)
|
||||||
|
{
|
||||||
|
if(!isset($id[0]))
|
||||||
|
{
|
||||||
|
self::$lastError = 'Please enter your account number!';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Validator::number($id)) {
|
||||||
|
self::$lastError = 'Invalid account number format. Please use only numbers 0-9.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$length = strlen($id);
|
||||||
|
if($length < 6)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Account is too short (min. 6 chars).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($length > 10)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Account is too long (max. 10 chars).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate account name
|
||||||
|
* Name lenght must be 3-32 chars
|
||||||
|
*
|
||||||
|
* @param string $name Account name to check
|
||||||
|
* @return bool Is account name valid?
|
||||||
|
*/
|
||||||
|
public static function accountName($name)
|
||||||
|
{
|
||||||
|
if(!isset($name[0]))
|
||||||
|
{
|
||||||
|
self::$lastError = 'Please enter your account name!';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$length = strlen($name);
|
||||||
|
if($length < 3)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Account name is too short (min. 3 chars).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($length > 32)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Account name is too long (max. 32 chars).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strspn($name, "QWERTYUIOPASDFGHJKLZXCVBNM0123456789") != $length)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Invalid account name format. Use only A-Z and numbers 0-9.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match("/[A-Z0-9]/", $name))
|
||||||
|
{
|
||||||
|
self::$lastError = 'Invalid account name format. Use only A-Z and numbers 0-9.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Advanced mail validator
|
* Advanced mail validator
|
||||||
*
|
*
|
||||||
* @param string $email
|
* @param string $email
|
||||||
|
* @return bool Is email valid?
|
||||||
*/
|
*/
|
||||||
public static function email($email) {
|
public static function email($email) {
|
||||||
return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email);
|
if(empty($email)) {
|
||||||
|
self::$lastError = 'Please enter your new email address.';
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(strlen($email) > 255) {
|
||||||
|
self::$lastError = 'E-mail is too long (max. 255 chars).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email)) {
|
||||||
|
self::$lastError = 'Invalid e-mail format.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate account password
|
||||||
|
* Name lenght must be 3-32 chars
|
||||||
|
*
|
||||||
|
* @param string $name Account name to check
|
||||||
|
* @return bool Is account name valid?
|
||||||
|
*/
|
||||||
|
public static function password($password)
|
||||||
|
{
|
||||||
|
if (!isset($password[0])) {
|
||||||
|
self::$lastError = 'Please enter the password.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($password) < 8 || strlen($password) > 30) {
|
||||||
|
self::$lastError = 'The password must have at least 8 and maximum 30 letters!';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strspn($password, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($password)) {
|
||||||
|
self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ctype_alnum($password)) {
|
||||||
|
self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match('/[a-zA-Z]/', $password)) {
|
||||||
|
self::$lastError = 'The password must contain at least one letter A-Z or a-z!';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match('/[0-9]/', $password)) {
|
||||||
|
self::$lastError = 'The password must contain at least one letter other than A-Z or a-z!';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate character name.
|
||||||
|
* Name lenght must be 3-25 chars
|
||||||
|
*
|
||||||
|
* @param string $name Name to check
|
||||||
|
* @return bool Is name valid?
|
||||||
|
*/
|
||||||
|
public static function characterName($name)
|
||||||
|
{
|
||||||
|
if(!isset($name[0]))
|
||||||
|
{
|
||||||
|
self::$lastError = 'Please enter character name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$length = strlen($name);
|
||||||
|
if($length < 3)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Character name is too short. Min. lenght <b>3</b> characters.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($length > 25)
|
||||||
|
{
|
||||||
|
self::$lastError = 'Character name is too long. Max. lenght <b>25</b> characters.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- [ ] '") != $length)
|
||||||
|
{
|
||||||
|
self::$lastError = "Invalid name format. Use only A-Z, spaces and '.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!preg_match("/[A-z ']/", $name))
|
||||||
|
{
|
||||||
|
self::$lastError = "Invalid name format. Use only A-Z, spaces and '.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate new character name.
|
||||||
|
* Name lenght must be 3-25 chars
|
||||||
|
*
|
||||||
|
* @param string $name Name to check
|
||||||
|
* @return bool Is name valid?
|
||||||
|
*/
|
||||||
|
public static function newCharacterName($name)
|
||||||
|
{
|
||||||
|
global $db, $config;
|
||||||
|
|
||||||
|
$name_lower = strtolower($name);
|
||||||
|
|
||||||
|
$first_words_blocked = array('admin ', 'administrator ', 'gm ', 'cm ', 'god ','tutor ', "'", '-');
|
||||||
|
foreach($first_words_blocked as $word)
|
||||||
|
{
|
||||||
|
if($word == substr($name_lower, 0, strlen($word))) {
|
||||||
|
self::$lastError = 'Your name contains blocked words.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-") {
|
||||||
|
self::$lastError = 'Your name contains illegal characters.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(substr($name_lower, 1, 1) == ' ') {
|
||||||
|
self::$lastError = 'Your name contains illegal space.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(substr($name_lower, -2, 1) == " ") {
|
||||||
|
self::$lastError = 'Your name contains illegal space.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strtolower($config['lua']['serverName']) == $name_lower) {
|
||||||
|
self::$lastError = 'Your name cannot be same as server name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$names_blocked = array('admin', 'administrator', 'gm', 'cm', 'god', 'tutor');
|
||||||
|
foreach($names_blocked as $word)
|
||||||
|
{
|
||||||
|
if($word == $name_lower) {
|
||||||
|
self::$lastError = 'Your name contains blocked words.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$words_blocked = array('admin', 'administrator', 'gamemaster', 'game master', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor');
|
||||||
|
foreach($words_blocked as $word)
|
||||||
|
{
|
||||||
|
if(!(strpos($name_lower, $word) === false)) {
|
||||||
|
self::$lastError = 'Your name contains illegal words.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$name_length = strlen($name_lower);
|
||||||
|
for($i = 0; $i < $name_length; $i++)
|
||||||
|
{
|
||||||
|
if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2]) {
|
||||||
|
self::$lastError = 'Your name is invalid.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for($i = 0; $i < $name_length; $i++)
|
||||||
|
{
|
||||||
|
if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ') {
|
||||||
|
self::$lastError = 'Your name contains too many spaces.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($config['monsters']))
|
||||||
|
{
|
||||||
|
if(in_array($name_lower, $config['monsters'])) {
|
||||||
|
self::$lastError = 'Your name cannot contains monster name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$player = new OTS_Player();
|
||||||
|
$player->find($name);
|
||||||
|
if($player->isLoaded()) {
|
||||||
|
self::$lastError = 'Character with this name already exist.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if was namelocked previously
|
||||||
|
if(tableExist('player_namelocks') && fieldExist('name', 'player_namelocks')) {
|
||||||
|
$namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name));
|
||||||
|
if($namelock->rowCount() > 0) {
|
||||||
|
self::$lastError = 'Character with this name has been namelocked.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||||
|
if($monsters->rowCount() > 0) {
|
||||||
|
self::$lastError = 'Your name cannot contains monster name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||||
|
if($spells_name->rowCount() > 0) {
|
||||||
|
self::$lastError = 'Your name cannot contains spell name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower));
|
||||||
|
if($spells_words->rowCount() > 0) {
|
||||||
|
self::$lastError = 'Your name cannot contains spell name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($config['npc']))
|
||||||
|
{
|
||||||
|
if(in_array($name_lower, $config['npc'])) {
|
||||||
|
self::$lastError = 'Your name cannot contains NPC name.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) {
|
||||||
|
self::$lastError = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($name_length < 3 || $name_length > 28) {
|
||||||
|
self::$lastError = 'Your name cannot be shorter than 3 characters and longer than 28 characters.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!preg_match("/[A-z ']{3,28}/", $name)) {
|
||||||
|
self::$lastError = 'Your name containst illegal characters.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate guild name
|
||||||
|
* Name lenght must be 3-32 chars
|
||||||
|
*
|
||||||
|
* @param string $name Name to check
|
||||||
|
* @return bool Is name valid?
|
||||||
|
*/
|
||||||
|
public static function guildName($name)
|
||||||
|
{
|
||||||
|
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789- ") != strlen($name)) {
|
||||||
|
self::$lastError = 'Invalid guild name format.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match("/[A-z ]{3,32}/", $name)) {
|
||||||
|
self::$lastError = 'Invalid guild name format.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate rank name
|
||||||
|
* Rank lenght must be 1-32 chars
|
||||||
|
*
|
||||||
|
* @param string $name Name to check
|
||||||
|
* @return bool Is name valid?
|
||||||
|
*/
|
||||||
|
public static function rankName($name)
|
||||||
|
{
|
||||||
|
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-[ ] ") != strlen($name)) {
|
||||||
|
self::$lastError = 'Invalid rank name. Please use only a-Z, 0-9 and spaces.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!preg_match("/[A-z ]{1,32}/", $name)) {
|
||||||
|
self::$lastError = 'Invalid rank name. Please use only a-Z, 0-9 and spaces.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Simple string validator, checks if string contains valid characters
|
* Simple string validator, checks if string contains valid characters
|
||||||
*
|
*
|
||||||
@ -30,5 +408,9 @@ class Validator
|
|||||||
public static function str($str, $numbers = false) {
|
public static function str($str, $numbers = false) {
|
||||||
return preg_match('/^[a-z0-9\ ]*$/i', $str);
|
return preg_match('/^[a-z0-9\ ]*$/i', $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getLastError() {
|
||||||
|
return self::$lastError;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -141,17 +141,12 @@ $errors = array();
|
|||||||
if($new_password != $new_password2) {
|
if($new_password != $new_password2) {
|
||||||
$errors[] = "The new passwords do not match!";
|
$errors[] = "The new passwords do not match!";
|
||||||
}
|
}
|
||||||
else if($password_strlen < 8) {
|
|
||||||
$errors[] = "New password minimal length is 8 characters.";
|
|
||||||
}
|
|
||||||
else if($password_strlen > 32) {
|
|
||||||
$errors[] = "New password maximal length is 32 characters.";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
if(!check_password($new_password)) {
|
if(!Validator::password($new_password)) {
|
||||||
$errors[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!). Minimum password length is 7 characters and maximum 32.";
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
$old_password = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $old_password);
|
$old_password = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $old_password);
|
||||||
if($old_password != $account_logged->getPassword()) {
|
if($old_password != $account_logged->getPassword()) {
|
||||||
$errors[] = "Current password is incorrect!";
|
$errors[] = "Current password is incorrect!";
|
||||||
@ -215,14 +210,8 @@ if($action == "changeemail") {
|
|||||||
$email_new = $_POST['new_email'];
|
$email_new = $_POST['new_email'];
|
||||||
$post_password = $_POST['password'];
|
$post_password = $_POST['password'];
|
||||||
|
|
||||||
if(empty($email_new)) {
|
if(!Validator::email($email_new)) {
|
||||||
$errors[] = 'Please enter your new email address.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!check_mail($email_new)) {
|
|
||||||
$errors[] = 'Email address is not correct.';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($post_password)) {
|
if(empty($post_password)) {
|
||||||
@ -536,7 +525,7 @@ if($action == "changeemail") {
|
|||||||
$new_hideacc = isset($_POST['accountvisible']) ? (int)$_POST['accountvisible'] : NULL;
|
$new_hideacc = isset($_POST['accountvisible']) ? (int)$_POST['accountvisible'] : NULL;
|
||||||
|
|
||||||
if($player_name != null) {
|
if($player_name != null) {
|
||||||
if (check_name($player_name)) {
|
if (Validator::characterName($player_name)) {
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$player->find($player_name);
|
$player->find($player_name);
|
||||||
if ($player->isLoaded()) {
|
if ($player->isLoaded()) {
|
||||||
@ -609,9 +598,8 @@ if($action == "changeemail") {
|
|||||||
|
|
||||||
if(empty($errors))
|
if(empty($errors))
|
||||||
{
|
{
|
||||||
$error = '';
|
if(!admin() && !Validator::newCharacterName($name))
|
||||||
if(!admin() && !check_name_new_char($name, $error))
|
$errors[] = Validator::getLastError();
|
||||||
$errors[] = $error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -654,6 +642,7 @@ if($action == "changeemail") {
|
|||||||
|
|
||||||
echo $twig->render('account.change_name.html.twig', array(
|
echo $twig->render('account.change_name.html.twig', array(
|
||||||
'points' => $points,
|
'points' => $points,
|
||||||
|
'errors' => $errors
|
||||||
//'account_players' => $account_logged->getPlayersList()
|
//'account_players' => $account_logged->getPlayersList()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -743,7 +732,7 @@ if($action == "changeemail") {
|
|||||||
$password_verify = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $password_verify);
|
$password_verify = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $password_verify);
|
||||||
if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
|
if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
|
||||||
if(!empty($player_name) && !empty($password_verify)) {
|
if(!empty($player_name) && !empty($password_verify)) {
|
||||||
if(check_name($player_name)) {
|
if(Validator::characterName($player_name)) {
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$player->find($player_name);
|
$player->find($player_name);
|
||||||
if($player->isLoaded()) {
|
if($player->isLoaded()) {
|
||||||
@ -805,18 +794,23 @@ if($action == "changeemail") {
|
|||||||
$newchar_town = isset($_POST['town']) ? $_POST['town'] : NULL;
|
$newchar_town = isset($_POST['town']) ? $_POST['town'] : NULL;
|
||||||
|
|
||||||
$newchar_created = false;
|
$newchar_created = false;
|
||||||
if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) {
|
$save = isset($_POST['save']) && $_POST['save'] == 1;
|
||||||
|
if($save) {
|
||||||
if(empty($newchar_name))
|
if(empty($newchar_name))
|
||||||
$errors[] = 'Please enter a name for your character!';
|
$errors['name'] = 'Please enter a name for your character!';
|
||||||
else if(strlen($newchar_name) > 25)
|
else if(strlen($newchar_name) > 25)
|
||||||
$errors[] = 'Name is too long. Max. lenght <b>25</b> letters.';
|
$errors['name'] = 'Name is too long. Max. lenght <b>25</b> letters.';
|
||||||
else if(strlen($newchar_name) < 3)
|
else if(strlen($newchar_name) < 3)
|
||||||
$errors[] = 'Name is too short. Min. lenght <b>3</b> letters.';
|
$errors['name'] = 'Name is too short. Min. lenght <b>3</b> letters.';
|
||||||
else {
|
else {
|
||||||
|
if(!admin() && !Validator::newCharacterName($newchar_name)) {
|
||||||
|
$errors['name'] = Validator::getLastError();
|
||||||
|
}
|
||||||
|
|
||||||
$exist = new OTS_Player();
|
$exist = new OTS_Player();
|
||||||
$exist->find($newchar_name);
|
$exist->find($newchar_name);
|
||||||
if($exist->isLoaded()) {
|
if($exist->isLoaded()) {
|
||||||
$errors[] = 'Character with this name already exist.';
|
$errors['name'] = 'Character with this name already exist.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -840,10 +834,6 @@ if($action == "changeemail") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
$error = '';
|
|
||||||
if(!admin() && !check_name_new_char($newchar_name, $error)) {
|
|
||||||
$errors[] = $error;
|
|
||||||
}
|
|
||||||
if(!isset($config['genders'][$newchar_sex]))
|
if(!isset($config['genders'][$newchar_sex]))
|
||||||
$errors[] = 'Sex is invalid.';
|
$errors[] = 'Sex is invalid.';
|
||||||
if(!in_array($newchar_town, $config['character_towns']))
|
if(!in_array($newchar_town, $config['character_towns']))
|
||||||
@ -865,7 +855,7 @@ if($action == "changeemail") {
|
|||||||
{
|
{
|
||||||
$number_of_players_on_account = $account_logged->getPlayersList()->count();
|
$number_of_players_on_account = $account_logged->getPlayersList()->count();
|
||||||
if($number_of_players_on_account >= $config['characters_per_account'])
|
if($number_of_players_on_account >= $config['characters_per_account'])
|
||||||
$errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['characters_per_account'].')</b>!';
|
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['characters_per_account'].')</b>!';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors))
|
if(empty($errors))
|
||||||
@ -874,7 +864,7 @@ if($action == "changeemail") {
|
|||||||
$char_to_copy = new OTS_Player();
|
$char_to_copy = new OTS_Player();
|
||||||
$char_to_copy->find($char_to_copy_name);
|
$char_to_copy->find($char_to_copy_name);
|
||||||
if(!$char_to_copy->isLoaded())
|
if(!$char_to_copy->isLoaded())
|
||||||
$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: <b>'.$char_to_copy_name.'</b> doesn\'t exist.';
|
$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: <b>'.$char_to_copy_name.'</b> doesn\'t exist.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors))
|
if(empty($errors))
|
||||||
@ -986,7 +976,9 @@ if($action == "changeemail") {
|
|||||||
'name' => $newchar_name,
|
'name' => $newchar_name,
|
||||||
'sex' => $newchar_sex,
|
'sex' => $newchar_sex,
|
||||||
'vocation' => $newchar_vocation,
|
'vocation' => $newchar_vocation,
|
||||||
'town' => $newchar_town
|
'town' => $newchar_town,
|
||||||
|
'save' => $save,
|
||||||
|
'errors' => $errors
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function echo_error($message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function verify_number($number, $name, $max_length) {
|
function verify_number($number, $name, $max_length) {
|
||||||
if(!check_number($number))
|
if(!Validator::number($number))
|
||||||
echo_error($name . ' can contain only numbers.');
|
echo_error($name . ' can contain only numbers.');
|
||||||
|
|
||||||
$number_length = strlen($number);
|
$number_length = strlen($number);
|
||||||
@ -50,11 +50,11 @@ $id = 0;
|
|||||||
if(isset($_REQUEST['id']))
|
if(isset($_REQUEST['id']))
|
||||||
$id = (int)$_REQUEST['id'];
|
$id = (int)$_REQUEST['id'];
|
||||||
else if(isset($_REQUEST['search_name'])) {
|
else if(isset($_REQUEST['search_name'])) {
|
||||||
if(strlen($_REQUEST['search_name']) < 3 && !check_number($_REQUEST['search_name'])) {
|
if(strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) {
|
||||||
echo 'Player name is too short.';
|
echo 'Player name is too short.';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(check_number($_REQUEST['search_name']))
|
if(Validator::number($_REQUEST['search_name']))
|
||||||
$id = $_REQUEST['search_name'];
|
$id = $_REQUEST['search_name'];
|
||||||
else {
|
else {
|
||||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
||||||
@ -90,11 +90,11 @@ if($id > 0) {
|
|||||||
|
|
||||||
$name = $_POST['name'];
|
$name = $_POST['name'];
|
||||||
$_error = '';
|
$_error = '';
|
||||||
if(!check_name($name, $_error))
|
if(!Validator::characterName($name))
|
||||||
echo_error($_error);
|
echo_error(Validator::getLastError());
|
||||||
|
|
||||||
//if(!check_name_new_char($name, $_error))
|
//if(!Validator::newCharacterName($name)
|
||||||
// echo_error($_error);
|
// echo_error(Validator::getLastError());
|
||||||
|
|
||||||
$player_db = $ots->createObject('Player');
|
$player_db = $ots->createObject('Player');
|
||||||
$player_db->find($name);
|
$player_db->find($name);
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Characters';
|
$title = 'Characters';
|
||||||
|
|
||||||
require(SYSTEM . 'item.php');
|
require_once(SYSTEM . 'item.php');
|
||||||
|
|
||||||
$groups = new OTS_Groups_List();
|
$groups = new OTS_Groups_List();
|
||||||
function generate_search_form($autofocus = false)
|
function generate_search_form($autofocus = false)
|
||||||
{
|
{
|
||||||
@ -213,7 +214,7 @@ if($player->isLoaded() && !$player->isDeleted())
|
|||||||
|
|
||||||
for($i = 1; $i < 11; $i++)
|
for($i = 1; $i < 11; $i++)
|
||||||
{
|
{
|
||||||
if(check_number($equipment[$i]))
|
if(Validator::number($equipment[$i]))
|
||||||
$equipment[$i] = getItemImage($equipment[$i]);
|
$equipment[$i] = getItemImage($equipment[$i]);
|
||||||
else
|
else
|
||||||
$equipment[$i] = '<img src="images/items/' . $equipment[$i] . '.gif" width="32" height="32" border="0" alt=" ' . $equipment[$i] . '" />';
|
$equipment[$i] = '<img src="images/items/' . $equipment[$i] . '.gif" width="32" height="32" border="0" alt=" ' . $equipment[$i] . '" />';
|
||||||
|
@ -22,8 +22,8 @@ if($logged)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$step = isset($_POST['step']) ? $_POST['step'] : '';
|
$save = isset($_POST['save']) && $_POST['save'] == 1;
|
||||||
if($step == 'save')
|
if($save)
|
||||||
{
|
{
|
||||||
if(USE_ACCOUNT_NAME) {
|
if(USE_ACCOUNT_NAME) {
|
||||||
$account_name = $_POST['account'];
|
$account_name = $_POST['account'];
|
||||||
@ -38,23 +38,15 @@ if($step == 'save')
|
|||||||
|
|
||||||
// account
|
// account
|
||||||
if(isset($account_id)) {
|
if(isset($account_id)) {
|
||||||
if(empty($account_id))
|
if(!Validator::accountId($account_id))
|
||||||
$errors['account'] = 'Please enter your account number!';
|
$errors['account'] = Validator::getLastError();
|
||||||
else if(!check_number($account_id))
|
|
||||||
$errors['account'] = 'Invalid account number format. Please use only numbers 0-9.';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(empty($account_name))
|
|
||||||
$errors['account'] = 'Please enter your account name!';
|
|
||||||
else if(!check_account_name($account_name_up))
|
|
||||||
$errors['account'] = 'Invalid account name format. Please use only A-Z and numbers 0-9.';
|
|
||||||
}
|
}
|
||||||
|
else if(!Validator::accountName($account_name_up))
|
||||||
|
$errors['account'] = Validator::getLastError();
|
||||||
|
|
||||||
// email
|
// email
|
||||||
if(empty($email))
|
if(!Validator::email($email))
|
||||||
$errors['email'] = 'Please enter your email address!';
|
$errors['email'] = Validator::getLastError();
|
||||||
else if(!check_mail($email))
|
|
||||||
$errors['email'] = 'Email address is not correct.';
|
|
||||||
|
|
||||||
// country
|
// country
|
||||||
$country = '';
|
$country = '';
|
||||||
@ -81,14 +73,14 @@ if($step == 'save')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// password
|
// password
|
||||||
if(empty($password))
|
if(!isset($password[0])) {
|
||||||
$errors['password'] = 'Please enter the password for your new account.';
|
$errors['password'] = 'Please enter the password for your new account.';
|
||||||
elseif($password != $password2)
|
}
|
||||||
|
elseif($password != $password2) {
|
||||||
$errors['password'] = 'Passwords are not the same.';
|
$errors['password'] = 'Passwords are not the same.';
|
||||||
else
|
}
|
||||||
{
|
else if(!Validator::password($password)) {
|
||||||
if(!check_password($password))
|
$errors['password'] = Validator::getLastError();
|
||||||
$errors['password'] = 'Password contains illegal chars (a-z, A-Z and 0-9 only!). Minimum password length is 7 characters and maximum 32.';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if account name is not equal to password
|
// check if account name is not equal to password
|
||||||
@ -246,6 +238,7 @@ if($step == 'save')
|
|||||||
'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] : false,
|
'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] : false,
|
||||||
'country_recognized' => $country_recognized,
|
'country_recognized' => $country_recognized,
|
||||||
'country' => isset($country) ? $country : null,
|
'country' => isset($country) ? $country : null,
|
||||||
'errors' => $errors
|
'errors' => $errors,
|
||||||
|
'save' => $save
|
||||||
));
|
));
|
||||||
?>
|
?>
|
@ -76,17 +76,17 @@ if(isset($_GET['image']))
|
|||||||
$image = $image->fetch();
|
$image = $image->fetch();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo 'Image with this name does not exists.';
|
echo 'Image with this id does not exists.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$previous_image = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] - 1) . ' ORDER by `ordering`;');
|
$previous_image = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] - 1) . ' ORDER by `ordering`;');
|
||||||
if($previous_image->rowCount() == 1)
|
if($previous_image->rowCount() == 1)
|
||||||
$previous_image = $previous_image->fetch();
|
$previous_image = $previous_image->fetch();
|
||||||
else
|
else
|
||||||
$previous_image = NULL;
|
$previous_image = NULL;
|
||||||
|
|
||||||
$next_image = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] + 1) . ' ORDER by `ordering`;');
|
$next_image = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] + 1) . ' ORDER by `ordering`;');
|
||||||
if($next_image->rowCount() == 1)
|
if($next_image->rowCount() == 1)
|
||||||
$next_image = $next_image->fetch();
|
$next_image = $next_image->fetch();
|
||||||
else
|
else
|
||||||
|
@ -159,8 +159,8 @@ if($action == '')
|
|||||||
if($action == 'show')
|
if($action == 'show')
|
||||||
{
|
{
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name))
|
if(!Validator::guildName($guild_name))
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
if(empty($guild_errors))
|
if(empty($guild_errors))
|
||||||
{
|
{
|
||||||
$guild = $ots->createObject('Guild');
|
$guild = $ots->createObject('Guild');
|
||||||
@ -424,8 +424,8 @@ if($action == 'show')
|
|||||||
if($action == 'changerank')
|
if($action == 'changerank')
|
||||||
{
|
{
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name))
|
if(!Validator::guildName($guild_name))
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
if(!$logged)
|
if(!$logged)
|
||||||
$guild_errors[] = 'You are not logged in. You can\'t change rank.';
|
$guild_errors[] = 'You are not logged in. You can\'t change rank.';
|
||||||
if(empty($guild_errors))
|
if(empty($guild_errors))
|
||||||
@ -513,7 +513,7 @@ echo '
|
|||||||
{
|
{
|
||||||
$player_name = stripslashes($_REQUEST['name']);
|
$player_name = stripslashes($_REQUEST['name']);
|
||||||
$new_rank = (int) $_REQUEST['rankid'];
|
$new_rank = (int) $_REQUEST['rankid'];
|
||||||
if(!check_name($player_name))
|
if(!Validator::characterName($player_name))
|
||||||
$change_errors[] = 'Invalid player name format.';
|
$change_errors[] = 'Invalid player name format.';
|
||||||
$rank = $ots->createObject('GuildRank');
|
$rank = $ots->createObject('GuildRank');
|
||||||
$rank->load($new_rank);
|
$rank->load($new_rank);
|
||||||
@ -625,9 +625,9 @@ if($action == 'deleteinvite')
|
|||||||
$name = stripslashes($_REQUEST['name']);
|
$name = stripslashes($_REQUEST['name']);
|
||||||
if(!$logged)
|
if(!$logged)
|
||||||
$guild_errors[] = 'You are not logged in. You can\'t delete invitations.';
|
$guild_errors[] = 'You are not logged in. You can\'t delete invitations.';
|
||||||
if(!check_guild_name($guild_name))
|
if(!Validator::guildName($guild_name))
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
if(!check_name($name))
|
if(!Validator($name))
|
||||||
$guild_errors[] = 'Invalid name format.';
|
$guild_errors[] = 'Invalid name format.';
|
||||||
if(empty($guild_errors))
|
if(empty($guild_errors))
|
||||||
{
|
{
|
||||||
@ -726,8 +726,8 @@ if($action == 'invite')
|
|||||||
$guild_errors[] = 'You are not logged in. You can\'t invite players.';
|
$guild_errors[] = 'You are not logged in. You can\'t invite players.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
@ -770,7 +770,7 @@ if($action == 'invite')
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
||||||
if(!check_name($name)) {
|
if(!Validator::characterName($name)) {
|
||||||
$guild_errors[] = 'Invalid name format.';
|
$guild_errors[] = 'Invalid name format.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,8 +831,8 @@ if($action == 'acceptinvite') {
|
|||||||
if(!$logged) {
|
if(!$logged) {
|
||||||
$errors[] = 'You are not logged in. You can\'t accept invitations.';
|
$errors[] = 'You are not logged in. You can\'t accept invitations.';
|
||||||
}
|
}
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
$guild = $ots->createObject('Guild');
|
$guild = $ots->createObject('Guild');
|
||||||
@ -843,7 +843,7 @@ if($action == 'acceptinvite') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
||||||
if(!check_name($name)) {
|
if(!Validator::characterName($name)) {
|
||||||
$errors[] = 'Invalid name format.';
|
$errors[] = 'Invalid name format.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -947,11 +947,11 @@ if($action == 'kickplayer') {
|
|||||||
$errors[] = 'You are not logged in. You can\'t kick characters.';
|
$errors[] = 'You are not logged in. You can\'t kick characters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_name($name)) {
|
if(!Validator::characterName($name)) {
|
||||||
$errors[] = 'Invalid name format.';
|
$errors[] = 'Invalid name format.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,8 +1052,8 @@ if($action == 'leaveguild') {
|
|||||||
$errors[] = 'You are not logged in. You can\'t leave guild.';
|
$errors[] = 'You are not logged in. You can\'t leave guild.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -1068,7 +1068,7 @@ if($action == 'leaveguild') {
|
|||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
$guild_owner_name = $guild->getOwner()->getName();
|
$guild_owner_name = $guild->getOwner()->getName();
|
||||||
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
|
||||||
if(!check_name($name)) {
|
if(!Validator::characterName($name)) {
|
||||||
$errors[] = 'Invalid name format.';
|
$errors[] = 'Invalid name format.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,12 +1198,12 @@ if($action == 'createguild')
|
|||||||
|
|
||||||
if($todo == 'save')
|
if($todo == 'save')
|
||||||
{
|
{
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
$guild_name = '';
|
$guild_name = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_name($name)) {
|
if(!Validator::characterName($name)) {
|
||||||
$guild_errors[] = 'Invalid character name format.';
|
$guild_errors[] = 'Invalid character name format.';
|
||||||
$name = '';
|
$name = '';
|
||||||
}
|
}
|
||||||
@ -1293,8 +1293,8 @@ else {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'manager') {
|
if($action == 'manager') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
@ -1345,8 +1345,8 @@ if(!empty($guild_errors)) {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'changelogo') {
|
if($action == 'changelogo') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -1463,8 +1463,8 @@ if($action == 'changelogo') {
|
|||||||
if($action == 'deleterank') {
|
if($action == 'deleterank') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
$rank_to_delete = (int) $_REQUEST['rankid'];
|
$rank_to_delete = (int) $_REQUEST['rankid'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
$guild = $ots->createObject('Guild');
|
$guild = $ots->createObject('Guild');
|
||||||
@ -1567,11 +1567,11 @@ echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigBu
|
|||||||
if($action == 'addrank') {
|
if($action == 'addrank') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
$ranknew = $_REQUEST['rank_name'];
|
$ranknew = $_REQUEST['rank_name'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
if(!check_rank_name($ranknew)) {
|
if(!Validator::rankName($ranknew)) {
|
||||||
$guild_errors[] = 'Invalid rank name format.';
|
$guild_errors[] = 'Invalid rank name format.';
|
||||||
}
|
}
|
||||||
if(!$logged) {
|
if(!$logged) {
|
||||||
@ -1630,8 +1630,8 @@ echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigBu
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'changedescription') {
|
if($action == 'changedescription') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -1696,8 +1696,8 @@ if($action == 'changedescription') {
|
|||||||
if($action == 'passleadership') {
|
if($action == 'passleadership') {
|
||||||
$guild_name = isset($_REQUEST['guild']) ? $_REQUEST['guild'] : NULL;
|
$guild_name = isset($_REQUEST['guild']) ? $_REQUEST['guild'] : NULL;
|
||||||
$pass_to = isset($_REQUEST['player']) ? stripslashes($_REQUEST['player']) : NULL;
|
$pass_to = isset($_REQUEST['player']) ? stripslashes($_REQUEST['player']) : NULL;
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$guild_errors[] = 'Invalid guild name format.';
|
$guild_errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
@ -1709,7 +1709,7 @@ if($action == 'passleadership') {
|
|||||||
}
|
}
|
||||||
if(empty($guild_errors)) {
|
if(empty($guild_errors)) {
|
||||||
if(isset($_POST['todo']) && $_POST['todo'] == 'save') {
|
if(isset($_POST['todo']) && $_POST['todo'] == 'save') {
|
||||||
if(!check_name($pass_to)) {
|
if(!Validator::characterName($pass_to)) {
|
||||||
$guild_errors2[] = 'Invalid player name format.';
|
$guild_errors2[] = 'Invalid player name format.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1806,8 +1806,8 @@ if($action == 'passleadership') {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'deleteguild') {
|
if($action == 'deleteguild') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -1878,8 +1878,8 @@ if($action == 'deleteguild') {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'deletebyadmin') {
|
if($action == 'deletebyadmin') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -1936,8 +1936,8 @@ if($action == 'deletebyadmin') {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'changemotd' && MOTD_EXISTS) {
|
if($action == 'changemotd' && MOTD_EXISTS) {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -2000,8 +2000,8 @@ if($action == 'changemotd' && MOTD_EXISTS) {
|
|||||||
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
|
||||||
if($action == 'saveranks') {
|
if($action == 'saveranks') {
|
||||||
$guild_name = $_REQUEST['guild'];
|
$guild_name = $_REQUEST['guild'];
|
||||||
if(!check_guild_name($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = 'Invalid guild name format.';
|
$errors[] = Validator::get;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
@ -2033,7 +2033,7 @@ if($action == 'saveranks') {
|
|||||||
$rank_id = $rank->getId();
|
$rank_id = $rank->getId();
|
||||||
$name = $_REQUEST[$rank_id.'_name'];
|
$name = $_REQUEST[$rank_id.'_name'];
|
||||||
$level = (int) $_REQUEST[$rank_id.'_level'];
|
$level = (int) $_REQUEST[$rank_id.'_level'];
|
||||||
if(check_rank_name($name)) {
|
if(Validator::rankName($name)) {
|
||||||
$rank->setName($name);
|
$rank->setName($name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -33,7 +33,7 @@ $type = '';
|
|||||||
{
|
{
|
||||||
$beds = array("", "one", "two", "three", "fourth", "fifth");
|
$beds = array("", "one", "two", "three", "fourth", "fifth");
|
||||||
$houseName = $_REQUEST['house'];
|
$houseName = $_REQUEST['house'];
|
||||||
$houseId = (check_number($_REQUEST['house']) ? $_REQUEST['house'] : -1);
|
$houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1);
|
||||||
$house = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId));
|
$house = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId));
|
||||||
|
|
||||||
if($house->rowCount() > 0)
|
if($house->rowCount() > 0)
|
||||||
|
@ -30,7 +30,7 @@ else if($action == 'step1' && $action_type == '') {
|
|||||||
elseif($action == 'step1' && $action_type == 'email')
|
elseif($action == 'step1' && $action_type == 'email')
|
||||||
{
|
{
|
||||||
$nick = stripslashes($_REQUEST['nick']);
|
$nick = stripslashes($_REQUEST['nick']);
|
||||||
if(check_name($nick))
|
if(Validator::characterName($nick))
|
||||||
{
|
{
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
@ -77,7 +77,7 @@ elseif($action == 'sendcode')
|
|||||||
{
|
{
|
||||||
$email = $_REQUEST['email'];
|
$email = $_REQUEST['email'];
|
||||||
$nick = stripslashes($_REQUEST['nick']);
|
$nick = stripslashes($_REQUEST['nick']);
|
||||||
if(check_name($nick))
|
if(Validator::characterName($nick))
|
||||||
{
|
{
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
@ -139,7 +139,7 @@ elseif($action == 'sendcode')
|
|||||||
elseif($action == 'step1' && $action_type == 'reckey')
|
elseif($action == 'step1' && $action_type == 'reckey')
|
||||||
{
|
{
|
||||||
$nick = stripslashes($_REQUEST['nick']);
|
$nick = stripslashes($_REQUEST['nick']);
|
||||||
if(check_name($nick))
|
if(Validator::characterName($nick))
|
||||||
{
|
{
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
@ -181,7 +181,7 @@ elseif($action == 'step2')
|
|||||||
{
|
{
|
||||||
$rec_key = trim($_REQUEST['key']);
|
$rec_key = trim($_REQUEST['key']);
|
||||||
$nick = stripslashes($_REQUEST['nick']);
|
$nick = stripslashes($_REQUEST['nick']);
|
||||||
if(check_name($nick))
|
if(Validator::characterName($nick))
|
||||||
{
|
{
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
@ -272,7 +272,7 @@ elseif($action == 'step3')
|
|||||||
$nick = stripslashes($_REQUEST['nick']);
|
$nick = stripslashes($_REQUEST['nick']);
|
||||||
$new_pass = trim($_REQUEST['passor']);
|
$new_pass = trim($_REQUEST['passor']);
|
||||||
$new_email = trim($_REQUEST['email']);
|
$new_email = trim($_REQUEST['email']);
|
||||||
if(check_name($nick))
|
if(Validator::characterName($nick))
|
||||||
{
|
{
|
||||||
$player = new OTS_Player();
|
$player = new OTS_Player();
|
||||||
$account = new OTS_Account();
|
$account = new OTS_Account();
|
||||||
@ -286,9 +286,9 @@ elseif($action == 'step3')
|
|||||||
{
|
{
|
||||||
if($account_key == $rec_key)
|
if($account_key == $rec_key)
|
||||||
{
|
{
|
||||||
if(check_password($new_pass))
|
if(Validator::password($new_pass))
|
||||||
{
|
{
|
||||||
if(check_mail($new_email))
|
if(Validator::email($new_email))
|
||||||
{
|
{
|
||||||
$account->setEMail($new_email);
|
$account->setEMail($new_email);
|
||||||
|
|
||||||
@ -345,10 +345,10 @@ elseif($action == 'step3')
|
|||||||
</TD></TR></FORM></TABLE></TABLE>';
|
</TD></TR></FORM></TABLE></TABLE>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo 'Wrong e-mail format.';
|
echo Validator::getLastError();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo 'Wrong password format. Use only a-Z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.';
|
echo Validator::getLastError();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo 'Wrong recovery key!';
|
echo 'Wrong recovery key!';
|
||||||
@ -478,7 +478,7 @@ elseif($action == 'setnewpassword')
|
|||||||
{
|
{
|
||||||
if($account->getCustomField('email_code') == $code)
|
if($account->getCustomField('email_code') == $code)
|
||||||
{
|
{
|
||||||
if(check_password($newpassword))
|
if(Validator::password($newpassword))
|
||||||
{
|
{
|
||||||
if($config_salt_enabled)
|
if($config_salt_enabled)
|
||||||
{
|
{
|
||||||
@ -523,7 +523,7 @@ elseif($action == 'setnewpassword')
|
|||||||
</TD></TR></FORM></TABLE></TABLE>';
|
</TD></TR></FORM></TABLE></TABLE>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$error= 'Wrong password format. Use only a-z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.';
|
$error= Validator::getLastError();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$error= 'Wrong code to change password.';
|
$error= 'Wrong code to change password.';
|
||||||
|
@ -34,9 +34,11 @@ To change a name of character select player and choose a new name.<br/>
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" ><span>New Name:</span></td>
|
<td class="LabelV" ><span>New Name:</span></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" id="name" onkeyup="checkName();" size="25" maxlength="25" >
|
<input type="text" name="name" id="character_name" size="25" maxlength="25" >
|
||||||
|
<img id="character_indicator" src="images/global/general/{% if not save or errors|length > 0 %}n{% endif %}ok.gif" />
|
||||||
|
<br/>
|
||||||
<font size="1" face="verdana,arial,helvetica">
|
<font size="1" face="verdana,arial,helvetica">
|
||||||
<div id="name_check">Please enter your character name.</div>
|
<div id="character_error">Please enter your character name.</div>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -26,25 +26,21 @@ Also you have to agree to the terms presented below. If you have done so, your a
|
|||||||
<span{% if errors.account[0] is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>
|
<span{% if errors.account[0] is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="account" id="account_input" onkeyup="checkAccount();" size="30" maxlength="{% if constant('USE_ACCOUNT_NAME') %}30{% else %}10{% endif %}" value="{{ account }}" autofocus/>
|
<input type="text" name="account" id="account_input" size="30" maxlength="{% if constant('USE_ACCOUNT_NAME') %}30{% else %}10{% endif %}" value="{{ account }}" autofocus/>
|
||||||
<small id="acc_check"></small>
|
<img id="account_indicator" src="images/global/general/{% if not save or errors.account is defined %}n{% endif %}ok.gif" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if errors.account is defined %}
|
<tr><td></td><td><span id="account_error" class="FormFieldError">{% if errors.account is defined %}{{ errors.account }}{% endif %}</span></td></tr>
|
||||||
<tr><td></td><td><span class="FormFieldError">{{ errors.account }}</span></td></tr>
|
|
||||||
{% endif %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" >
|
<td class="LabelV" >
|
||||||
<span{% if errors.email[0] is defined %} class="red"{% endif %}>Email Address:</span>
|
<span{% if errors.email[0] is defined %} class="red"{% endif %}>Email Address:</span>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:100%;" >
|
<td style="width:100%;" >
|
||||||
<input type="text" name="email" id="email" onkeyup="checkEmail();" size="30" maxlength="50" value="{{ email }}" />
|
<input type="text" name="email" id="email" size="30" maxlength="50" value="{{ email }}" />
|
||||||
<small id="email_check"></small>
|
<img id="email_indicator" src="images/global/general/{% if not save or errors.account is defined %}n{% endif %}ok.gif" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if errors.email is defined %}
|
<tr><td></td><td><span id="email_error" class="FormFieldError">{% if errors.email is defined %}{{ errors.email }}{% endif %}</span></td></tr>
|
||||||
<tr><td></td><td><span class="FormFieldError">{{ errors.email }}</span></td></tr>
|
|
||||||
{% endif %}
|
|
||||||
{% if config.account_country %}
|
{% if config.account_country %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" >
|
<td class="LabelV" >
|
||||||
@ -57,27 +53,6 @@ Also you have to agree to the terms presented below. If you have done so, your a
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<img src="" id="account_country_img"/>
|
<img src="" id="account_country_img"/>
|
||||||
<script>
|
|
||||||
function updateFlag()
|
|
||||||
{
|
|
||||||
var img = $('#account_country_img');
|
|
||||||
var country = $('#account_country :selected').val();
|
|
||||||
if(country.length) {
|
|
||||||
img.attr('src', 'images/flags/' + country + '.gif');
|
|
||||||
img.show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
img.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
updateFlag();
|
|
||||||
$('#account_country').change(function() {
|
|
||||||
updateFlag();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if errors.country is defined %}
|
{% if errors.country is defined %}
|
||||||
@ -89,23 +64,21 @@ Also you have to agree to the terms presented below. If you have done so, your a
|
|||||||
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Password:</span>
|
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Password:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="password" value="" size="30" maxlength="50" />
|
<input type="password" name="password" id="password" value="" size="30" maxlength="50" />
|
||||||
|
<img id="password_indicator" src="images/global/general/{% if not save or errors.account is defined %}n{% endif %}ok.gif" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if errors.password is defined %}
|
<tr><td></td><td><span id="password_error" class="FormFieldError">{% if errors.password is defined %}{{ errors.password }}{% endif %}</span></td></tr>
|
||||||
<tr><td></td><td><span class="FormFieldError">{{ errors.password }}</span></td></tr>
|
|
||||||
{% endif %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" >
|
<td class="LabelV" >
|
||||||
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Repeat password:</span>
|
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Repeat password:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="password2" value="" size="30" maxlength="50" />
|
<input type="password" name="password2" id="password2" value="" size="30" maxlength="50" />
|
||||||
|
<img id="password2_indicator" src="images/global/general/{% if not save or errors.account is defined %}n{% endif %}ok.gif" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if errors.password is defined %}
|
<tr><td></td><td><span id="password2_error" class="FormFieldError">{% if errors.password is defined %}{{ errors.password }}{% endif %}</span></td></tr>
|
||||||
<tr><td></td><td><span class="FormFieldError">{{ errors.password }}</span></td></tr>
|
|
||||||
{% endif %}
|
|
||||||
{% if config.recaptcha_enabled %}
|
{% if config.recaptcha_enabled %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" >
|
<td class="LabelV" >
|
||||||
|
@ -1,28 +1,60 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
eventId = 0;
|
var eventId = 0;
|
||||||
lastSend = 0;
|
var lastSend = 0;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#createaccount').submit(function () {
|
$('#createaccount').submit(function () {
|
||||||
return validate_form(this);
|
return validate_form(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateFlag();
|
||||||
|
$('#account_country').change(function() {
|
||||||
|
updateFlag();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#account_input').blur(function() {
|
||||||
|
checkAccount();
|
||||||
|
});
|
||||||
|
$('#email').blur(function() {
|
||||||
|
checkEmail();
|
||||||
|
});
|
||||||
|
$('#password').blur(function() {
|
||||||
|
checkPassword();
|
||||||
|
});
|
||||||
|
$('#password2').blur(function() {
|
||||||
|
checkPassword();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function updateFlag()
|
||||||
|
{
|
||||||
|
var img = $('#account_country_img');
|
||||||
|
var country = $('#account_country :selected').val();
|
||||||
|
if(country.length) {
|
||||||
|
img.attr('src', 'images/flags/' + country + '.gif');
|
||||||
|
img.show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
img.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function checkAccount()
|
function checkAccount()
|
||||||
{
|
{
|
||||||
if(eventId != 0)
|
if(eventId != 0)
|
||||||
{
|
{
|
||||||
clearInterval(eventId);
|
clearInterval(eventId)
|
||||||
eventId = 0;
|
eventId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(document.getElementById("account_input").value == "")
|
if(document.getElementById("account_input").value == "")
|
||||||
{
|
{
|
||||||
document.getElementById("acc_check").innerHTML = '<b><font color="red">Please enter account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}.</font></b>';
|
$('#account_error').html('Please enter account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}.');
|
||||||
|
$('#account_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// anti flood
|
//anti flood
|
||||||
var date = new Date;
|
var date = new Date;
|
||||||
var timeNow = parseInt(date.getTime());
|
var timeNow = parseInt(date.getTime());
|
||||||
|
|
||||||
@ -30,17 +62,26 @@
|
|||||||
{
|
{
|
||||||
if(timeNow - lastSend < 1100)
|
if(timeNow - lastSend < 1100)
|
||||||
{
|
{
|
||||||
eventId = setInterval('checkAccount()', 1100);
|
eventId = setInterval('checkAccount()', 1100)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var account = document.getElementById("account_input").value;
|
var account = document.getElementById("account_input").value;
|
||||||
$.get("tools/validate.php", { account: account, uid: Math.random() },
|
$.getJSON("tools/validate.php", { account: account, uid: Math.random() },
|
||||||
function(data){
|
function(data){
|
||||||
document.getElementById("acc_check").innerHTML = data;
|
if(data.hasOwnProperty('success')) {
|
||||||
|
$('#account_error').html ('');
|
||||||
|
$('#account_indicator').attr('src', 'images/global/general/ok.gif');
|
||||||
|
}
|
||||||
|
else if(data.hasOwnProperty('error')) {
|
||||||
|
$('#account_error').html(data.error);
|
||||||
|
$('#account_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
lastSend = timeNow;
|
lastSend = timeNow;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkEmail()
|
function checkEmail()
|
||||||
@ -53,13 +94,14 @@
|
|||||||
|
|
||||||
if(document.getElementById("email").value == "")
|
if(document.getElementById("email").value == "")
|
||||||
{
|
{
|
||||||
document.getElementById("email_check").innerHTML = '<b><font color="red">Please enter e-mail.</font></b>';
|
$('#email_error').html('Please enter e-mail.');
|
||||||
|
$('#email_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//anti flood
|
//anti flood
|
||||||
var date = new Date;
|
var date = new Date;
|
||||||
vartimeNow = parseInt(date.getTime());
|
var timeNow = parseInt(date.getTime());
|
||||||
|
|
||||||
if(lastSend != 0)
|
if(lastSend != 0)
|
||||||
{
|
{
|
||||||
@ -71,11 +113,77 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var email = document.getElementById("email").value;
|
var email = document.getElementById("email").value;
|
||||||
$.get("tools/validate.php", { email: email, uid: Math.random() },
|
$.getJSON("tools/validate.php", { email: email, uid: Math.random() },
|
||||||
function(data){
|
function(data){
|
||||||
document.getElementById("email_check").innerHTML = data;
|
if(data.hasOwnProperty('success')) {
|
||||||
|
$('#email_error').html ('');
|
||||||
|
$('#email_indicator').attr('src', 'images/global/general/ok.gif');
|
||||||
|
}
|
||||||
|
else if(data.hasOwnProperty('error')) {
|
||||||
|
$('#email_error').html(data.error);
|
||||||
|
$('#email_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
lastSend = timeNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPassword()
|
||||||
|
{
|
||||||
|
if(eventId != 0)
|
||||||
|
{
|
||||||
|
clearInterval(eventId)
|
||||||
|
eventId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(document.getElementById("password").value == "")
|
||||||
|
{
|
||||||
|
$('#password_error').html('Please enter the password for your new account.');
|
||||||
|
$('#password_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(document.getElementById("password2").value == "")
|
||||||
|
{
|
||||||
|
$('#password2_error').html('Please enter the password again!');
|
||||||
|
$('#password2_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//anti flood
|
||||||
|
var date = new Date;
|
||||||
|
var timeNow = parseInt(date.getTime());
|
||||||
|
|
||||||
|
if(lastSend != 0)
|
||||||
|
{
|
||||||
|
if(timeNow - lastSend < 1100)
|
||||||
|
{
|
||||||
|
eventId = setInterval('checkPassword()', 1100)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var password = document.getElementById("password").value;
|
||||||
|
var password2 = document.getElementById("password2").value;
|
||||||
|
$.getJSON("tools/validate.php", { password: password, password2: password2, uid: Math.random() },
|
||||||
|
function(data){
|
||||||
|
if(data.hasOwnProperty('success')) {
|
||||||
|
$('#password_error').html ('');
|
||||||
|
$('#password2_error').html ('');
|
||||||
|
$('#password_indicator').attr('src', 'images/global/general/ok.gif');
|
||||||
|
$('#password2_indicator').attr('src', 'images/global/general/ok.gif');
|
||||||
|
}
|
||||||
|
else if(data.hasOwnProperty('error')) {
|
||||||
|
$('#password_error').html(data.error);
|
||||||
|
$('#password2_error').html(data.error);
|
||||||
|
$('#password_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
$('#password2_indicator').attr('src', 'images/global/general/nok.gif');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
lastSend = timeNow;
|
lastSend = timeNow;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_required(field,alerttxt)
|
function validate_required(field,alerttxt)
|
||||||
|
@ -7,7 +7,7 @@ In any case the name must not violate the naming conventions stated in the <a hr
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<form action="{{ getLink('account/character/create') }}" method="post">
|
<form action="{{ getLink('account/character/create') }}" method="post">
|
||||||
<input type="hidden" name=savecharacter value="1">
|
<input type="hidden" name="save" value="1">
|
||||||
<div class="TableContainer">
|
<div class="TableContainer">
|
||||||
<table class="Table3" cellpadding="0" cellspacing="0">
|
<table class="Table3" cellpadding="0" cellspacing="0">
|
||||||
<div class="CaptionContainer">
|
<div class="CaptionContainer">
|
||||||
@ -45,9 +45,11 @@ In any case the name must not violate the naming conventions stated in the <a hr
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="Odd">
|
<tr class="Odd">
|
||||||
<td>
|
<td>
|
||||||
<input id="name" name="name" onkeyup="checkName();" value=" {{ name }}" size="25" maxlength="25" ><br/>
|
<input name="name" id="character_name" value="{{ name }}" size="25" maxlength="25" >
|
||||||
|
<img id="character_indicator" src="images/global/general/{% if not save or errors.name is defined %}n{% endif %}ok.gif" />
|
||||||
|
<br/>
|
||||||
<font size="1" face="verdana,arial,helvetica">
|
<font size="1" face="verdana,arial,helvetica">
|
||||||
<div id="name_check">Please enter your character name.</div>
|
<div id="character_error">{% if not save or errors.name is defined %}Please enter your character name.{% endif %}</div>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<div style="position: relative; height: 15px; width: 100%;">
|
<div style="position: relative; height: 15px; width: 100%;">
|
||||||
{% if next is not null %}
|
{% if next is not null %}
|
||||||
<a style="float: right;" href="?subtopic=gallery&image={{ next }}" >next <img src="images/arrow_right.gif" width=15 height=11 border=0 ></a>
|
<a style="float: right;" href="{{ getLink('gallery') ~ '/' ~ next }}" >next <img src="images/arrow_right.gif" width=15 height=11 border=0 ></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if previous is not null %}
|
{% if previous is not null %}
|
||||||
<a style="position: absolute;" href="?subtopic=gallery&image={{ previous }}"><img src="images/arrow_left.gif" width=15 height=11 border=0 > previous</a>
|
<a style="position: absolute;" href="{{ getLink('gallery') ~ '/' ~ previous }}"><img src="images/arrow_left.gif" width=15 height=11 border=0 > previous</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div style="position: absolute; width: 80%; margin-left: 10%; margin-right: 10%; text-align: center;">
|
<div style="position: absolute; width: 80%; margin-left: 10%; margin-right: 10%; text-align: center;">
|
||||||
<a href="{{ getLink('gallery') }}" ><img src="images/arrow_up.gif" width=11 height=15 border=0 > back</a>
|
<a href="{{ getLink('gallery') }}" ><img src="images/arrow_up.gif" width=11 height=15 border=0 > back</a>
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
Click on the image to enlarge.<br/><br/>
|
Click on the image to enlarge.<br/><br/>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for item in gallery %}
|
{% for image in images %}
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="height: 120px;" >
|
<td style="height: 120px;" >
|
||||||
<a href="?subtopic=gallery&image={{ item.id }}" >
|
<a href="{{ getLink('gallery') ~ '/' ~ image.id }}" >
|
||||||
<img src="{{ item.thumb }}" border="0" />
|
<img src="{{ image.thumb }}" border="0" />
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ item.comment }}</td>
|
<td>{{ image.comment }}</td>
|
||||||
{% if canEdit %}
|
{% if canEdit %}
|
||||||
<td>
|
<td>
|
||||||
<a href="?subtopic=gallery&action=edit&id={{ item.id }}" title="Edit">
|
<a href="?subtopic=gallery&action=edit&id={{ image.id }}" title="Edit">
|
||||||
<img src="images/edit.png"/>Edit
|
<img src="images/edit.png"/>Edit
|
||||||
</a>
|
</a>
|
||||||
<a id="delete" href="?subtopic=gallery&action=delete&id={{ item.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
<a id="delete" href="?subtopic=gallery&action=delete&id={{ image.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||||
<img src="images/del.png"/>Delete
|
<img src="images/del.png"/>Delete
|
||||||
</a>
|
</a>
|
||||||
<a href="?subtopic=gallery&action=hide&id={{ item.id }}" title="{% if item.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
<a href="?subtopic=gallery&action=hide&id={{ image.id }}" title="{% if image.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||||
<img src="images/{% if item.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if item.hidden != 1 %}Hide{% else %}Show{% endif %}
|
<img src="images/{% if image.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if image.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||||
</a>
|
</a>
|
||||||
{% if i != 1 %}
|
{% if i != 1 %}
|
||||||
<a href="?subtopic=gallery&action=moveup&id={{ item.id }}" title="Move up">
|
<a href="?subtopic=gallery&action=moveup&id={{ image.id }}" title="Move up">
|
||||||
<img src="images/icons/arrow_up.gif"/>Move up
|
<img src="images/icons/arrow_up.gif"/>Move up
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if i != last %}
|
{% if i != last %}
|
||||||
<a href="?subtopic=gallery&action=movedown&id={{ item.id }}" title="Move down">
|
<a href="?subtopic=gallery&action=movedown&id={{ image.id }}" title="Move down">
|
||||||
<img src="images/icons/arrow_down.gif"/>Move down
|
<img src="images/icons/arrow_down.gif"/>Move down
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -17,7 +17,7 @@ To change a name of character select player and choose a new name.<br/>
|
|||||||
<tr>
|
<tr>
|
||||||
<td ><span>New Name:</td>
|
<td ><span>New Name:</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" id="name" onkeyup="checkName();" size="25" maxlength="25" >
|
<input type="text" name="name" id="name" onblur="checkName();" size="25" maxlength="25" >
|
||||||
<font size="1" face="verdana,arial,helvetica">
|
<font size="1" face="verdana,arial,helvetica">
|
||||||
<div id="name_check">Please enter your character name.</div>
|
<div id="name_check">Please enter your character name.</div>
|
||||||
</font>
|
</font>
|
||||||
|
144
templates/tibiacom/account.login.html.twig
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<form action="{{ getLink('account/manage') }}" method="post" style="margin: 0px; padding: 0px;">
|
||||||
|
<div class="TableContainer" >
|
||||||
|
<table class="Table4" cellpadding="0" cellspacing="0" >
|
||||||
|
<div class="CaptionContainer" >
|
||||||
|
<div class="CaptionInnerContainer" >
|
||||||
|
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/global/content/table-headline-border.gif);" ></span>
|
||||||
|
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/global/content/box-frame-vertical.gif);" /></span>
|
||||||
|
<div class="Text" >Account Login</div>
|
||||||
|
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/global/content/box-frame-vertical.gif);" /></span>
|
||||||
|
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/global/content/table-headline-border.gif);" ></span>
|
||||||
|
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/global/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/global/content/table-shadow-rt.gif);" ></div>
|
||||||
|
</div>
|
||||||
|
<div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-rm.gif);" >
|
||||||
|
<div class="TableContentContainer" >
|
||||||
|
<table class="TableContent" width="100%" style="border:1px solid #faf0d7;" >
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table style="float: left; width: 370px;" cellpadding="0" cellspacing="0" >
|
||||||
|
<tr>
|
||||||
|
<td class="LabelV" ><span{% if error is not null %} class="red"{% endif %}>Account {{ account }}:</span></td>
|
||||||
|
<td><input type="password" name="account_login" size="35" 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="35" 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>
|
||||||
|
</table>
|
||||||
|
<div style="float: right; font-size: 1px;" >
|
||||||
|
<input type="hidden" name="page" value="overview" >
|
||||||
|
<div class="BigButton" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);" ></div>
|
||||||
|
<input class="ButtonText" type="image" name="Login" alt="Login" src="{{ template_path }}/images/global/buttons/_sbutton_login.gif" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div style="width: 2px; height: 2px;" ></div>
|
||||||
|
<form action="{{ getLink('account/lost') }}" method="post" style="padding:0px;margin:0px;" >
|
||||||
|
<div class="BigButton" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);" ></div>
|
||||||
|
<input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="{{ template_path }}/images/global/buttons/_sbutton_accountlost.gif" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="TableShadowContainer" >
|
||||||
|
<div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-bm.gif);" >
|
||||||
|
<div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-bl.gif);" ></div>
|
||||||
|
<div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-br.gif);" ></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<center>
|
||||||
|
<h1>New to {{ config.lua.serverName }}?</h1>
|
||||||
|
</center>
|
||||||
|
<div class="TableContainer" >
|
||||||
|
<table class="Table4" cellpadding="0" cellspacing="0" >
|
||||||
|
<div class="CaptionContainer" >
|
||||||
|
<div class="CaptionInnerContainer" >
|
||||||
|
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/global/content/table-headline-border.gif);" ></span>
|
||||||
|
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/global/content/box-frame-vertical.gif);" /></span>
|
||||||
|
<div class="Text" >New Player</div>
|
||||||
|
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/global/content/box-frame-vertical.gif);" /></span>
|
||||||
|
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/global/content/table-headline-border.gif);" ></span>
|
||||||
|
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/global/content/box-frame-edge.gif);" /></span>
|
||||||
|
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/global/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/global/content/table-shadow-rt.gif);" ></div>
|
||||||
|
</div>
|
||||||
|
<div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-rm.gif);" >
|
||||||
|
<div class="TableContentContainer" >
|
||||||
|
<table class="TableContent" width="100%" style="border:1px solid #faf0d7;" >
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<div style="float: right; margin-top: 20px;" >
|
||||||
|
<form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" >
|
||||||
|
<div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ><div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ></div>
|
||||||
|
<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="LoginCreateAccountBox" >
|
||||||
|
<p><b>{{ config.lua.serverName }}...</b></p>
|
||||||
|
<div style="margin-left: 10px;" >
|
||||||
|
<p>... where hardcore gaming meets fantasy.</p>
|
||||||
|
<p>... where friendships last a lifetime.</p>
|
||||||
|
<p>... unites adventurers since 2017!</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="TableShadowContainer" >
|
||||||
|
<div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-bm.gif);" >
|
||||||
|
<div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-bl.gif);" ></div>
|
||||||
|
<div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/global/content/table-shadow-br.gif);" ></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
BIN
templates/tibiacom/images/global/buttons/_sbutton_accountlost.gif
Executable file
After Width: | Height: | Size: 352 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_back.gif
Executable file
After Width: | Height: | Size: 228 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_buynow.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_cancel.gif
Executable file
After Width: | Height: | Size: 247 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_changeemail.gif
Executable file
After Width: | Height: | Size: 394 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_changename.gif
Executable file
After Width: | Height: | Size: 369 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_changepassword.gif
Executable file
After Width: | Height: | Size: 458 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_changesex.gif
Executable file
After Width: | Height: | Size: 378 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_confirm.gif
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_continue.gif
Executable file
After Width: | Height: | Size: 285 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_createaccount.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_createcharacter.gif
Executable file
After Width: | Height: | Size: 390 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_declarewar.gif
Executable file
After Width: | Height: | Size: 339 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_delete.gif
Executable file
After Width: | Height: | Size: 415 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_disbandguild.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_edit.gif
Executable file
After Width: | Height: | Size: 217 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_editdescription.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_editmembers.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_editranks.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_foundguild.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getextraservice.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getmount.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getoutfit.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getpremium.gif
Executable file
After Width: | Height: | Size: 345 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getpremiumscroll.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_getpremiumtime.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_gettibiacoins.gif
Executable file
After Width: | Height: | Size: 295 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_guildevents.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_guildwars.gif
Executable file
After Width: | Height: | Size: 324 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_iagree.gif
Executable file
After Width: | Height: | Size: 304 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_invitecharacter.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_joinguild.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_leaveguild.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_login.gif
Executable file
After Width: | Height: | Size: 265 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_logout.gif
Executable file
After Width: | Height: | Size: 291 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_manageaccount.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_next.gif
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_overview.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_painel.gif
Executable file
After Width: | Height: | Size: 781 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_previous.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_registeraccount.gif
Executable file
After Width: | Height: | Size: 443 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_renameaccount.gif
Executable file
After Width: | Height: | Size: 379 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_resignleadership.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_showall.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_showonline.gif
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_submit.gif
Executable file
After Width: | Height: | Size: 267 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_terminateaccount.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_usegamecode.gif
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_vermais.gif
Executable file
After Width: | Height: | Size: 484 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_view.gif
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
templates/tibiacom/images/global/buttons/_sbutton_viewallfansites.gif
Executable file
After Width: | Height: | Size: 405 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_viewhistory.gif
Executable file
After Width: | Height: | Size: 383 B |
BIN
templates/tibiacom/images/global/buttons/_sbutton_votenow.gif
Executable file
After Width: | Height: | Size: 299 B |
BIN
templates/tibiacom/images/global/buttons/mediumbutton-over.gif
Executable file
After Width: | Height: | Size: 4.8 KiB |
BIN
templates/tibiacom/images/global/buttons/mediumbutton.gif
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
templates/tibiacom/images/global/buttons/mediumbutton_createaccount.png
Executable file
After Width: | Height: | Size: 4.1 KiB |
BIN
templates/tibiacom/images/global/buttons/mediumbutton_download.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
templates/tibiacom/images/global/buttons/mediumbutton_myaccount.png
Executable file
After Width: | Height: | Size: 3.8 KiB |
BIN
templates/tibiacom/images/global/buttons/mediumbutton_playnow.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton.gif
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton_back.gif
Executable file
After Width: | Height: | Size: 1.9 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton_green.gif
Executable file
After Width: | Height: | Size: 2.5 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton_green_over.gif
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton_login.gif
Executable file
After Width: | Height: | Size: 1.9 KiB |
BIN
templates/tibiacom/images/global/buttons/sbutton_over.gif
Executable file
After Width: | Height: | Size: 443 B |