-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkick.php
More file actions
22 lines (15 loc) · 956 Bytes
/
kick.php
File metadata and controls
22 lines (15 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require_once "require/nmps.php";
if ($userinfo['op'] < 3)
die("\033[1;31mYour op level is too low");
if (!($target = userAccount::usernameToId($argv[0])))
die("\033[1;31mUser doesn't exists");
if (!userAccount::isUserOnline($target))
die("\033[1;31mUser is offline");
unset($argv[0]);
db::query("DELETE FROM authTokens WHERE userId=:userId",
[':userId' => $target]);
db::query("INSERT INTO events (userId, senderId, eventType, eventData) VALUES (:userId, :senderId, :eventType, :eventData)",
[':userId' => $target, ':senderId' => $userinfo['id'],
':eventType' => 126, ':eventData' => "\033[1;33m[\033[1;97m" . date("H:i:s") . "\033[1;33m] \033[0;37mYou were kicked by \033[1;97m" . $userinfo['username'] . " \033[0;37mfor \033[1;31m" . (count($argv) > 1 ? implode(' ', $argv) : "no reason")]);
echo "\033[1;33m[\033[1;97m" . date("H:i:s") . "\033[1;33m] \033[0;32mKicked \033[0;37m" . userAccount::idToUsername($target) . "\033[1;37m.";