| @@ 71-75 (lines=5) @@ | ||
| 68 | function deleteMsgAction($messageId) |
|
| 69 | {
|
|
| 70 | $result = new Server\Result(); |
|
| 71 | if (!\Users\User::$cur->isAdmin()) {
|
|
| 72 | $result->success = false; |
|
| 73 | $result->content = 'Вы не админ'; |
|
| 74 | $result->send(); |
|
| 75 | } |
|
| 76 | $msg = Chats\Chat\Message::get((int) $messageId); |
|
| 77 | if (!$msg) {
|
|
| 78 | $result->success = false; |
|
| @@ 91-95 (lines=5) @@ | ||
| 88 | function banUserAction($messageId) |
|
| 89 | {
|
|
| 90 | $result = new Server\Result(); |
|
| 91 | if (!\Users\User::$cur->isAdmin()) {
|
|
| 92 | $result->success = false; |
|
| 93 | $result->content = 'Вы не админ'; |
|
| 94 | $result->send(); |
|
| 95 | } |
|
| 96 | $msg = Chats\Chat\Message::get((int) $messageId); |
|
| 97 | if (!$msg) {
|
|
| 98 | $result->success = false; |
|
| @@ 126-130 (lines=5) @@ | ||
| 123 | $result->content = 'Такого чата не существует'; |
|
| 124 | $result->send(); |
|
| 125 | } |
|
| 126 | if (!Users\User::$cur->id) {
|
|
| 127 | $result->success = false; |
|
| 128 | $result->content = 'Вы не авторизованы'; |
|
| 129 | $result->send(); |
|
| 130 | } |
|
| 131 | if (empty($_POST['chat-message']) || !trim($_POST['chat-message'])) {
|
|
| 132 | $result->success = false; |
|
| 133 | $result->content = 'Сообщение не может быть пустым'; |
|