diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index 503fbbf0..369bed55 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -1880,7 +1880,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` private function __construct() { if (!empty($_SESSION['uid'])) { - $this->info = Db::getRow( + $user = Db::getRow( 'select *, users.id as id, @@ -1898,7 +1898,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` [$_SESSION['uid']] ); } else { - $this->info = Db::getRow( + $user = Db::getRow( 'select *, users.id as id, @@ -1917,9 +1917,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` ); } - if (empty($this->info)) { - $this->info = []; + if (!empty($user) && is_array($user)) { + $this->info = $user; } + unset($user); Database::init(); // для всяких mysql_* @@ -1940,20 +1941,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` setcookie('btl', $this->info['battle'], time() + 86400); } - if (!isset($this->info['id'])) { - $this->info = Db::getRow('select * from users where login = ?', [$_COOKIE['login']]); - - if ($this->info['dateEnter'] != $_SERVER['HTTP_USER_AGENT']) { - unset($this->info); - } - $this->btl_txt = $this->info['battle_text']; - if (!isset($this->info['id'])) { - unset($this->info); - setcookie('login', '', time() - 60 * 60 * 24, '', Core\Config::get('host')); - } else { - echo 'stats is lost.'; - } - } +// if (!isset($this->info['id'])) { +// $this->info = Db::getRow('select * from users where login = ?', [$_COOKIE['login']]); +// +// if ($this->info['dateEnter'] != $_SERVER['HTTP_USER_AGENT']) { +// unset($this->info); +// } +// $this->btl_txt = $this->info['battle_text']; +// if (!isset($this->info['id'])) { +// unset($this->info); +// setcookie('login', '', time() - 60 * 60 * 24, '', Core\Config::get('host')); +// } else { +// echo 'stats is lost.'; +// } +// } if (isset($this->info['id'])) { if ($this->info['invis'] == 1 || $this->info['invis'] > time()) { diff --git a/buttons.php b/buttons.php index baf5ece5..60185b89 100644 --- a/buttons.php +++ b/buttons.php @@ -1,13 +1,22 @@
Произошла ошибка: (c) ' . $c[1] . '' . $e . '