]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - index.php
2 <link href
="css/unrealircd-admin.css" rel
="stylesheet">
4 <div id
="headerContainer">
5 <h2
>UnrealIRCd
<small
>Administration Panel
</small
></h2
><br
>
7 <script src
="js/unrealircd-admin.js" defer
></script
>
9 <a data
-tab
-target
="#overview" class="active" href
="#overview">Overview
</a
>
10 <a data
-tab
-target
="#Users" href
="#Users">Users
</a
>
11 <a data
-tab
-target
="#Channels" href
="#Channels">Channels
</a
>
12 <a data
-tab
-target
="#TKL" href
="#TKL">Server Bans
</a
>
13 <a data
-tab
-target
="#Spamfilter" href
="#Spamfilter">Spamfilter
</a
>
17 * Provide a admin area view for the plugin
19 * This file is used to markup the admin-facing aspects of the plugin.
21 * @link https://https://github.com/ValwareIRC
25 * @subpackage Unrealircd/admin/partials
28 define('UPATH', true);
29 include "Classes/class-rpc.php";
31 if (!empty($_POST['tklch']))
32 foreach ($_POST as $key => $value)
34 foreach ($value as $tok)
36 $tok = explode(",",$tok);
37 rpc_tkl_del(base64_decode($tok[0]), base64_decode($tok[1]));
41 rpc_pop_lists(); // populate our static lists (users, channels, tkl, spamfilter)
44 <div
class="tab-content\">
45 <div id="overview
" data-tab-content class="active
">
46 <table class='unrealircd_overview'>
47 <th>Chat Overview</th><th></th>
48 <tr><td><b>Users</b></td><td><?php echo count(RPC_List::$user); ?></td></tr>
49 <tr><td><b>Opers</b></td><td><?php echo RPC_List::$opercount; ?></td></tr>
50 <tr><td><b>Services</b></td><td><?php echo RPC_List::$services_count; ?></td></tr>
51 <tr><td><b>Most popular channel</b></td><td><?php echo RPC_List::$most_populated_channel; ?> (<?php echo RPC_List::$channel_pop_count; ?> users)</td></tr>
52 <tr><td><b>Channels</b></td><td><?php echo count(RPC_List::$channel); ?></td></tr>
53 <tr><td><b>Server bans</b></td><td><?php echo count(RPC_List::$tkl); ?></td></tr>
54 <tr><td><b>Spamfilter entries</b></td><td><?php echo count(RPC_List::$spamfilter); ?></td></tr></th>
57 <div class="tab
-content\"
>
58 <div id
="Users" data
-tab
-content
>
60 <table
class='users_overview'>
69 <th
>Reputation
<a href
="https://www.unrealircd.org/docs/Reputation_score"></a
>ℹ️
</th
>
72 foreach(RPC_List
::$user as $user)
75 echo "<td>".$user['name']."</td>";
76 echo "<td>".$user['id']."</td>";
77 echo "<td>".$user['hostname']." (".$user['ip'].")</td>";
78 $account = (isset($user['user']['account'])) ? $user['user']['account'] : "";
79 echo "<td>".$account."</td>";
80 $modes = (isset($user['user']['modes'])) ? "+" . $user['user']['modes'] : "<none>";
81 echo "<td>".$modes."</td>";
82 $oper = (isset($user['user']['operlogin'])) ? $user['user']['operlogin']." (".$user['user']['operclass'].")" : "";
83 echo "<td>".$oper."</td>";
84 $secure = (isset($user['tls'])) ? "✅" : "❌";
85 echo "<td>".$secure."</td>";
86 echo "<td>".$user['user']['servername']."</td>";
87 echo "<td>".$user['user']['reputation']."</td>";
89 ?></table
></div
></div
>
91 <div
class="tab-content\">
92 <div id="Channels
" data-tab-content>
94 <table class='users_overview'>
103 foreach(RPC_List::$channel as $channel)
106 echo "<td
>".$channel['name']."</td
>";
107 echo "<td
>".$channel['creation_time']."</td
>";
108 echo "<td
>".$channel['num_users']."</td
>";
109 $topic = (isset($channel['topic'])) ? $channel['topic'] : "";
110 echo "<td
>".$topic."</td
>";
111 $setby = (isset($channel['topic'])) ? "By
".$channel['topic_set_by'] .", at
".$channel['topic_set_at'] : "";
112 echo "<td
>".$setby."</td
>";
113 $modes = (isset($channel['modes'])) ? "+
" . $channel['modes'] : "<none
>";
114 echo "<td
>".$modes."</td
>";
116 ?></table></div></div>
119 <div class="tab
-content\"
>
120 <div id
="TKL" data
-tab
-content
>
122 <table
class='users_overview'>
123 <form action
="" method
="post">
124 <th
><input type
="checkbox" label
='selectall' onClick
="toggle(this)" />Select all
</th
>
134 foreach(RPC_List
::$tkl as $tkl)
137 echo "<td><input type=\"checkbox\" value='" . base64_encode($tkl['name']).",".base64_encode($tkl['type']) . "' name=\"tklch[]\"></td>";
138 echo "<td>".$tkl['name']."</td>";
139 echo "<td>".$tkl['type_string']."</td>";
140 echo "<td>".$tkl['set_by']."</td>";
141 echo "<td>".$tkl['set_at_string']."</td>";
142 echo "<td>".$tkl['expire_at_string']."</td>";
143 echo "<td>".$tkl['duration_string']."</td>";
144 echo "<td>".$tkl['reason']."</td>";
146 ?></table
><p
><input
class="cute_button" type
="submit" value
="Delete selected"></p
></form
></div
></div
>
149 <div
class="tab-content\">
150 <div id="Spamfilter
" data-tab-content>
152 <table class='users_overview'>
161 <th>Action Duration</th>
166 foreach(RPC_List::$spamfilter as $sf)
169 echo "<td
>".$sf['name']."</td
>";
170 echo "<td
>".$sf['type_string']."</td
>";
171 echo "<td
>".$sf['set_by']."</td
>";
172 echo "<td
>".$sf['set_at_string']."</td
>";
173 echo "<td
>".$sf['expire_at_string']."</td
>";
174 echo "<td
>".$sf['duration_string']."</td
>";
175 echo "<td
>".$sf['match_type']."</td
>";
176 echo "<td
>".$sf['ban_action']."</td
>";
177 echo "<td
>".$sf['ban_duration_string']."</td
>";
178 for ($i = 0, $targs = ""; ($c = $sf['spamfilter_targets'][$i]); $i++)
181 $targs .= "Channel
, ";
183 $targs .= "Private,";
185 $targs .= "Notice
, ";
187 $targs .= "Channel notice
, ";
189 $targs .= "Part message
, ";
191 $targs .= "Quit message
, ";
193 $targs .= "DCC filename
, ";
195 $targs .= "Away message
, ";
197 $targs .= "Channel topic
, ";
199 $targs .= "MessageTag
, ";
201 $targs .= "Usermask
, ";
203 $targs = rtrim($targs,", ");
205 echo "<td
>".$targs."</td
>";
206 echo "<td
>".$sf['reason']."</td
>";
209 ?></table></div></div>
213 <div class="footer
"><p>Copyright 2022-2023 © <a href="https
://unrealircd.org/">UnrealIRCd</a></p></div>