]> git.datanom.net - qtadmin.git/blobdiff - index.php
Due to new index page
[qtadmin.git] / index.php
index 9bbd08dc42f2c5b4b65344b60b92252c8e790cbf..0566cce2fc4805b4a29380ab19100f94b7686db7 100644 (file)
--- a/index.php
+++ b/index.php
 <?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 = Utils::getInstance();
-       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 "<span class=\"user\">{$util->getUser()} 
-                       <a 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 "<table><tr><th>Received</th><th>Cause</th>";
-        echo "<th>Sender</th><th>Recipient</th><th>Subject</th><th>Action</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);
-                       $recipient = "<a href=\"mail_report.php?id=$url\">{$row->recipient}</a>";
-                       $action = "<a href=\"quarantine.php?id=$url&op=release\">";
-                       $action .= "<img class=\"nav-img\" src=\"pics/release.png\" alt=\"Release\" /></a>";
-                       $action .= "&nbsp;<a href=\"quarantine.php?id=$url&op=delete\">";
-                       $action .= "<img class=\"nav-img\" src=\"pics/delete.png\" alt=\"Delete\" /></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></tr>";
-                       $i++;
-               }
-               $_SESSION['mailInfo'] = $mailInfo;
-               echo "</table>";
-
-               $maxPage = ceil($numrows/$rowsPerPage);
-               $self = $_SERVER['PHP_SELF'];
-               
-               if ($pageNum > 1) {
-                       $page  = $pageNum - 1;
-                       $prev = " <a href=\"$self?page=$page&rowsperpage=$rowsPerPage\" 
-                               class='whitefooter'>[Prev]</a>";
-                       $first = " <a href=\"$self?page=1&rowsperpage=$rowsPerPage\" 
-                               class='whitefooter'>[First Page]</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 href=\"$self?page=$page&rowsperpage=$rowsPerPage\" 
-                               class='whitefooter'>[Next]</a>";
-                       $last = "<a href=\"$self?page=$maxPage&rowsperpage=$rowsPerPage\" 
-                               class='whitefooter'>[Last Page]</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 "<p class=\"page-nav\">$first$prev Showing page $pageNum of 
-                         $maxPage pages $next$last</p>";
-
-               echo $util->getFooter();
-       } else {
-               header('Location: auth.php');
-       }
-?>
+    require_once 'config.php';
+    require_once $CFG->root . 'lib/utils.inc.php';
+
+    $util = new Utils;
+
+    if ($util->isLoggedIn()) {
+        $util->setHeading('WB List and Quarantine Administration');
+        echo $util->getHeader();
+        echo $util->getHeading();
+        echo '<p>
+               <a href="qtadmin.php" title="Quarantine Administration">Quarantine Administration</a>
+               </p>';
+        echo $util->getFooter();
+    } else {
+        header('Location: auth.php');
+    }
+?>
\ No newline at end of file
This page took 0.051115 seconds and 5 git commands to generate.