]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - api/log.php
Logs: don't show join/part/kick in live view by default.
[irc/unrealircd/unrealircd-webpanel.git] / api / log.php
1 <?php
2
3 require_once('common_api.php');
4
5 if (!$rpc)
6 die();
7
8 /* Filter - almost everything... */
9 $log_list = ["all", "!debug"];
10 /* Add these as well, they are not logged by default
11 * in the memory log either. See
12 * https://github.com/unrealircd/unrealircd/commit/45342c2d33968178cd07a12cd6fdc4e65b604134
13 * Added here separately because we may want to make
14 * this an option...
15 */
16 array_push($log_list,
17 "!join.LOCAL_CLIENT_JOIN",
18 "!join.REMOTE_CLIENT_JOIN",
19 "!part.LOCAL_CLIENT_PART",
20 "!part.REMOTE_CLIENT_PART",
21 "!kick.LOCAL_CLIENT_KICK",
22 "!kick.REMOTE_CLIENT_KICK",
23 );
24
25 $response = $rpc->log()->getAll();
26 if ($response !== false)
27 {
28 /* Only supported in later UnrealIRCd versions */
29 $cnt = 0;
30 foreach($response as $r)
31 {
32 $r = (ARRAY)$r;
33 $cnt++;
34 if (($cnt % 100) != 0)
35 $r["sync_option"] = "no_sync";
36 send_sse($r);
37 }
38 }
39
40 $r = ["sync_option"=>"sync_now"];
41 send_sse($r);
42
43 api_log_loop($log_list);