Личный кабинет неверно функционерует

Добро пожаловать!

Зарегистрировавшись у нас, вы сможете обсуждать, делиться и отправлять личные сообщения другим участникам нашего сообщества.

Зарегистрироваться!
  • Если Вы желаете помогать развитию проекта, готовы заполнять раздел(-ы) и подсказывать другим пользователям на портале, есть возможность попасть в команду редакторов. Для этого следует обратиться в техническую поддержку
Пользователь
Регистрация
13 Авг 2023
Сообщения
3
Доброго времени суток, у меня есть сайт аризоны рп, все поставил. База данных не от мода аризоны поэтому я расчитываю на баги из за этого.
У меня аккаунт зарегистрирован в игре я ввожу все верные данные , но пароль не подходит постоянно.
Вот мой auth.js
$(document).ready(function(){$("#login-form").ajaxForm({url:"/engine/profile/login.php",dataType:"text",success:function(e){e=$.parseJSON(e);var i=$("#error-input-server"),t=$("#error-input-username"),n=$("#error-input-password"),a=$(".btn--login");switch(i.empty(),t.empty(),n.empty(),e.status){case"error":switch(e.type){case"invalidserver":i.append("Выберите сервер!"),document.getElementById("#serverId-error");break;case"invalidusername":t.append("Введите ваш ник"),document.getElementById("#username-error");break;case"invalidpassword":n.append("Введите ваш пароль"),document.getElementById("#password-error");break;case"noaccount":a.html(""),a.append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>'),setTimeout(function(){n.append("Неверный пароль или логин"),document.getElementById("#password-error"),a.html("Войти"),$("#login-form")[0].reset()},2e3);break;case"dbinvalidserver":a.html(""),a.append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>'),setTimeout(function(){i.append("Неверные данные от сервера(mysql_error)"),document.getElementById("#serverId-error"),a.html("Войти"),$("#login-form")[0].reset()},2e3)}break;case"success":a.html(""),a.append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>'),setTimeout(function(){location.href=e.url},2e3)}}});var e=0;$("#recovery-form").ajaxForm({url:"/engine/recovery.php",dataType:"text",success:function(i){i=$.parseJSON(i);var t=$("#error-input-server").empty(),n=$("#error-input-email").empty();switch(i.status){case"error":switch(i.type){case"invalidserver":t.append("Выберите сервер!"),document.getElementById("#serverId2");break;case"invalidemail":n.append("Введите e-mail"),document.getElementById("#email");break;case"noemail":e++,$(".btn--login").html(""),$(".btn--login").append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>'),$(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification info"><div class="notification-content">Проверяем почту..</div></div>'),setTimeout(function(){$(".vue-notification-template").fadeOut(),setTimeout(function(){$(".vue-notification-template").fadeOut(),$(".vue-notification-template ").remove()},3e3),$(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification error"><div class="notification-content">Аккаунт с такой почной не найден!</div></div>'),$(".btn--login").html("Восстановить"),$("#recovery-form")[0].reset()},3e3)}break;case"success":e++,$(".btn--login").html(""),$(".btn--login").append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>'),$(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification info"><div class="notification-content">Проверяем почту..</div></div>'),setTimeout(function(){$(".vue-notification-template").fadeOut(),setTimeout(function(){$(".vue-notification-template").fadeOut(),$(".vue-notification-template ").remove()},3e3),$(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification success"><div class="notification-content">На вашу почту отправлено письмо с дальнешими действиями</div></div>'),$(".btn--login").html("Восстановить"),$("#recovery-form")[0].reset()},3e3)}}});var i=document.location.search,t=new URLSearchParams(i);null!=t.get("token")&&20==t.get("token").length&&($(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification success" style="display: none;"><div class="notification-content">Новый пароль был отправлен вам на почту!</div></div>'),$(".vue-notification-template").fadeIn(500),setTimeout(function(){$(".vue-notification-template").fadeOut(),$(".vue-notification-template ").remove(),history.pushState({},"","/recovery-password")},4e3)),$("#change-pass").ajaxForm({url:"/engine/profile/changepass.php",dataType:"text",success:function(i){i=$.parseJSON(i);var t=$("#error-input-oldpass").empty(),n=$("#error-input-newpass").empty();switch(i.status){case"error":switch(i.type){case"invalidoldpass":t.append("Введите пароль"),document.getElementById("#currentPassword");break;case"errorserver":t.append("Unknown Property"),document.getElementById("#currentPassword");break;case"invalidoldpasserror":t.append("Неверный пароль"),document.getElementById("#currentPassword");break;case"invalidnewpass":n.append("Введите пароль"),document.getElementById("#newPassword");break;case"invalidpassvalue":n.append("Пароль должен содержать не менее 8 символов"),document.getElementById("#newPassword");break;case"nochange":n.append("Запрещено менять пароль на тот же самый!!"),document.getElementById("#newPassword");break;case"invalid":$(".vue-notification-group").append('<div class="vue-notification-template vue-notification error" style="display: none;"><div class="notification-content">Пароли не совпадают</div></div>'),$(".vue-notification-template").fadeIn(500),setTimeout(function(){$(".vue-notification-template").fadeOut(),$(".vue-notification-template ").remove()},3e3),n.append("Пароли не совпадают"),document.getElementById("#newPasswords")}break;case"success":$(".btn--change").html(""),$(".btn--change").append('<span id="submit" style="display: block;"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></span>');$(".vue-notification-template").data("id");setTimeout(function(){$(".vue-notification-template").fadeOut(),setTimeout(function(){$(".vue-notification-template").fadeOut(),$(".vue-notification-template ").remove()},3e3),$(".vue-notification-group").append("<div data-id="+e+' class="vue-notification-template vue-notification success" style="display: none;"><div class="notification-content">Пароль успешно изменён!</div></div>'),$(".vue-notification-template").fadeIn(500),$(".btn--change").html("Изменить"),$("#change-pass")[0].reset()},3e3)}}})})
У меня , если что все , что находится в базе данных с аккаунтами называется accounts.
Вот мой login.php
<?
$server = stripslashes(htmlspecialchars(trim($_POST['serverId'])));
$password = stripslashes(htmlspecialchars(trim($_POST['password'])));
$name = stripslashes(htmlspecialchars(trim($_POST['username'])));

if($server == '0') { echo json_encode(array('status' => 'error', 'type' => 'invalidserver')); return false; }
else if($name == '') { echo json_encode(array('status' => 'error', 'type' => 'invalidusername')); return false; }
else if($password == '') { echo json_encode(array('status' => 'error', 'type' => 'invalidpassword')); return false; }
else
{
require_once('../../engine/core/connect.php');
$mysqli->set_charset("utf8");
$sql = "SELECT * FROM `servers` WHERE id = '{$server}'";
$result = $mysqli->query($sql);
if($result->num_rows != 0)
{
$servers = $result->fetch_assoc();
$mysqli = @new mysqli($servers['db_host'], $servers['db_user'], $servers['db_password'], $servers['db_name']);
if (mysqli_connect_errno()) { echo json_encode(array('status' => 'error', 'type' => 'dbinvalidserver')); return false; }

session_start();
$mysqli->set_charset("utf-8");
$sql = "SELECT * FROM `Qelksekm` WHERE `NickName` = '{$name}'";
$result = $mysqli->query($sql);

if($result->num_rows == 1)
{
$result->data_seek(0);
$account = $result->fetch_assoc();
$dbpassword = $account['Password'];
$id = $account['ID'];
$skin = $account['Skin'];
$admin = $account['Admin'];

if($password == $dbpassword)
{
$_SESSION['servers'] = $server;
$_SESSION['accounts'] = $name;
$_SESSION['account_id'] = $id;
$_SESSION['skin'] = $skin;
$_SESSION['account_logged'] = 'try';
echo json_encode(array('status' => 'success', 'url' => '/profile'));
} else { echo json_encode(array('status' => 'error', 'type' => 'noaccount')); return false; }
} else { echo json_encode(array('status' => 'error', 'type' => 'noaccount')); return false; }
$result->close();
} else { echo json_encode(array('status' => 'error', 'type' => 'invalidserver')); return false; }
}
$mysqli->close();
?>
 
Пользователь
Регистрация
9 Фев 2023
Сообщения
26
МБ у тебя шифр MD5, попробуй из бд взять пароль.
 
Сверху