| @@ 61-65 (lines=5) @@ | ||
| 58 | ||
| 59 |     public function deleteMsgAction($messageId) { | |
| 60 | $result = new Server\Result(); | |
| 61 |         if (!\Users\User::$cur->isAdmin()) { | |
| 62 | $result->success = false; | |
| 63 | $result->content = 'Вы не админ'; | |
| 64 | $result->send(); | |
| 65 | } | |
| 66 | $msg = Chats\Chat\Message::get((int) $messageId); | |
| 67 |         if (!$msg) { | |
| 68 | $result->success = false; | |
| @@ 80-84 (lines=5) @@ | ||
| 77 | ||
| 78 |     public function banUserAction($messageId) { | |
| 79 | $result = new Server\Result(); | |
| 80 |         if (!\Users\User::$cur->isAdmin()) { | |
| 81 | $result->success = false; | |
| 82 | $result->content = 'Вы не админ'; | |
| 83 | $result->send(); | |
| 84 | } | |
| 85 | $msg = Chats\Chat\Message::get((int) $messageId); | |
| 86 |         if (!$msg) { | |
| 87 | $result->success = false; | |
| @@ 114-118 (lines=5) @@ | ||
| 111 | $result->content = 'Такого чата не существует'; | |
| 112 | $result->send(); | |
| 113 | } | |
| 114 |         if (!Users\User::$cur->id) { | |
| 115 | $result->success = false; | |
| 116 | $result->content = 'Вы не авторизованы'; | |
| 117 | $result->send(); | |
| 118 | } | |
| 119 |         if (empty($_POST['chat-message']) || !trim($_POST['chat-message'])) { | |
| 120 | $result->success = false; | |
| 121 | $result->content = 'Сообщение не может быть пустым'; | |