X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/05252a1458855a3a9a3909601e1e894dc1aae590..4fc503d806fb32dc8d2ef286ceb4183ef54ad93f:/index.php diff --git a/index.php b/index.php index b70bd38..9919d35 100644 --- a/index.php +++ b/index.php @@ -1,407 +1,263 @@ - -UnrealIRCd Panel - - - -
-

UnrealIRCd Administration Panel

- -
- Overview - Users - Channels - Server Bans - Spamfilter - News -
set_method("user.get"); - $rpc->set_params(["nick" => "$user"]); - $rpc->execute(); - $nick = ($rpc->result) ? $rpc->fetch_assoc() : NULL; - if (!$nick) - { - Message::Fail("Could not find that user. Maybe they disconnected after you clicked this?"); - return; - } - - $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); - $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; - if (rpc_tkl_add($user, $bantype, $duration, $reason)) - { - $c = $nick['result']['client']; - Message::Success($c['name'] . " (*@".$c['hostname'].") has been $bantype" . "d $msg_msg: $reason"); - } - } - } - - if (!empty($_POST['tklch'])) - foreach ($_POST as $key => $value) { - foreach ($value as $tok) { - $tok = explode(",", $tok); - if (rpc_tkl_del(base64_decode($tok[0]), base64_decode($tok[1]))) - Message::Success(base64_decode($tok[1])." has been removed for ".base64_decode($tok[0])); - } - } - - if (!empty($_POST['sf'])) - foreach ($_POST as $key => $value) { - foreach ($value as $tok) { - $tok = explode(",", $tok); - rpc_sf_del(base64_decode($tok[0]), base64_decode($tok[1]), base64_decode($tok[2]), base64_decode($tok[3])); - } - } -} - -rpc_pop_lists(); +$stats = $rpc->query("stats.get", []); ?> -
-
- - - - - - - - - -
Chat Overview
Users
Opers
Services
Most popular channel ( users)
Channels
Server bans
Spamfilter entries
- -
-
- - - - - - - -
Filter by: -
- Nick: - -
-
-
- Hostname: - -
-
-
- IP: - -
-
-
- Account: - -
-
- Network Overview - if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip'])) - Message::Info("Listing users which match IP: \"" . $_POST['uf_ip'] . "\""); - - if (isset($_POST['uf_host']) && strlen($_POST['uf_host'])) - Message::Info("Listing users which match hostmask: \"" . $_POST['uf_host'] . "\""); - - if (isset($_POST['uf_account']) && strlen($_POST['uf_account'])) - Message::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\""); - - ?> - - - - - - - - - - - - - - +
- echo "
"; - echo ""; - $isBot = (strpos($user['user']['modes'], "B") !== false) ? ' Bot' : ""; - echo "'; - echo ""; - echo ""; - $account = (isset($user['user']['account'])) ? ''.$user['user']['account'].'' : 'None'; - echo ""; - $modes = (isset($user['user']['modes'])) ? "+" . $user['user']['modes'] : ""; - echo ""; - $oper = (isset($user['user']['operlogin'])) ? ''.$user['user']['operlogin']."".$user['user']['operclass']."" : ""; - if (!strlen($oper)) - $oper = (strpos($user['user']['modes'], "S") !== false) ? 'Service' : ""; - echo ""; - $secure = (isset($user['tls'])) ? "Secure" : "Insecure"; - echo ""; - echo ""; - echo ""; - } - ?>
Select allNickUIDHost / IPAccountUsermodesℹ️OperSecureConnected toReputation ℹ️
".$user['name'].$isBot.'".$user['id']."".$user['hostname']." (".$user['ip'].")".$account."".$modes." ".$oper."".$secure."".$user['user']['servername']."".$user['user']['reputation']."
-
- -
-
- - - -
-
- - - -
+
+
+
+
+
+
+ + user->record; ?> + +
+
+

user->total; ?>

+
+
+
+
+
+
+
Users Online
+
+ +
+
+
+ -
-
-

- - - - - - - - - "; - echo ""; - echo ""; - echo ""; - $topic = (isset($channel['topic'])) ? $channel['topic'] : ""; - echo ""; - $setby = (isset($channel['topic'])) ? "By ".$channel['topic_set_by'] .", at ".$channel['topic_set_at'] : ""; - echo ""; - $modes = (isset($channel['modes'])) ? "+" . $channel['modes'] : ""; - echo ""; - } - ?>
NameCreatedUser countTopicTopic SetModes".$channel['name']."".$channel['creation_time']."".$channel['num_users']."".$topic."".$setby."".$modes."
+
+
+
+
+
+
+ +
+
+

channel->total; ?>

+
+
+
+
+
+
+
Channels
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+

user->oper; ?>

+
+
+
+
+
+
+
Opers
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+

server->total; ?>

+
+
+
+
+
+
+
Servers
+
+ +
+
+
+
+
+ +
-
-
- - - - - - - - - - - - - "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - ?>
Select allMaskTypeSet BySet OnExpiresDurationReason".$tkl['name']."".$tkl['type_string']."".$tkl['set_by']."".$tkl['set_at_string']."".$tkl['expire_at_string']."".$tkl['duration_string']."".$tkl['reason']."

- +
+
+
+
+
+
+ +
+
+

server_ban->server_ban; ?>

+
+
+
+
+
+
+
Server Bans
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+

server_ban->spamfilter; ?>

+
+
+
+
+
+
+
Spamfilter
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+

server_ban->server_ban_exception; ?>

+
+
+
-
-
-

- - - - - - - - - - - - - - - - "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - for ($i = 0, $targs = ""; ($c = $sf['spamfilter_targets'][$i]); $i++) - { - if ($c == "c") - $targs .= "Channel, "; - else if ($c == "p") - $targs .= "Private,"; - else if ($c == "n") - $targs .= "Notice, "; - else if ($c == "N") - $targs .= "Channel notice, "; - else if ($c == "P") - $targs .= "Part message, "; - else if ($c == "q") - $targs .= "Quit message, "; - else if ($c == "d") - $targs .= "DCC filename, "; - else if ($c == "a") - $targs .= "Away message, "; - else if ($c == "t") - $targs .= "Channel topic, "; - else if ($c == "T") - $targs .= "MessageTag, "; - else if ($c == "u") - $targs .= "Usermask, "; +
+
+
+
Server Ban Exceptions
+
+ +
+
+ + + server->ulined) { + $bg = "bg-success"; - $targs = rtrim($targs,", "); - } - echo ""; - echo ""; - + /* honestly can't think of a case where there would actually be only one uline... but... well here we are, worrying over the small stuff =] */ + $user_noun = ($stats->user->ulined == 1) ? "user" : "users"; // use "users" even if 0, sounds better. + $is_are = ($stats->user->ulined == 1) ? "is" : "are"; + $server_noun = ($stats->server->ulined == 1) ? "server" : "servers"; + $tooltip = "There $is_are " . $stats->user->ulined . " U-Lined $user_noun over " . $stats->server->ulined . " U-Lined $server_noun"; } - ?>
Select allMaskTypeSet BySet OnExpiresDurationMatch TypeActionAction DurationTargetReason".$sf['name']."".$sf['type_string']."".$sf['set_by']."".$sf['set_at_string']."".$sf['expire_at_string']."".$sf['duration_string']."".$sf['match_type']."".$sf['ban_action']."".$sf['ban_duration_string']."".$targs."".$sf['reason']."

+ else + $bg = "bg-warning"; + ?> +
+
+
+
+
+ +
+
+

user->ulined; ?>/server->ulined; ?>

+
+
+
+
+
+
+
Services Online
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+

+
+
+
+
+
+
+
Panel Users
+
+ +
+
+
+
+
+
+ -
- - -
- - +require_once "footer.php";