mirror of
https://github.com/araxiaonline/WoWSimpleRegistration.git
synced 2026-06-13 03:12:27 -04:00
Muli-Language support, Part 2 - Advance template and errors!
This commit is contained in:
@@ -283,7 +283,7 @@ function GetCaptchaHTML()
|
||||
}
|
||||
}
|
||||
|
||||
return '<div class="input-group"><span class="input-group">Captcha</span><input type="text" class="form-control" placeholder="Captcha" name="captcha"></div><p style="text-align: center;margin-top: 10px;"><img src="' . user::$captcha->inline() . '" style="border - radius: 5px;"/></p>';
|
||||
return '<div class="input-group"><span class="input-group">' . lang('captcha') . '</span><input type="text" class="form-control" placeholder="' . lang('captcha') . '" name="captcha"></div><p style="text-align: center;margin-top: 10px;"><img src="' . user::$captcha->inline() . '" style="border - radius: 5px;"/></p>';
|
||||
}
|
||||
|
||||
// Its from Trinitycore/account-creator
|
||||
@@ -350,4 +350,10 @@ function lang($val)
|
||||
return $language[$val];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// Echo language text
|
||||
function elang($val)
|
||||
{
|
||||
echo lang($val);
|
||||
}
|
||||
@@ -65,22 +65,22 @@ class user
|
||||
}
|
||||
|
||||
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
error_msg('Use valid email.');
|
||||
error_msg(lang('use_valid_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_POST['password'] != $_POST['repassword']) {
|
||||
error_msg('Passwords is not equal.');
|
||||
error_msg(lang('passwords_not_equal'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(strlen($_POST['password']) >= 4 && strlen($_POST['password']) <= 16)) {
|
||||
error_msg('Password length is not valid.');
|
||||
error_msg(lang('passwords_length'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!self::check_email_exists(strtoupper($_POST["email"]))) {
|
||||
error_msg('Username or Email is exists.');
|
||||
error_msg(lang('username_or_email_exists'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class user
|
||||
'battlenet_account' => $bnet_account_id,
|
||||
'battlenet_index' => 1
|
||||
]);
|
||||
success_msg('Your account has been created.');
|
||||
success_msg(lang('account_created'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ class user
|
||||
'battlenet_account' => $bnet_account_id,
|
||||
'battlenet_index' => 1
|
||||
]);
|
||||
success_msg('Your account has been created.');
|
||||
success_msg(lang('account_created'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -144,37 +144,37 @@ class user
|
||||
}
|
||||
|
||||
if (!preg_match('/^[0-9A-Z-_]+$/', strtoupper($_POST['username']))) {
|
||||
error_msg('Use valid characters for username.');
|
||||
error_msg(lang('use_valid_username'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
error_msg('Use valid email.');
|
||||
error_msg(lang('use_valid_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_POST['password'] != $_POST['repassword']) {
|
||||
error_msg('Passwords is not equal.');
|
||||
error_msg(lang('passwords_not_equal'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(strlen($_POST['password']) >= 4 && strlen($_POST['password']) <= 16)) {
|
||||
error_msg('Password length is not valid.');
|
||||
error_msg(lang('passwords_length'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(strlen($_POST['username']) >= 2 && strlen($_POST['username']) <= 16)) {
|
||||
error_msg('Username length is not valid.');
|
||||
error_msg(lang('username_length'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!get_config('multiple_email_use') && !self::check_email_exists(strtoupper($_POST['email']))) {
|
||||
error_msg('Email is exists.');
|
||||
error_msg(lang('email_exists'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!self::check_username_exists(strtoupper($_POST['username']))) {
|
||||
error_msg('Username is exists.');
|
||||
error_msg(lang('username_exists'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ class user
|
||||
//'reg_mail' => $antiXss->xss_clean(strtoupper($_POST['email'])),
|
||||
'expansion' => $antiXss->xss_clean(get_config('expansion'))
|
||||
]);
|
||||
success_msg('Your account has been created.');
|
||||
success_msg(lang('account_created'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class user
|
||||
//'reg_mail' => $antiXss->xss_clean(strtoupper($_POST['email'])),
|
||||
'expansion' => $antiXss->xss_clean(get_config('expansion'))
|
||||
]);
|
||||
success_msg('Your account has been created.');
|
||||
success_msg(lang('account_created'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -219,9 +219,9 @@ class user
|
||||
'email' => $antiXss->xss_clean(strtoupper($_POST['email']))
|
||||
], ['username' => Medoo::raw('UPPER(:username)', [':username' => $antiXss->xss_clean(strtoupper($_POST['username']))])]);
|
||||
|
||||
success_msg('Your account has been created.');
|
||||
success_msg(lang('account_created'));
|
||||
} else {
|
||||
error_msg('ERROR!, Please try again!');
|
||||
error_msg(lang('error_try_again'));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -248,24 +248,24 @@ class user
|
||||
}
|
||||
|
||||
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
error_msg('Use valid email.');
|
||||
error_msg(lang('use_valid_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_POST['password'] != $_POST['repassword']) {
|
||||
|
||||
error_msg('Passwords is not equal.');
|
||||
error_msg(lang('passwords_not_equal'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(strlen($_POST['password']) >= 4 && strlen($_POST['password']) <= 16)) {
|
||||
error_msg('Password length is not valid.');
|
||||
error_msg(lang('passwords_length'));
|
||||
return true;
|
||||
}
|
||||
|
||||
$userinfo = self::get_user_by_email(strtoupper($_POST['email']));
|
||||
if (empty($userinfo['username'])) {
|
||||
error_msg('Email is not valid.');
|
||||
error_msg(lang('email_not_correct'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ class user
|
||||
$hashed_pass = strtoupper(sha1(strtoupper($userinfo['username'] . ':' . $_POST['password'])));
|
||||
|
||||
if (strtoupper($userinfo['sha_pass_hash']) != $Old_hashed_pass) {
|
||||
error_msg('Old password is not valid.');
|
||||
error_msg(lang('old_password_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ class user
|
||||
]);
|
||||
} else {
|
||||
if (!verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) {
|
||||
error_msg('Old password is not valid.');
|
||||
error_msg(lang('old_password_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class user
|
||||
'id[=]' => $userinfo['battlenet_account']
|
||||
]);
|
||||
|
||||
success_msg('Password has been changed.');
|
||||
success_msg(lang('password_changed'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -334,18 +334,18 @@ class user
|
||||
}
|
||||
|
||||
if ($_POST['password'] != $_POST['repassword']) {
|
||||
error_msg('Passwords is not equal.');
|
||||
error_msg(lang('passwords_not_equal'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(strlen($_POST['password']) >= 4 && strlen($_POST['password']) <= 16)) {
|
||||
error_msg('Password length is not valid.');
|
||||
error_msg(lang('passwords_length'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$userinfo = self::get_user_by_username(strtoupper($_POST['username']));
|
||||
if (empty($userinfo['username'])) {
|
||||
error_msg('Username is not valid.');
|
||||
error_msg(lang('username_not_correct'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ class user
|
||||
$Old_hashed_pass = strtoupper(sha1(strtoupper($userinfo['username'] . ':' . $_POST['old_password'])));
|
||||
$hashed_pass = strtoupper(sha1(strtoupper($userinfo['username'] . ':' . $_POST['password'])));
|
||||
if (strtoupper($userinfo['sha_pass_hash']) != $Old_hashed_pass) {
|
||||
error_msg('Old password is not valid.');
|
||||
error_msg(lang('old_password_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ class user
|
||||
]);
|
||||
} else {
|
||||
if (!verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) {
|
||||
error_msg('Old password is not valid.');
|
||||
error_msg(lang('old_password_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ class user
|
||||
]);
|
||||
}
|
||||
|
||||
success_msg('Password has been changed.');
|
||||
success_msg(lang('password_changed'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -408,26 +408,26 @@ class user
|
||||
|
||||
if (get_config('battlenet_support')) {
|
||||
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
error_msg('Use a valid email.');
|
||||
error_msg(lang('use_valid_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$userinfo = self::get_user_by_email(strtoupper($_POST['email']));
|
||||
if (empty($userinfo['email'])) {
|
||||
error_msg('Email is not valid.');
|
||||
error_msg(lang('email_not_correct'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$field_acc = $userinfo['email'];
|
||||
} else {
|
||||
if (!preg_match('/^[0-9A-Z-_]+$/', strtoupper($_POST['username']))) {
|
||||
error_msg('Use a valid username.');
|
||||
error_msg(lang('use_valid_username'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$userinfo = self::get_user_by_username(strtoupper($_POST['username']));
|
||||
if (empty($userinfo['email'])) {
|
||||
error_msg('Username is not valid.');
|
||||
error_msg(lang('username_not_correct'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -447,8 +447,8 @@ class user
|
||||
|
||||
$restorepass_URL = get_config('baseurl') . '/index.php?restore=' . strtolower($field_acc) . '&key=' . $restore_key;
|
||||
$message = "For restore you game account open <a href='$restorepass_URL' target='_blank'>this link</a>: <BR>$restorepass_URL";
|
||||
send_phpmailer(strtolower($userinfo['email']), 'Restore Account Password', $message);
|
||||
success_msg('Check your email, (Check SPAM/Junk too).');
|
||||
send_phpmailer(strtolower($userinfo['email']), lang('restore_account_password'), $message);
|
||||
success_msg(lang('check_your_email'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ class user
|
||||
$userinfo = self::get_user_by_email(strtoupper($user_data));
|
||||
} else {
|
||||
if (!preg_match('/^[0-9A-Z-_]+$/', strtoupper($user_data))) {
|
||||
error_msg('Use a valid username.');
|
||||
error_msg(lang('use_valid_username'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -546,21 +546,21 @@ class user
|
||||
$command = str_replace('{USERNAME}', $antiXss->xss_clean(strtoupper($userinfo['username'])), get_config('soap_cp_command'));
|
||||
$command = str_replace('{PASSWORD}', $antiXss->xss_clean($new_password), $command);
|
||||
if (RemoteCommandWithSOAP($command)) {
|
||||
success_msg('Password has been changed.');
|
||||
success_msg(lang('password_changed'));
|
||||
database::$auth->update('account', [
|
||||
'restore_key' => '1'
|
||||
], [
|
||||
'id[=]' => $userinfo['id']
|
||||
]);
|
||||
} else {
|
||||
error_msg('ERROR!, Please try again!');
|
||||
error_msg(lang('error_try_again'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
send_phpmailer(strtolower($userinfo['email']), 'New Account Password', $message);
|
||||
success_msg('Check your email for new password, (Check SPAM/Junk too).');
|
||||
success_msg(lang('check_your_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -665,12 +665,12 @@ class user
|
||||
|
||||
$userinfo = self::get_user_by_email(strtoupper($_POST['email']));
|
||||
if (empty($userinfo['id'])) {
|
||||
error_msg('Account is not valid.');
|
||||
error_msg(lang('account_is_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty(get_config('battlenet_support')) && strtolower($userinfo['username']) != strtolower($_POST['username'])) {
|
||||
error_msg('Account is not valid.');
|
||||
error_msg(lang('account_is_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ class user
|
||||
$restorepass_URL = get_config('baseurl') . '/index.php?enabletfa=' . strtolower($verify_key) . '&account=' . strtolower($account);
|
||||
$message = "Hey, to enable Two-Factor Authentication (2FA), Please open <a href='$restorepass_URL' target='_blank'>this link</a>: <BR>$restorepass_URL";
|
||||
send_phpmailer(strtolower($userinfo['email']), 'Enable Account 2FA', $message);
|
||||
success_msg('Check your email, (Check SPAM/Junk too).');
|
||||
success_msg(lang('check_your_email'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -764,6 +764,6 @@ class user
|
||||
$message .= 'or you can add this code to Google Authenticator: <B>' . $tfa_key . '</B>.<BR>';
|
||||
|
||||
send_phpmailer(strtolower($userinfo['email']), 'Account 2FA enabled', $message);
|
||||
success_msg('Account 2FA enabled please check your email, (Check SPAM/Junk too).');
|
||||
success_msg(lang('check_your_email'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,20 +27,20 @@ class vote
|
||||
global $antiXss;
|
||||
$vote_sites = get_config('vote_sites');
|
||||
if (!is_numeric($siteID) || empty($vote_sites[$siteID - 1])) {
|
||||
error_msg('Vote site is not valid!');
|
||||
error_msg(lang('vote_site_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (get_config('battlenet_support')) {
|
||||
if (!filter_var($account, FILTER_VALIDATE_EMAIL)) {
|
||||
error_msg('Use valid email.');
|
||||
error_msg(lang('use_valid_email'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$acc_data = user::get_user_by_email($account);
|
||||
} else {
|
||||
if (!preg_match('/^[0-9A-Z-_]+$/', strtoupper($account))) {
|
||||
error_msg('Use valid characters for username.');
|
||||
error_msg(lang('use_valid_username'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class vote
|
||||
}
|
||||
|
||||
if (empty($acc_data['id'])) {
|
||||
error_msg('Account is not valid.');
|
||||
error_msg(lang('account_is_not_valid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class vote
|
||||
database::$auth->delete('votes', ['votedate[<]' => date("Y-m-d H:i:s", time() - 43200)]);
|
||||
|
||||
if (!empty(self::get_vote_by_IP($siteID)) || !empty(self::get_vote_by_account($siteID, $acc_data['id']))) {
|
||||
error_msg('You already voted on this website.');
|
||||
error_msg(lang('you_already_voted'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,5 +8,103 @@
|
||||
|
||||
$language['lang'] = 'english';
|
||||
$language['custom_css'] = '';
|
||||
$language['tpl_light_custom_css'] = '';
|
||||
$language['tpl_advance_custom_css'] = '';
|
||||
$language['tpl_icecrown_custom_css'] = '';
|
||||
$language['tpl_kaelthas_custom_css'] = '';
|
||||
|
||||
$language['welcome_to'] = 'Welcome to';
|
||||
$language['welcome_message'] = 'Welcome to our private server, Join us now!';
|
||||
$language['get_started'] = 'Get Started';
|
||||
$language['home'] = 'Home';
|
||||
$language['about'] = 'About';
|
||||
$language['how_to_connect'] = 'How to connect';
|
||||
$language['register'] = 'Register';
|
||||
$language['server_status'] = 'Server Status';
|
||||
$language['contact'] = 'Contact';
|
||||
$language['server_information'] = 'Server Information';
|
||||
$language['server_type'] = 'Server type';
|
||||
$language['server_uptime'] = 'Server Uptime';
|
||||
$language['xp_rate'] = 'XP Rate';
|
||||
$language['drop_rate'] = 'Drop Rate';
|
||||
$language['start_level'] = 'Start Level';
|
||||
$language['max_level'] = 'Max Level';
|
||||
$language['fixed_spells'] = 'Fixed Spells';
|
||||
$language['fixed_dungeons'] = 'Fixed Dungeons';
|
||||
$language['fixed_instances'] = 'Fixed Instances';
|
||||
$language['edit_on'] = 'Edit on';
|
||||
$language['server_address'] = 'Server Address';
|
||||
$language['realmlist'] = 'Realmlist';
|
||||
$language['create_account'] = 'Create Account';
|
||||
$language['create_account_tip1'] = 'First of all, you must create an account. The account is used to log into both the game and our website. Click here to open the registration page';
|
||||
$language['download_game'] = 'Download the game';
|
||||
$language['create_account_tip2'] = 'Install World of Warcraft. You can download it (legally) from here: Windows or Mac. Make sure to upgrade to our current supported patch, which is '. get_config('game_version').'. Patch mirrors can be found here.';
|
||||
$language['setup_game'] = 'Setup the game';
|
||||
$language['create_account_tip3'] = 'Open up the "World of Warcraft" directory. The default directory is "C:\Program Files\World of Warcraft". When you\'ve found it, open up the directory called "data", then go into the directory called either enUS or enGB, depending on your client language.';
|
||||
$language['change_server_address'] = 'Change server address';
|
||||
$language['create_account_tip4'] = 'Erase all text and change it to:';
|
||||
$language['server_rules'] = 'Server Rules';
|
||||
$language['read_before_register'] = 'READ BEFORE REGISTER';
|
||||
$language['read_our_rules'] = 'Please, Read our rules.';
|
||||
$language['rule'] = 'Rule';
|
||||
$language['create_new_game_account'] = 'Create a new game account.';
|
||||
$language['email'] = 'Email';
|
||||
$language['username'] = 'Username';
|
||||
$language['password'] = 'Password';
|
||||
$language['retype_password'] = 'Re-Password';
|
||||
$language['captcha'] = 'Captcha';
|
||||
$language['change_password'] = 'Change Password';
|
||||
$language['restore_password'] = 'Restore Password';
|
||||
$language['vote_for_us'] = 'Vote for us';
|
||||
$language['two_factor_authentication'] = 'Two-Factor Authentication';
|
||||
$language['two_factor_authentication_tip1'] = 'Install Google Authenticator.';
|
||||
$language['two_factor_authentication_enable'] = 'Enable 2FA';
|
||||
$language['close'] = 'Close';
|
||||
$language['vote'] = 'Vote';
|
||||
$language['old_password'] = 'old_password';
|
||||
$language['online_players'] = 'Online Players';
|
||||
$language['online_players_msg1'] = 'Limited to show 49 player - Online players:';
|
||||
$language['online_players_msg2'] = 'No players are currently online';
|
||||
$language['name'] = 'Name';
|
||||
$language['race'] = 'Race';
|
||||
$language['class'] = 'Class';
|
||||
$language['level'] = 'Level';
|
||||
$language['top_players'] = 'Top Players';
|
||||
$language['play_time'] = 'Play Time';
|
||||
$language['killers'] = 'Killers';
|
||||
$language['kills'] = 'Kills';
|
||||
$language['honor_points'] = 'Honor Points';
|
||||
$language['honor_level'] = 'Honor level';
|
||||
$language['arena_points'] = 'Arena Points';
|
||||
$language['arena_teams'] = 'Arena Teams';
|
||||
$language['rank'] = 'Rank';
|
||||
$language['rating'] = 'Rating';
|
||||
$language['captain_name'] = 'Captain Name';
|
||||
$language['frequently_questions'] = 'Frequently Asked Questions';
|
||||
$language['question'] = 'Question';
|
||||
$language['answer'] = 'Answer';
|
||||
$language['location'] = 'Location';
|
||||
$language['call'] = 'call';
|
||||
$language['restore_account_password'] = 'Restore Account Password';
|
||||
|
||||
$language['use_valid_email'] = 'Use valid characters for email.';
|
||||
$language['use_valid_username'] = 'Use valid characters for username.';
|
||||
$language['old_password_not_valid'] = 'Old password is not valid.';
|
||||
$language['passwords_not_equal'] = 'Passwords is not equal.';
|
||||
$language['passwords_length'] = 'Password length is not valid.';
|
||||
$language['username_length'] = 'Username length is not valid.';
|
||||
$language['username_or_email_exists'] = 'Username or Email is exists.';
|
||||
$language['email_exists'] = 'Email is exists.';
|
||||
$language['username_exists'] = 'Username is exists.';
|
||||
$language['account_created'] = 'Your account has been created.';
|
||||
$language['error_try_again'] = 'ERROR!, Please try again!';
|
||||
$language['password_changed'] = 'Password has been changed.';
|
||||
$language['email_not_correct'] = 'Email is not correct.';
|
||||
$language['username_not_correct'] = 'Username is not correct.';
|
||||
$language['check_your_email'] = 'Check your email, (Check SPAM/Junk too).';
|
||||
$language['account_is_not_valid'] = 'Account is not valid.';
|
||||
$language['vote_site_not_valid'] = 'Vote site is not valid!';
|
||||
$language['you_already_voted'] = 'You already voted on this website.';
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user