]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - servers/index.php
"Network" -> "Servers"
[irc/unrealircd/unrealircd-webpanel.git] / servers / index.php
1 <?php
2 require_once "../common.php";
3 require_once UPATH . "/header.php";
4
5 if (!empty($_POST)) {
6 do_log($_POST);
7 }
8
9 /* Get the server list */
10 $servers = $rpc->server()->getAll();
11 ?>
12 <h4>Servers Overview</h4>
13
14 Click on a server name to view more information.
15
16 <div id="Servers">
17
18 <?php
19 if (isset($_POST['sf_name']) && strlen($_POST['sf_name']))
20 Message::Info("Listing servers which match name: \"" . $_POST['sf_name'] . "\"");
21
22 ?>
23 <table class="container-xxl table table-responsive caption-top table-striped">
24 <thead>
25 <th scope="col"><h5>Filter:</h5></th>
26 <form action="" method="post">
27 <th scope="col" colspan="2">Name<input name="sf_name" type="text" class="form-control short-form-control">
28 <th scope="col"> <input class="btn btn-primary" type="submit" value="Search"></th></form>
29 </thead></table>
30
31 <table class="container-xxl table table-responsive caption-top table-striped">
32 <thead class="table-primary">
33 <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_server(this)" /></th>
34 <th scope="col">Name</th>
35 <th scope="col">Host / IP</th>
36 <th scope="col"><span data-toggle="tooltip" data-placement="bottom" title="This shows [Secure] if the server is using SSL/TLS or is on localhost." style="border-bottom: 1px dotted #000000">Secure</span></th>
37 <th scope="col">Connected to</th>
38 </thead>
39
40 <tbody>
41 <form method="post">
42 <?php
43
44 foreach($servers as $server)
45 {
46
47
48 /* Some basic filtering for NAME */
49 if (isset($_POST['sf_name']) && strlen($_POST['sf_name']) &&
50 strpos(strtolower($server->name), strtolower($_POST['sf_name'])) !== 0 &&
51 strpos(strtolower($server->name), strtolower($_POST['sf_name'])) == false)
52 continue;
53
54
55 echo "<tr>";
56 echo "<th scope=\"row\"><input type=\"checkbox\" value='" . base64_encode($server->id)."' name=\"serverch[]\"></th>";
57 $isBot = (strpos($server->server->modes, "B") !== false) ? ' <span class="badge-pill badge-dark">Bot</span>' : "";
58 echo "<td><a href=\"details.php?nick=".$server->id."\">$server->name$isBot</a></td>";
59 echo "<td>".$server->hostname." (".$server->ip.")</td>";
60 $secure = (isset($server->tls)) ? "<span class=\"badge-pill badge-success\">Secure</span>" : "<span class=\"badge-pill badge-danger\">Insecure</span>";
61 if (strpos($server->server->modes, "S") !== false)
62 $secure = "";
63 echo "<td>".$secure."</td>";
64 echo "<td>".$server->server->uplink."</td>";
65 }
66 ?>
67 </tbody></table>
68 </div>
69
70 <?php require_once UPATH.'/footer.php'; ?>