]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - api/server-bans.php
2 define('NO_EVENT_STREAM_HEADER',1);
3 require_once('common_api.php');
9 $tkls = $rpc->serverban()->getAll();
12 foreach($tkls as $tkl)
14 $set_in_config = ((isset($tkl->set_in_config
) && $tkl->set_in_config
) || ($tkl->set_by
== "-config-")) ? true : false;
15 $set_by = $set_in_config ? "<span class=\"badge rounded-pill badge-secondary\">Config</span>" : show_nick_only(htmlspecialchars($tkl->set_by
));
18 $select = "<input type=\"checkbox\" value='" . base64_encode($tkl->name
).",".base64_encode($tkl->type
) . "' name=\"tklch[]\">";
22 "Mask" => htmlspecialchars($tkl->name
),
23 "Type" => $tkl->type_string
,
24 "Duration" => $tkl->duration_string
,
25 "Reason" => htmlspecialchars($tkl->reason
),
27 "Set On" => $tkl->set_at_string
,
28 "Expires" => $tkl->expire_at_string
,
32 function custom_sort($a,$b)
34 return strcmp(strtoupper($a["Mask"]), strtoupper($b["Mask"]));
37 usort($out, "custom_sort");
39 echo json_encode($out);