From 1838b25113422b08c310e25501c925b523cbaf69 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 5 Aug 2018 15:50:07 +0200 Subject: [PATCH] Iframe stash --- .devilbox/www/htdocs/_iframe_mail.php | 157 ++++++++++++++++++++++++++ .devilbox/www/htdocs/mail.php | 86 ++++---------- .devilbox/www/include/lib/Html.php | 16 ++- 3 files changed, 191 insertions(+), 68 deletions(-) create mode 100644 .devilbox/www/htdocs/_iframe_mail.php diff --git a/.devilbox/www/htdocs/_iframe_mail.php b/.devilbox/www/htdocs/_iframe_mail.php new file mode 100644 index 00000000..f06479bc --- /dev/null +++ b/.devilbox/www/htdocs/_iframe_mail.php @@ -0,0 +1,157 @@ + +authPage(); ?> +error('Could not send mail to: '.$mail.' | subject: '.$subj); + } + header('Location: /mail.php'); + exit(); +} + +// +// Includes +// +require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'Mbox.php'; +require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDecode.php'; +require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php'; +require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php'; + +// +// Setup Sort/Order +// + +// Sort/Order settings +$defaultSort = array('sort' => 'date', 'order' => 'DESC'); +$allowedSorts = array('date', 'subject', 'x-original-to', 'from'); +$allowedOrders = array('ASC', 'DESC'); +$GET_sortKeys = array('sort' => 'sort', 'order' => 'order'); + +// Get sort/order +$MySort = new \devilbox\Sort($defaultSort, $allowedSorts, $allowedOrders, $GET_sortKeys); +$sort = $MySort->getSort(); +$order = $MySort->getOrder(); + +// Evaluate Sorters/Orderers +$orderDate = ''; +$orderFrom = ''; +$orderTo = ''; +$orderSubj = ''; + +if ($sort == 'date') { + if ($order == 'ASC') { + $orderDate = ' '; + } else { + $orderDate = ' '; + } +} else if ($sort == 'subject') { + if ($order == 'ASC') { + $orderSubj = ' '; + } else { + $orderSubj = ' '; + } +} else if ($sort == 'x-original-to') { + if ($order == 'ASC') { + $orderTo = ' '; + } else { + $orderTo = ' '; + } +} else if ($sort == 'from') { + if ($order == 'ASC') { + $orderFrom = ' '; + } else { + $orderFrom = ' '; + } +} + + +// +// Mbox Reader +// +$MyMbox = new \devilbox\Mail('/var/mail/devilbox'); + +// If default sort is on, use NULL, so we do not have to sort the mails after retrieval, +// because they are being read in the default sort/order anyway +$sortOrderArr = $MySort->isDefault($sort, $order) ? null : array($sort => $order); +$messages = $MyMbox->get($sortOrderArr); + +?> + + + + getHead(true); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Date From To Subject
+ headers['date']));?>
+ headers['date']));?> +
headers['from']);?>headers['x-original-to']);?>headers['subject']);?>
+ + getFooterScripts(); ?> + + + diff --git a/.devilbox/www/htdocs/mail.php b/.devilbox/www/htdocs/mail.php index 46bcdbd3..599d61b5 100644 --- a/.devilbox/www/htdocs/mail.php +++ b/.devilbox/www/htdocs/mail.php @@ -140,80 +140,40 @@ $messages = $MyMbox->get($sortOrderArr); - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Date From To Subject
- headers['date']));?>
- headers['date']));?> -
headers['from']);?>headers['x-original-to']);?>headers['subject']);?>
-
-
+ - getFooter(); ?> diff --git a/.devilbox/www/include/lib/Html.php b/.devilbox/www/include/lib/Html.php index 0a5a8661..97185a28 100644 --- a/.devilbox/www/include/lib/Html.php +++ b/.devilbox/www/include/lib/Html.php @@ -218,6 +218,16 @@ HTML; + public function getFooterScripts() + { + $html = << + + +HTML; + return $html; + } + public function getFooter() { $render_time = round((microtime(true) - $GLOBALS['TIME_START']), 2); @@ -234,12 +244,8 @@ HTML; - - - - HTML; - return $html; + return $html . $this->getFooterScripts(); }