bad class bug

This commit is contained in:
lopar 2018-03-03 22:59:09 +02:00
parent ba1182c95d
commit a17571c4f2
2 changed files with 7 additions and 8 deletions

View File

@ -8,7 +8,6 @@
class nick
{
private $user_data;
private $
/**
* nick constructor.

View File

@ -7,7 +7,7 @@ if (!isset($_SESSION['uid'])) {
include_once('config.php');
include_once('functions.php');
if ($u->i()['battle'] > 0) {
if ($user['battle'] > 0) {
header('Location: /fbattle.php');
die();
}
@ -34,13 +34,13 @@ if ($name || $color || $hobbie) {
if ($simbolcount > 1500) {
err('Максимальная длинна поля Хобби: 1500 символов!');
} else {
db::c()->query('UPDATE `users` SET `realname` = "?s", `color` = "?s", `info` = "?s" WHERE `id` = ?i', $name, $color, $hobbie, $u->i()['id']);
db::c()->query('UPDATE `users` SET `realname` = "?s", `color` = "?s", `info` = "?s" WHERE `id` = ?i', $name, $color, $hobbie, $user['id']);
}
}
if ($oldpsw && $newpsw){
if (password_verify($oldpsw, $u->i()['pass'])){
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `id` = ?i', password_hash($newpsw,PASSWORD_DEFAULT), $u->i()['id']);
if (password_verify($oldpsw, $user['pass'])){
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `id` = ?i', password_hash($newpsw,PASSWORD_DEFAULT), $user['id']);
} else err('Неверный текущий пароль!');
}
?>
@ -53,15 +53,15 @@ if ($oldpsw && $newpsw){
</head>
<body>
<a href="main.php"> на главную</a>
<h1>Анкета персонажа <?= $u->i()['login'] ?></h1>
<h1>Анкета персонажа <?= $user['login'] ?></h1>
<form method="post" action="user_anketa.php">
<input name="name" placeholder="Реальное имя" value="<?= $u->i()['realname']; ?>"><br>
<input name="name" placeholder="Реальное имя" value="<?= $user['realname']; ?>"><br>
<select name="color" id="color">
<option value="0" selected>Чёрный</option>
<option value="1">Синий</option>
<option value="2">Зелёный</option>
</select><label for="color"></label><br>
<textarea name="hobbie" placeholder="Хобби"><?= $u->i()['info'] ?></textarea><br>
<textarea name="hobbie" placeholder="Хобби"><?= $user['info'] ?></textarea><br>
<input name="submit" type="submit">
</form>
<h1>Безопасность</h1>