From: Michael Rasmussen Date: Wed, 24 Jun 2015 18:19:01 +0000 (+0200) Subject: rename file X-Git-Url: http://git.datanom.net/qtadmin.git/commitdiff_plain/18aa2a764867bd346e86ad15abd419a9dc2b6ca6 rename file --- diff --git a/index.php b/index.php deleted file mode 100644 index ec831b0..0000000 --- a/index.php +++ /dev/null @@ -1,114 +0,0 @@ -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 {$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); - $checkbox = ""; - $recipient = "{$row->recipient}"; - $action = ""; - $action .= "\"Release\""; - $action .= " "; - $action .= "\"Delete\""; - $action .= " "; - $action .= "\"Block"; - $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$checkbox
"; - - $maxPage = ceil($numrows/$rowsPerPage); - $self = $_SERVER['PHP_SELF']; - - if ($pageNum > 1) { - $page = $pageNum - 1; - $prev = " \"Previous\" "; - $first = " \"First\" "; - } 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\" "; - } 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 ''; - echo ''; - echo ''; - echo "

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

"; - - echo $util->getFooter(); - } else { - header('Location: auth.php'); - } -?> diff --git a/qtadmin.php b/qtadmin.php new file mode 100644 index 0000000..ec831b0 --- /dev/null +++ b/qtadmin.php @@ -0,0 +1,114 @@ +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 {$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); + $checkbox = ""; + $recipient = "{$row->recipient}"; + $action = ""; + $action .= "\"Release\""; + $action .= " "; + $action .= "\"Delete\""; + $action .= " "; + $action .= "\"Block"; + $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$checkbox
"; + + $maxPage = ceil($numrows/$rowsPerPage); + $self = $_SERVER['PHP_SELF']; + + if ($pageNum > 1) { + $page = $pageNum - 1; + $prev = " \"Previous\" "; + $first = " \"First\" "; + } 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\" "; + } 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 ''; + echo ''; + echo ''; + echo "

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

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