mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
Merge branch 'develop' into feature/csrf
This commit is contained in:
@@ -1220,15 +1220,37 @@ function clearCache()
|
||||
if ($cache->fetch('failed_logins', $tmp))
|
||||
$cache->delete('failed_logins');
|
||||
|
||||
global $template_name;
|
||||
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
||||
$cache->delete('template_ini' . $template_name);
|
||||
foreach (get_templates() as $template) {
|
||||
if ($cache->fetch('template_ini_' . $template, $tmp)) {
|
||||
$cache->delete('template_ini_' . $template);
|
||||
}
|
||||
}
|
||||
|
||||
if ($cache->fetch('plugins_hooks', $tmp))
|
||||
if ($cache->fetch('template_menus', $tmp)) {
|
||||
$cache->delete('template_menus');
|
||||
}
|
||||
if ($cache->fetch('database_tables', $tmp)) {
|
||||
$cache->delete('database_tables');
|
||||
}
|
||||
if ($cache->fetch('database_columns', $tmp)) {
|
||||
$cache->delete('database_columns');
|
||||
}
|
||||
if ($cache->fetch('database_checksum', $tmp)) {
|
||||
$cache->delete('database_checksum');
|
||||
}
|
||||
if ($cache->fetch('last_kills', $tmp)) {
|
||||
$cache->delete('last_kills');
|
||||
}
|
||||
|
||||
if ($cache->fetch('hooks', $tmp)) {
|
||||
$cache->delete('hooks');
|
||||
}
|
||||
if ($cache->fetch('plugins_hooks', $tmp)) {
|
||||
$cache->delete('plugins_hooks');
|
||||
|
||||
if ($cache->fetch('plugins_routes', $tmp))
|
||||
}
|
||||
if ($cache->fetch('plugins_routes', $tmp)) {
|
||||
$cache->delete('plugins_routes');
|
||||
}
|
||||
}
|
||||
|
||||
deleteDirectory(CACHE . 'signatures', ['index.html'], true);
|
||||
|
@@ -18,18 +18,18 @@ if(!$logged) {
|
||||
}
|
||||
|
||||
$new_password = $_POST['newpassword'] ?? NULL;
|
||||
$new_password2 = $_POST['newpassword2'] ?? NULL;
|
||||
$new_password_confirm = $_POST['newpassword_confirm'] ?? NULL;
|
||||
$old_password = $_POST['oldpassword'] ?? NULL;
|
||||
if(empty($new_password) && empty($new_password2) && empty($old_password)) {
|
||||
if(empty($new_password) && empty($new_password_confirm) && empty($old_password)) {
|
||||
$twig->display('account.change_password.html.twig');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($new_password) || empty($new_password2) || empty($old_password)){
|
||||
if(empty($new_password) || empty($new_password_confirm) || empty($old_password)){
|
||||
$errors[] = 'Please fill in form.';
|
||||
}
|
||||
$password_strlen = strlen($new_password);
|
||||
if($new_password != $new_password2) {
|
||||
if($new_password != $new_password_confirm) {
|
||||
$errors[] = 'The new passwords do not match!';
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ if($save)
|
||||
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
$password2 = $_POST['password2'];
|
||||
$password_confirm = $_POST['password_confirm'];
|
||||
|
||||
// account
|
||||
if(!config('account_login_by_email')) {
|
||||
@@ -81,7 +81,7 @@ if($save)
|
||||
if(empty($password)) {
|
||||
$errors['password'] = 'Please enter the password for your new account.';
|
||||
}
|
||||
elseif($password != $password2) {
|
||||
elseif($password != $password_confirm) {
|
||||
$errors['password'] = 'Passwords are not the same.';
|
||||
}
|
||||
else if(!Validator::password($password)) {
|
||||
@@ -134,7 +134,7 @@ if($save)
|
||||
'email' => $email,
|
||||
'country' => $country,
|
||||
'password' => $password,
|
||||
'password2' => $password2,
|
||||
'password_confirm' => $password_confirm,
|
||||
'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] === 'true' : false,
|
||||
);
|
||||
|
||||
@@ -267,7 +267,7 @@ if($save)
|
||||
$_POST['account_login'] = USE_ACCOUNT_NAME ? $account_name : $account_id;
|
||||
}
|
||||
|
||||
$_POST['password_login'] = $password2;
|
||||
$_POST['password_login'] = $password_confirm;
|
||||
|
||||
require PAGES . 'account/login.php';
|
||||
header('Location: ' . getLink('account/manage'));
|
||||
|
@@ -135,6 +135,7 @@ if($settingHighscoresOutfit) {
|
||||
$configHighscoresPerPage = setting('core.highscores_per_page');
|
||||
$limit = $configHighscoresPerPage + 1;
|
||||
|
||||
$highscores = [];
|
||||
$needReCache = true;
|
||||
$cacheKey = 'highscores_' . $skill . '_' . $vocation . '_' . $page . '_' . $configHighscoresPerPage;
|
||||
|
||||
@@ -158,7 +159,7 @@ $query->join('accounts', 'accounts.id', '=', 'players.account_id')
|
||||
->selectRaw('accounts.country, players.id, players.name, players.account_id, players.level, players.vocation' . $outfit . $promotion)
|
||||
->orderByDesc('value');
|
||||
|
||||
if (!isset($highscores) || empty($highscores)) {
|
||||
if (empty($highscores)) {
|
||||
if ($skill >= POT::SKILL_FIRST && $skill <= POT::SKILL_LAST) { // skills
|
||||
if ($db->hasColumn('players', 'skill_fist')) {// tfs 1.0
|
||||
$skill_ids = array(
|
||||
@@ -201,17 +202,17 @@ if (!isset($highscores) || empty($highscores)) {
|
||||
$list = 'experience';
|
||||
}
|
||||
}
|
||||
|
||||
$highscores = $query->get()->map(function($row) {
|
||||
$tmp = $row->toArray();
|
||||
$tmp['online'] = $row->online_status;
|
||||
$tmp['vocation'] = $row->vocation_name;
|
||||
unset($tmp['online_table']);
|
||||
|
||||
return $tmp;
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
$highscores = $query->get()->map(function($row) {
|
||||
$tmp = $row->toArray();
|
||||
$tmp['online'] = $row->online_status;
|
||||
$tmp['vocation'] = $row->vocation_name;
|
||||
unset($tmp['online_table']);
|
||||
|
||||
return $tmp;
|
||||
})->toArray();
|
||||
|
||||
if ($cache->enabled() && $needReCache) {
|
||||
$cache->set($cacheKey, serialize($highscores), setting('core.highscores_cache_ttl') * 60);
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace MyAAC\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GuildInvites extends Model {
|
||||
class GuildInvite extends Model {
|
||||
|
||||
protected $table = 'guild_invites';
|
||||
|
||||
|
@@ -34,7 +34,7 @@ Please enter your current password and a new password. For your security, please
|
||||
<span>New Password Again:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="newpassword2" size="30" maxlength="29">
|
||||
<input type="password" name="newpassword_confirm" size="30" maxlength="29">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@@ -105,11 +105,11 @@
|
||||
<span{% if errors.password is defined %} class="red"{% endif %}>Repeat password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password2" id="password2" value="" size="30" maxlength="29" />
|
||||
<img id="password2_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
||||
<input type="password" name="password_confirm" id="password_confirm" value="" size="30" maxlength="29" />
|
||||
<img id="password_confirm_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
||||
</td>
|
||||
</tr>
|
||||
<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 id="password_confirm_error" class="FormFieldError">{% if errors.password is defined %}{{ errors.password }}{% endif %}</span></td></tr>
|
||||
|
||||
{{ hook('HOOK_ACCOUNT_CREATE_AFTER_PASSWORDS') }}
|
||||
</tbody>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
$('#password').blur(function() {
|
||||
checkPassword();
|
||||
});
|
||||
$('#password2').blur(function() {
|
||||
$('#password_confirm').blur(function() {
|
||||
checkPassword();
|
||||
});
|
||||
$('#SuggestAccountNumber a').click(function (event) {
|
||||
@@ -150,11 +150,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if(document.getElementById("password2").value == "")
|
||||
if(document.getElementById("password_confirm").value == "")
|
||||
{
|
||||
$('#password2_error').html('Please enter the password again!');
|
||||
$('#password2_indicator').attr('src', 'images/global/general/nok.gif');
|
||||
$('#password2_indicator').show();
|
||||
$('#password_confirm_error').html('Please enter the password again!');
|
||||
$('#password_confirm_indicator').attr('src', 'images/global/general/nok.gif');
|
||||
$('#password_confirm_indicator').show();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,24 +172,24 @@
|
||||
}
|
||||
|
||||
var password = document.getElementById("password").value;
|
||||
var password2 = document.getElementById("password2").value;
|
||||
$.getJSON("tools/validate.php", { password: password, password2: password2, uid: Math.random() },
|
||||
var password_confirm = document.getElementById("password_confirm").value;
|
||||
$.getJSON("tools/validate.php", { password: password, password_confirm: password_confirm, uid: Math.random() },
|
||||
function(data){
|
||||
if(data.hasOwnProperty('success')) {
|
||||
$('#password_error').html ('');
|
||||
$('#password2_error').html ('');
|
||||
$('#password_confirm_error').html ('');
|
||||
$('#password_indicator').attr('src', 'images/global/general/ok.gif');
|
||||
$('#password2_indicator').attr('src', 'images/global/general/ok.gif');
|
||||
$('#password_confirm_indicator').attr('src', 'images/global/general/ok.gif');
|
||||
}
|
||||
else if(data.hasOwnProperty('error')) {
|
||||
$('#password_error').html(data.error);
|
||||
$('#password2_error').html(data.error);
|
||||
$('#password_confirm_error').html(data.error);
|
||||
$('#password_indicator').attr('src', 'images/global/general/nok.gif');
|
||||
$('#password2_indicator').attr('src', 'images/global/general/nok.gif');
|
||||
$('#password_confirm_indicator').attr('src', 'images/global/general/nok.gif');
|
||||
}
|
||||
|
||||
$('#password_indicator').show();
|
||||
$('#password2_indicator').show();
|
||||
$('#password_confirm_indicator').show();
|
||||
}
|
||||
);
|
||||
|
||||
|
@@ -31,7 +31,7 @@ if($dev_mode) {
|
||||
}
|
||||
unset($dev_mode);
|
||||
|
||||
$filter = new Twig_SimpleFilter('timeago', function ($datetime) {
|
||||
$filter = new TwigFilter('timeago', function ($datetime) {
|
||||
|
||||
$time = time() - strtotime($datetime);
|
||||
|
||||
|
Reference in New Issue
Block a user