X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/8cb18100cbd00c2a8bf77302b4393d6675f7be44..b95d1cdbc4fe25e3f0df3b94e990f6af7b330c63:/index.php diff --git a/index.php b/index.php index 9bbd08d..47c88ba 100644 --- a/index.php +++ b/index.php @@ -1,101 +1,101 @@ root . 'lib/db_factory.php'; - require_once $CFG->root . 'lib/utils.inc.php'; + 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; - } + $util = Utils::getInstance(); + unset($_SESSION['mailInfo']); - $pageNum = 1; - if (isset($_GET['page'])) { - $pageNum = $_GET['page']; - } + if ($util->isLoggedIn()) { + if (isset($_GET['rowsperpage'])) { + $rowsPerPage = $_GET['rowsperpage']; + } else { + $rowsPerPage = 20; + } - $offset = ($pageNum - 1) * $rowsPerPage; + $pageNum = 1; + if (isset($_GET['page'])) { + $pageNum = $_GET['page']; + } - $util->setHeading('Quarantine Administration'); - echo $util->getHeader(); - echo $util->getHeading(); + $offset = ($pageNum - 1) * $rowsPerPage; - echo "{$util->getUser()} - Logout"; - $which = ($util->isAdmin() == true) ? 'all' : $util->getUser(); - $rows = $DB->getQMails($offset, $rowsPerPage, $which); - $numrows = $DB->numRows(); - echo "$numrows quarantined mail(s)"; - echo ""; + $util->setHeading('Quarantine Administration'); + echo $util->getHeader(); + echo $util->getHeading(); + + echo "{$util->getUser()} + Logout"; + $which = ($util->isAdmin() == true) ? 'all' : $util->getUser(); + $rows = $DB->getQMails($offset, $rowsPerPage, $which); + $numrows = $DB->numRows(); + echo "$numrows quarantined mail(s)"; + echo "
"; echo "
"; echo ""; - echo ""; + echo ""; - $mailInfo = array(); - $i = 0; - foreach ($rows as $row) { - if ($i % 2) - echo ''; - else - echo ''; - $id = $row->mail_id; - $mailInfo[$id] = serialize($row); - $url = urlencode($id); - $recipient = "{$row->recipient}"; - $action = ""; - $action .= "\"Release\""; - $action .= " "; - $action .= "\"Delete\""; - $sender = $row->sender; - $received = strftime("%c", $row->time_iso); - $quaratinefor = $util->convertContent($row->quaratinefor); - $subject = $row->subject; + $mailInfo = array(); + $i = 0; + foreach ($rows as $row) { + if ($i % 2) + echo ''; + else + echo ''; + $id = $row->mail_id; + $mailInfo[$id] = serialize($row); + $url = urlencode($id); + $recipient = "{$row->recipient}"; + $action = ""; + $action .= "\"Release\""; + $action .= " "; + $action .= "\"Delete\""; + $sender = $row->sender; + $received = strftime("%c", $row->time_iso); + $quaratinefor = $util->convertContent($row->quaratinefor); + $subject = $row->subject; echo "". ""; - $i++; - } - $_SESSION['mailInfo'] = $mailInfo; - echo "
ReceivedCauseSenderRecipientSubjectAction
$received". "$quaratinefor$sender$recipient$subject$action
"; + $i++; + } + $_SESSION['mailInfo'] = $mailInfo; + echo ""; + + $maxPage = ceil($numrows/$rowsPerPage); + $self = $_SERVER['PHP_SELF']; + + if ($pageNum > 1) { + $page = $pageNum - 1; + $prev = " [Prev]"; + $first = " [First Page] "; + } else { + $prev = ' '; // we're on page one, don't print previous link + $first = ' '; // nor the first page link + } - $maxPage = ceil($numrows/$rowsPerPage); - $self = $_SERVER['PHP_SELF']; - - if ($pageNum > 1) { - $page = $pageNum - 1; - $prev = " [Prev]"; - $first = " [First Page] "; - } else { - $prev = ' '; // we're on page one, don't print previous link - $first = ' '; // nor the first page link - } - - if ($pageNum < $maxPage) { - $page = $pageNum + 1; - $next = " [Next]"; - $last = "[Last Page] "; - } else { - $next = ' '; // we're on the last page, don't print next link - $last = ' '; // nor the last page link - } - $marked = $DB->getMarked($which); - $_SESSION['marked'] = serialize($marked); - echo ''; - echo "

$first$prev Showing page $pageNum of - $maxPage pages $next$last

"; + if ($pageNum < $maxPage) { + $page = $pageNum + 1; + $next = " [Next]"; + $last = "[Last Page] "; + } else { + $next = ' '; // we're on the last page, don't print next link + $last = ' '; // nor the last page link + } + $marked = $DB->getMarked($which); + $_SESSION['marked'] = serialize($marked); + echo ''; + echo "

$first$prev Showing page $pageNum of + $maxPage pages $next$last

"; - echo $util->getFooter(); - } else { - header('Location: auth.php'); - } + echo $util->getFooter(); + } else { + header('Location: auth.php'); + } ?>