diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index 503fbbf0..8ca8cc3e 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_* diff --git a/buttons.php b/buttons.php index baf5ece5..60185b89 100644 --- a/buttons.php +++ b/buttons.php @@ -1,13 +1,22 @@ Произошла ошибка

Произошла ошибка:

' . $e . '

Назад


(c) ' . $c[1] . '

'); } -include_once('_incl_data/__config.php'); -include_once('_incl_data/class/__db_connect.php'); +Config::init(); +Database::init(); + define('IP', UserIp::get()); $u = User::start(); $filter = new Filter(); @@ -24,9 +33,7 @@ if ($u->info['joinIP'] == 1 && $u->info['ip'] != IP) { er('#Пожалуйста авторизируйтесь с главной страницы'); } elseif (isset($_GET['exit'])) { setcookie('login', '', time() - 60 * 60 * 24 * 30, '', $c['host']); - setcookie('pass', '', time() - 60 * 60 * 24 * 30, '', $c['host']); setcookie('login', '', time() - 60 * 60 * 24 * 30); - setcookie('pass', '', time() - 60 * 60 * 24 * 30); mysql_query('UPDATE `users` SET `online` = ' . (time() - 420) . ' WHERE `id` = ' . $u->info['id']); //520 die(''); } elseif (!isset($u->info['id'])) { @@ -62,12 +69,12 @@ $u->stats = $u->getStats($u->info['id'], 0); '; ?> -