]>
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>";
22 foreach ($raw as $obj) {
23 $r .= "<tr><td>$i</td>";
24 foreach ($obj as $value) {
25 $r .= "<td>$value</td>";
37 if ($util->isLoggedIn()) {
38 $function = isset($_GET['p']) ?
$_GET['p'] : null;
39 $subfunction = isset($_GET['s']) ?
$_GET['s'] : null;
40 if (($function && $function == 'show' && !$subfunction) ||
41 ($function && $function == 'add' && $subfunction) ||
42 ($function && $function == 'del' && $subfunction)) {
43 header('Location: index.php');
44 } else if($function == 'show') {
45 if ($subfunction == 'all') {
46 $list = $util->makeRestCall('/show');
48 $out = parseResponse($list);
50 $out = '<p>Connection to REST service failed</p>';
52 } else if ($subfunction == 'blacklist') {
53 } else if ($subfunction == 'whitelist') {
55 header('Location: index.php');
57 } else if($function == 'add') {
58 } else if($function == 'del') {
60 header('Location: index.php');
62 $util->setHeading('WB List and Quarantine Administration');
63 echo $util->getHeader();
64 echo $util->getHeading();
66 echo $util->getFooter();
68 header('Location: auth.php');
This page took 0.107467 seconds and 6 git commands to generate.