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