]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - api/notification.php
Fix setting zlines on idents, reported by Jellis
[irc/unrealircd/unrealircd-webpanel.git] / api / notification.php
index 42c23fc7b441610f2038ded105b6dbfa469baf71..df1b91c00197ab62d13e25f02b263daf5806485e 100644 (file)
@@ -1,46 +1,8 @@
 <?php
-include "../common.php";
-include "../connection.php";
 
+require_once('common_api.php');
 
-session_start();
-if (!isset($_SESSION['id']))
-    die("Access denied");
+if (!$rpc)
+    die();
 
-// Close the session now, otherwise other pages block
-session_write_close();
-
-// Set a valid header so browsers pick it up correctly.
-//header('Content-type: text/html; charset=utf-8');
-header("Content-type: application/json");
-
-// Explicitly disable caching so Varnish and other upstreams won't cache.
-header("Cache-Control: no-cache, must-revalidate");
-
-// Setting this header instructs Nginx to disable fastcgi_buffering and disable
-// gzip for this request.
-header('X-Accel-Buffering: no');
-
-// No time limit
-set_time_limit(0);
-
-// Send content immediately
-ob_implicit_flush(1);
-
-// Eh.. yeah...
-ob_end_flush();
-
-// If we use fastcgi, then finish the request now (UNTESTED)
-if (function_exists('fastcgi_finish_request'))
-    fastcgi_finish_request();
-
-$sources = ["!debug","all"];
-$rpc->log()->subscribe($sources);
-echo $rpc->error;
-for(;;)
-{
-    $res = $rpc->eventloop();
-    if (!$res)
-        continue;
-    echo json_encode($res)."\n";
-}
+api_log_loop(["!debug", "warn", "error", "link"]);