]>
git.datanom.net - qtadmin.git/blob - wblist.php
2 /* vim: set ts=4 tw=0 sw=4 noet: */
3 require_once 'config.php';
4 require_once $CFG->root
. 'lib/utils.inc.php';
6 function createHeader($data) {
8 foreach ($data as $head => $value) {
9 $out .= "<th>$head</th>";
15 function parseResponse($raw) {
16 if (count($raw) < 1) {
19 $headers = createHeader($raw[0]);
20 $r = "<table><tr>$headers</tr>";
21 foreach ($raw as $obj) {
23 foreach ($obj as $value) {
24 $r .= "<td>$value</td>";
35 if ($util->isLoggedIn()) {
36 $function = isset($_GET['p']) ?
$_GET['p'] : null;
37 $subfunction = isset($_GET['s']) ?
$_GET['s'] : null;
38 if (($function && $function == 'show' && !$subfunction) ||
39 ($function && $function == 'add' && $subfunction) ||
40 ($function && $function == 'del' && $subfunction)) {
41 header('Location: index.php');
42 } else if($function == 'show') {
43 if ($subfunction == 'all') {
44 $list = $util->makeRestCall('/show');
46 $out = parseResponse($list);
48 $out = '<p>Connection to REST service failed</p>';
50 } else if ($subfunction == 'blacklist') {
51 } else if ($subfunction == 'whitelist') {
53 header('Location: index.php');
55 } else if($function == 'add') {
56 } else if($function == 'del') {
58 header('Location: index.php');
60 $util->setHeading('WB List and Quarantine Administration');
61 echo $util->getHeader();
62 echo $util->getHeading();
64 echo $util->getFooter();
66 header('Location: auth.php');
This page took 0.19452 seconds and 6 git commands to generate.