]> git.datanom.net - qtadmin.git/commitdiff
rename file
authorMichael Rasmussen <mir@datanom.net>
Wed, 24 Jun 2015 18:19:01 +0000 (20:19 +0200)
committerMichael Rasmussen <mir@datanom.net>
Wed, 24 Jun 2015 18:19:01 +0000 (20:19 +0200)
index.php [deleted file]
qtadmin.php [new file with mode: 0644]

diff --git a/index.php b/index.php
deleted file mode 100644 (file)
index ec831b0..0000000
--- a/index.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/* vim: set ts=4 tw=0 sw=4 noet: */
-    require_once 'config.php';
-    require_once $CFG->root . 'lib/db_factory.php';
-    require_once $CFG->root . 'lib/utils.inc.php';
-
-    $util = new Utils;
-    unset($_SESSION['mailInfo']);
-
-    if ($util->isLoggedIn()) {
-        if (isset($_GET['rowsperpage'])) {
-            $rowsPerPage = $_GET['rowsperpage'];
-        } else {
-            $rowsPerPage = 20;
-        }
-
-        $pageNum = 1;
-        if (isset($_GET['page'])) {
-            $pageNum = $_GET['page'];
-        }
-
-        $offset = ($pageNum - 1) * $rowsPerPage;
-
-        $util->setHeading('Quarantine Administration');
-        echo $util->getHeader();
-        echo $util->getHeading();
-
-        echo "Rows per page <input type=\"text\" value=\"$rowsPerPage\" id=\"rows\"
-              size=\"2\"/><input type=\"button\" onclick=\"javascript: updateRowsPerPage()\"
-              value=\"Change\"/><span class=\"user\">{$util->getUser()}
-              <a title=\"Logout\" href=\"auth.php?op=logout\">Logout</a></span>";
-        $which = ($util->isAdmin() == true) ? 'all' : $util->getUser();
-        $rows = $DB->getQMails($offset, $rowsPerPage, $which);
-        $numrows = $DB->numRows();
-        echo "<span class=\"total-rows\">$numrows quarantined mail(s)</span>";
-        echo "<table><tr>";
-        echo "<th>Received</th><th>Cause</th>";
-        echo "<th>Sender</th><th>Recipient</th><th>Subject</th><th>Action</th>";
-        echo "<th><input name=\"multiselect\" type=\"checkbox\" ";
-        echo "onchange=\"javascript: updateAction(this)\" /></th>";
-        echo "</tr>";
-
-        $mailInfo = array();
-        $i = 0;
-        foreach ($rows as $row) {
-            if ($i % 2)
-                echo '<tr class="bg_odd">';
-            else
-                echo '<tr class="bg_even">';
-            $id = $row->mail_id;
-            $mailInfo[$id] = serialize($row);
-            $url = urlencode($id);
-            $checkbox = "<input name=\"action\" type=\"checkbox\" value=\"$url\" />";
-            $recipient = "<a title=\"Show Report\" href=\"mail_report.php?id=$url\">{$row->recipient}</a>";
-            $action = "<a title=\"Release Mail\" href=\"quarantine.php?id=$url&amp;op=release\">";
-            $action .= "<img class=\"nav-img\" src=\"pics/release.png\" alt=\"Release\" /></a>";
-            $action .= "&nbsp;<a title=\"Delete Mail\" href=\"quarantine.php?id=$url&amp;op=delete\">";
-            $action .= "<img class=\"nav-img\" src=\"pics/delete.png\" alt=\"Delete\" /></a>";
-            $action .= "&nbsp;<a title=\"Block Sender\" href=\"quarantine.php?id=$url&amp;op=block\">";
-            $action .= "<img class=\"nav-img\" src=\"pics/spam.png\" alt=\"Block Sender\" /></a>";
-            $sender = $row->sender;
-            $received = strftime("%c", $row->time_iso);
-            $quaratinefor = $util->convertContent($row->quaratinefor);
-            $subject = $row->subject;
-            echo "<td>$received</td><td class=\"nav-action\">".
-                "$quaratinefor</td><td>$sender</td><td>$recipient</td>".
-                "<td>$subject</td><td class=\"nav-action\">$action</td><td class=\"nav-action\">$checkbox</td></tr>";
-            $i++;
-        }
-        $_SESSION['mailInfo'] = $mailInfo;
-        echo "</table>";
-
-        $maxPage = ceil($numrows/$rowsPerPage);
-        $self = $_SERVER['PHP_SELF'];
-
-        if ($pageNum > 1) {
-            $page  = $pageNum - 1;
-            $prev = " <a title=\"Prev Page\" href=\"$self?page=$page&amp;rowsperpage=$rowsPerPage\"
-                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-previous-symbolic.svg\" alt=\"Previous\" /></a> ";
-            $first = " <a title=\"First Page\" href=\"$self?page=1&amp;rowsperpage=$rowsPerPage\"
-                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-first-symbolic.svg\" alt=\"First\" /></a> ";
-        } else {
-            $prev  = '&nbsp;'; // we're on page one, don't print previous link
-            $first = '&nbsp;'; // nor the first page link
-        }
-
-        if ($pageNum < $maxPage) {
-            $page = $pageNum + 1;
-            $next = " <a title=\"Next Page\" href=\"$self?page=$page&amp;rowsperpage=$rowsPerPage\"
-                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-next-symbolic.svg\" alt=\"Next\" /></a> ";
-            $last = " <a title=\"Last Page\" href=\"$self?page=$maxPage&amp;rowsperpage=$rowsPerPage\"
-                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-last-symbolic.svg\" alt=\"Last\" /></a> ";
-        } else {
-            $next = '&nbsp;'; // we're on the last page, don't print next link
-            $last = '&nbsp;'; // nor the last page link
-        }
-        $marked = $DB->getMarked($which);
-        $_SESSION['marked'] = serialize($marked);
-        echo '<input class="mail-purge" type="button" value="Purge Mails ('.
-              count($marked).')" onclick="javascript: location.href=\'quarantine.php?op=purge\'"/>';
-        echo '<input class="mail-purge" type="button" value="Release checked"
-              onclick="javascript: checkAction(\'release\');"/>';
-        echo '<input class="mail-purge" type="button" value="Delete checked"
-              onclick="javascript: checkAction(\'delete\');"/>';
-        echo '<input class="mail-purge" type="button" value="Block checked"
-              onclick="javascript: checkAction(\'block\');"/>';
-        echo "<p class=\"page-nav\">$first$prev Showing page $pageNum of
-              $maxPage pages $next$last</p>";
-
-        echo $util->getFooter();
-    } else {
-        header('Location: auth.php');
-    }
-?>
diff --git a/qtadmin.php b/qtadmin.php
new file mode 100644 (file)
index 0000000..ec831b0
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/* vim: set ts=4 tw=0 sw=4 noet: */
+    require_once 'config.php';
+    require_once $CFG->root . 'lib/db_factory.php';
+    require_once $CFG->root . 'lib/utils.inc.php';
+
+    $util = new Utils;
+    unset($_SESSION['mailInfo']);
+
+    if ($util->isLoggedIn()) {
+        if (isset($_GET['rowsperpage'])) {
+            $rowsPerPage = $_GET['rowsperpage'];
+        } else {
+            $rowsPerPage = 20;
+        }
+
+        $pageNum = 1;
+        if (isset($_GET['page'])) {
+            $pageNum = $_GET['page'];
+        }
+
+        $offset = ($pageNum - 1) * $rowsPerPage;
+
+        $util->setHeading('Quarantine Administration');
+        echo $util->getHeader();
+        echo $util->getHeading();
+
+        echo "Rows per page <input type=\"text\" value=\"$rowsPerPage\" id=\"rows\"
+              size=\"2\"/><input type=\"button\" onclick=\"javascript: updateRowsPerPage()\"
+              value=\"Change\"/><span class=\"user\">{$util->getUser()}
+              <a title=\"Logout\" href=\"auth.php?op=logout\">Logout</a></span>";
+        $which = ($util->isAdmin() == true) ? 'all' : $util->getUser();
+        $rows = $DB->getQMails($offset, $rowsPerPage, $which);
+        $numrows = $DB->numRows();
+        echo "<span class=\"total-rows\">$numrows quarantined mail(s)</span>";
+        echo "<table><tr>";
+        echo "<th>Received</th><th>Cause</th>";
+        echo "<th>Sender</th><th>Recipient</th><th>Subject</th><th>Action</th>";
+        echo "<th><input name=\"multiselect\" type=\"checkbox\" ";
+        echo "onchange=\"javascript: updateAction(this)\" /></th>";
+        echo "</tr>";
+
+        $mailInfo = array();
+        $i = 0;
+        foreach ($rows as $row) {
+            if ($i % 2)
+                echo '<tr class="bg_odd">';
+            else
+                echo '<tr class="bg_even">';
+            $id = $row->mail_id;
+            $mailInfo[$id] = serialize($row);
+            $url = urlencode($id);
+            $checkbox = "<input name=\"action\" type=\"checkbox\" value=\"$url\" />";
+            $recipient = "<a title=\"Show Report\" href=\"mail_report.php?id=$url\">{$row->recipient}</a>";
+            $action = "<a title=\"Release Mail\" href=\"quarantine.php?id=$url&amp;op=release\">";
+            $action .= "<img class=\"nav-img\" src=\"pics/release.png\" alt=\"Release\" /></a>";
+            $action .= "&nbsp;<a title=\"Delete Mail\" href=\"quarantine.php?id=$url&amp;op=delete\">";
+            $action .= "<img class=\"nav-img\" src=\"pics/delete.png\" alt=\"Delete\" /></a>";
+            $action .= "&nbsp;<a title=\"Block Sender\" href=\"quarantine.php?id=$url&amp;op=block\">";
+            $action .= "<img class=\"nav-img\" src=\"pics/spam.png\" alt=\"Block Sender\" /></a>";
+            $sender = $row->sender;
+            $received = strftime("%c", $row->time_iso);
+            $quaratinefor = $util->convertContent($row->quaratinefor);
+            $subject = $row->subject;
+            echo "<td>$received</td><td class=\"nav-action\">".
+                "$quaratinefor</td><td>$sender</td><td>$recipient</td>".
+                "<td>$subject</td><td class=\"nav-action\">$action</td><td class=\"nav-action\">$checkbox</td></tr>";
+            $i++;
+        }
+        $_SESSION['mailInfo'] = $mailInfo;
+        echo "</table>";
+
+        $maxPage = ceil($numrows/$rowsPerPage);
+        $self = $_SERVER['PHP_SELF'];
+
+        if ($pageNum > 1) {
+            $page  = $pageNum - 1;
+            $prev = " <a title=\"Prev Page\" href=\"$self?page=$page&amp;rowsperpage=$rowsPerPage\"
+                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-previous-symbolic.svg\" alt=\"Previous\" /></a> ";
+            $first = " <a title=\"First Page\" href=\"$self?page=1&amp;rowsperpage=$rowsPerPage\"
+                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-first-symbolic.svg\" alt=\"First\" /></a> ";
+        } else {
+            $prev  = '&nbsp;'; // we're on page one, don't print previous link
+            $first = '&nbsp;'; // nor the first page link
+        }
+
+        if ($pageNum < $maxPage) {
+            $page = $pageNum + 1;
+            $next = " <a title=\"Next Page\" href=\"$self?page=$page&amp;rowsperpage=$rowsPerPage\"
+                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-next-symbolic.svg\" alt=\"Next\" /></a> ";
+            $last = " <a title=\"Last Page\" href=\"$self?page=$maxPage&amp;rowsperpage=$rowsPerPage\"
+                class='whitefooter'><img class=\"nav-img\" src=\"pics/go-last-symbolic.svg\" alt=\"Last\" /></a> ";
+        } else {
+            $next = '&nbsp;'; // we're on the last page, don't print next link
+            $last = '&nbsp;'; // nor the last page link
+        }
+        $marked = $DB->getMarked($which);
+        $_SESSION['marked'] = serialize($marked);
+        echo '<input class="mail-purge" type="button" value="Purge Mails ('.
+              count($marked).')" onclick="javascript: location.href=\'quarantine.php?op=purge\'"/>';
+        echo '<input class="mail-purge" type="button" value="Release checked"
+              onclick="javascript: checkAction(\'release\');"/>';
+        echo '<input class="mail-purge" type="button" value="Delete checked"
+              onclick="javascript: checkAction(\'delete\');"/>';
+        echo '<input class="mail-purge" type="button" value="Block checked"
+              onclick="javascript: checkAction(\'block\');"/>';
+        echo "<p class=\"page-nav\">$first$prev Showing page $pageNum of
+              $maxPage pages $next$last</p>";
+
+        echo $util->getFooter();
+    } else {
+        header('Location: auth.php');
+    }
+?>
This page took 0.043817 seconds and 5 git commands to generate.