From 3317ab845d0ae768cffbb2141845aaddf39bbd3a Mon Sep 17 00:00:00 2001 From: lopar Date: Sun, 5 Jul 2020 21:38:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BB=D0=B8?= =?UTF-8?q?=D1=87=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=B5=D0=BB=D0=B0=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/User.php | 39 +++++++++++++++++++++++++++++++++------ css/main.css | 9 +++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/classes/User.php b/classes/User.php index 93b53e4..abc9c68 100644 --- a/classes/User.php +++ b/classes/User.php @@ -32,20 +32,27 @@ class User public $stats; public $shadow; - const EMPTY_SLOT = <<fetch_assoc(); + $watchingUser_query = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); foreach ($this as $key => $value) { if (isset($user_query[$key])) { $this->$key = $user_query[$key]; } } + if ($watchingUser_query['admin']) { + $this->watcherIsAdmin = 1; + } + if ($watchingUser_query['align'] == 1) { + $this->watcherIsModerator = 1; + } } protected function showItem($item = 0) @@ -178,9 +185,15 @@ EMPTY_SLOT; } echo ''; - $this->Bank = new Bank($this->id); - echo sprintf('Денег в банке: %s.
session_uid: %s.', $this->Bank->money, $_SESSION['uid']); - + if ($this->watcherIsAdmin || $this->watcherIsModerator) { + echo '
'; + echo sprintf('Личное дело
ИД Игрока: %s
ДР Игрока: %s
IP Регистрации: %s', $this->id, date('d.m.Y', strtotime($this->borndate)), $this->ip); + if ($this->watcherIsAdmin) { + $this->Bank = new Bank($this->id); + echo sprintf('ИД Комнаты: %s
Деньги в банке: %s
E-Mail: %s
Текущая сессия: %s
>', $this->room, $this->Bank->money, $this->email, $this->session_id); + } + echo '
'; + } } public function showStarSign() { @@ -223,4 +236,18 @@ EMPTY_SLOT; } return $sign ?? null; } + + public function showPrivateUserInfo() { + $this->watchingUser; + function privateAccessCheck() + { + $own = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $uid)->fetch_assoc(); + if ($own['admin'] == 1) { + return ADMINISTRATOR_ACCESS; + } elseif ($own['align'] == 1) { + return MODERATOR_ACCESS; + } + return false; + } + } } \ No newline at end of file diff --git a/css/main.css b/css/main.css index 117c9f0..fc2e4a3 100644 --- a/css/main.css +++ b/css/main.css @@ -409,4 +409,13 @@ div.debug { border:1px dashed #faf; border-radius:5px; padding:5px; +} +div.secretInfo { + background:#fee; + border:1px dashed #faa; + border-radius:5px; + padding:5px; +} +div.secretInfo > span { + color: #f80000; } \ No newline at end of file