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