]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - misc/user-lookup-misc.php
Users: get rid of "user modes" column. Similar to previous, at least for now.
[irc/unrealircd/unrealircd-webpanel.git] / misc / user-lookup-misc.php
CommitLineData
62d4ea03
VP
1<?php
2
3function generate_html_whois($user)
4{
10102cdc 5 global $rpc;
62d4ea03
VP
6 ?>
7
66f46138 8 <table class="table-sm table-responsive caption-top table-hover">
62d4ea03
VP
9 <tbody>
10 <tr>
11 <th>Nick</th>
11b7f7e4 12 <td colspan="2"><code><?php echo htmlspecialchars($user->name); ?></code></td>
62d4ea03 13 </tr><tr>
ab23a935 14 <th>User ID (UID)</th>
11b7f7e4 15 <td colspan="2"><code><?php echo htmlspecialchars($user->id); ?></code></td>
62d4ea03
VP
16 </tr><tr>
17 <th>Real Host</th>
11b7f7e4 18 <td colspan="2"><code><?php echo htmlspecialchars($user->hostname); ?></code></td>
62d4ea03
VP
19 </tr><tr>
20 <th>IP</th>
26103173
VP
21 <td colspan="2"><code><?php echo htmlspecialchars($user->ip); ?></code>
22 <?php
62d4ea03
VP
23 if ($cc = (isset($user->geoip->country_code)) ? strtolower($user->geoip->country_code) : "")
24 {
11b7f7e4 25 ?> <img src="https://flagcdn.com/48x36/<?php echo htmlspecialchars($cc); ?>.png"
62d4ea03
VP
26 width="20"
27 height="15">
28 <?php } ?>
ea90b321 29 <a href="<?php echo htmlspecialchars(get_config("base_url")."tools/ip-whois.php?ip=$user->ip"); ?>"><button class="btn-sm btn-primary">WHOIS IP</button></a>
62d4ea03
VP
30 </td>
31 </tr><tr>
32 <th>Ident</th>
11b7f7e4 33 <td colspan="2"><code><?php echo htmlspecialchars($user->user->username); ?></code></td>
62d4ea03
VP
34 </tr><tr>
35 <th>GECOS / Real Name</th>
11b7f7e4 36 <td colspan="2"><code><?php echo htmlspecialchars($user->user->realname); ?></code></td>
62d4ea03
VP
37 </tr><tr>
38 <th>Virtual Host</th>
11b7f7e4 39 <td colspan="2"><code><?php echo (isset($user->user->vhost)) ? htmlspecialchars($user->user->vhost) : ""; ?></code></td>
62d4ea03
VP
40 </tr><tr>
41 <th>Connected to</th>
10102cdc
VP
42 <?php $serverlkup = $rpc->server()->get($user->user->servername); ?>
43
ea90b321 44 <td colspan="2"><a href="<?php echo get_config("base_url")."servers/details.php?server=$serverlkup->id"; ?>"><code><?php echo htmlspecialchars($user->user->servername); ?></code></td>
9ffc5134 45
62d4ea03
VP
46 </tr>
47 <tr>
48 <th>Logged in as</th>
ea90b321 49 <td colspan="2"><code><?php echo (isset($user->user->account)) ? "<a href=\"".get_config("base_url")."users/?account=".htmlspecialchars($user->user->account)."\">".htmlspecialchars($user->user->account)."</a>" : ""; ?></code></td>
62d4ea03
VP
50 </tr>
51
52
53 </tbody>
54 </table>
55
56 <?php
57}
58function generate_html_usersettings($user)
59{
60 ?>
61
66f46138 62 <table class="table-sm table-responsive caption-top table-hover">
62d4ea03
VP
63 <tbody>
64 <?php
65 for ($i=0; ($mode = (isset($user->user->modes[$i])) ? $user->user->modes[$i] : NULL); $i++)
66 {
67
68 if ($mode == "o")
69 {
70 ?>
71 <tr>
72 <th>Oper</th>
9ffc5134 73 <td>
66f46138 74 <table class="table-sm table-responsive caption-top table-hover">
62d4ea03
VP
75 <tr>
76 <td>Oper Login</td>
c68cfb17
VP
77 <td><code><?php
78 $operlogin = (isset($user->user->operlogin)) ? $user->user->operlogin : "";
79 echo htmlspecialchars($operlogin);
80 ?></code></td>
62d4ea03
VP
81 </tr>
82 <tr>
83 <td>Oper Class</td>
11b7f7e4 84 <td><?php echo (isset($user->user->operclass)) ? "<span class=\"rounded-pill badge badge-info\">".htmlspecialchars($user->user->operclass)."</span>" : "<span class=\"rounded-pill badge badge-info\">None</span>"; ?></td>
62d4ea03
VP
85 </tr>
86 </table>
87 </td>
88 </tr>
89 <?php
90 }
91 elseif ($mode == "S")
92 {
93 ?>
94 <tr>
95 <th>Service Bot</th>
9ffc5134 96 <td>
62d4ea03
VP
97 This user is a Services Bot.
98 </td>
99 </tr>
100 <?php
101 }
102 elseif ($mode == "d")
103 {
104 ?>
105 <tr>
106 <th>Deaf</th>
9ffc5134 107 <td>User is ignoring channel messages.</td>
62d4ea03
VP
108 </tr>
109 <?php
110 }
111 elseif ($mode == "i")
112 {
113 ?>
114 <tr>
115 <th>Invisible</th>
9ffc5134 116 <td>Not shown in /WHO searches.</td>
62d4ea03
VP
117 </tr>
118 <?php
119 }
120 elseif ($mode == "p")
121 {
122 ?>
123 <tr>
124 <th>Private channels</th>
9ffc5134 125 <td>Channels hidden in /WHOIS outputs.</td>
62d4ea03
VP
126 </tr>
127 <?php
128 }
129 elseif ($mode == "r")
130 {
131 ?>
132 <tr>
133 <th>Registered Nick</th>
9ffc5134 134 <td>This user is using a registered nick.</td>
62d4ea03
VP
135 </tr>
136 <?php
137 }
138 elseif ($mode == "s")
139 {
140 ?>
141 <tr>
142 <th>Server Notices</th>
9ffc5134 143 <td>This user is receiving server notices.</td>
62d4ea03
VP
144 </tr>
145 <?php
146 }
147 elseif ($mode == "t")
148 {
149 ?>
150 <tr>
151 <th>Virtual Host</th>
9ffc5134 152 <td>Using a custom hostmask</td>
62d4ea03
VP
153 </tr>
154 <?php
155 }
156 elseif ($mode == "w")
157 {
158 ?>
159 <tr>
160 <th>Wallops</th>
9ffc5134 161 <td>Listening to <code>/WALLOPS</code> notices from IRC Operators.</td>
62d4ea03
VP
162 </tr>
163 <?php
164 }
165 elseif ($mode == "x")
166 {
167 ?>
168 <tr>
169 <th>Hostmask</th>
9ffc5134 170 <td>Using a hostmask (hiding their IP from non-IRCops).</td>
62d4ea03
VP
171 </tr>
172 <?php
173 }
174 elseif ($mode == "z")
175 {
176 ?>
177 <tr>
178 <th>Secure</th>
9ffc5134 179 <td>
66f46138 180 <table class="table-sm table-responsive caption-top table-hover">
62d4ea03
VP
181 <tr>
182 <td>Cipher</td>
c68cfb17
VP
183 <td><code><?php
184 $cipher = (isset($user->tls->cipher)) ? $user->tls->cipher : "";
185 echo htmlspecialchars($cipher);
186 ?></code></td>
62d4ea03
VP
187 </tr>
188 <tr>
189 <td>Cert Fingerprint</td>
11b7f7e4 190 <td><?php echo (isset($user->tls->certfp)) ? "<code>".htmlspecialchars($user->tls->certfp)."</code>" : "<span class=\"rounded-pill badge badge-info\">None</span>"; ?></td>
62d4ea03
VP
191 </tr>
192 </table>
193 </td>
194 </tr>
195 <?php
196 }
197 elseif ($mode == "B")
198 {
199 ?>
200 <tr>
201 <th>Bot</th>
202 <td colspan="2">
203 User is marked as a Bot.
204 </td>
205 </tr>
206 <?php
207 }
208 elseif ($mode == "D")
209 {
210 ?>
211 <tr>
212 <th>PrivDeaf</th>
213 <td colspan="2">
214 User is rejecting incoming private messages.
215 </td>
216 </tr>
217 <?php
218 }
219 elseif ($mode == "G")
220 {
221 ?>
222 <tr>
223 <th>Filter</th>
224 <td colspan="2">
225 User is filtering Bad Words.
226 </td>
227 </tr>
228 <?php
229 }
230 elseif ($mode == "H")
231 {
232 ?>
233 <tr>
234 <th>Hide IRCop</th>
235 <td colspan="2">
236 User is hiding their IRCop status.
237 </td>
238 </tr>
239 <?php
240 }
241 elseif ($mode == "I")
242 {
243 ?>
244 <tr>
245 <th>Hide Idle</th>
246 <td colspan="2">
247 User is hiding their idle time.
248 </td>
249 </tr>
250 <?php
251 }
252 elseif ($mode == "R")
253 {
254 ?>
255 <tr>
256 <th>RegOnly Messages</th>
257 <td colspan="2">
258 User is only accepting private messages from registered users.
259 </td>
260 </tr>
261 <?php
262 }
263 elseif ($mode == "T")
264 {
265 ?>
266 <tr>
267 <th>Deny CTCPs</th>
268 <td colspan="2">
269 Denying CTCP requests.
270 </td>
271 </tr>
272 <?php
273 }
274 elseif ($mode == "W")
275 {
276 ?>
277 <tr>
278 <th>View /WHOIS</th>
279 <td colspan="2">
280 User is receiving notifications when someone does a <code>/WHOIS</code> on them.
281 </td>
282 </tr>
283 <?php
284 }
285 elseif ($mode == "Z")
286 {
287 ?>
288 <tr>
289 <th>Deny Insecure Messages</th>
290 <td colspan="2">
291 User is only accepting messages from users using a secure connection.
292 </td>
293 </tr>
294 <?php
295 }
296 }
297
298
299 ?>
300 </tbody>
301 </table>
302
7b6e57db
VP
303 <?php
304}
305
306
307function generate_html_userchannels($user)
308{
309 ?>
310
66f46138 311 <table class="table-sm table-responsive caption-top table-hover table-striped">
7b6e57db 312 <thead class="table-info">
03200675 313 <th>
7b6e57db
VP
314 Channel
315 </th>
03200675 316 <th >
7b6e57db
VP
317 Status
318 </th>
319 </thead>
320 <tbody>
321 <?php
322 foreach($user->user->channels as $chan)
323 {
324 ?>
325 <tr>
ea90b321 326 <td><?php echo "<a href=\"".get_config("base_url")."channels/details.php?chan=".urlencode($chan->name)."\">$chan->name</a>"; ?></td>
03200675 327 <td>
7b6e57db
VP
328
329 <?php
330 for ($i = 0; isset($chan->level[$i]); $i++)
331 {
332 ?><div class="text-nowrap row mb-1"><?php
333 if ($chan->level[$i] == "v")
334 {
335 ?><span class="rounded-pill badge badge-info" value="Voice">Voice</span><?php
336 }
337 if ($chan->level[$i] == "h")
338 {
339 ?><span class="rounded-pill badge badge-info">Half-Op</span><?php
340 }
341 if ($chan->level[$i] == "o")
342 {
343 ?><h6><span class="rounded-pill badge badge-info">Operator</span></h6><?php
344 }
345 if ($chan->level[$i] == "a")
346 {
347 ?><span class="rounded-pill badge badge-info">Admin</span><?php
348 }
349 if ($chan->level[$i] == "q")
350 {
351 ?><span class="rounded-pill badge badge-info">Owner</span><?php
352 }
353 if ($chan->level[$i] == "Y")
354 {
355 ?><span class="rounded-pill badge badge-info">OJOIN</span><?php
356 }
357 ?></div><?php
358 }
359 ?>
360 </td>
361 </tr>
362 <?php
363 }
364 ?>
365 </tbody>
366 </table>
367
62d4ea03 368 <?php
11b7f7e4 369}