This blob has been accessed 494 times via Git panel.
- <?php
- require_once("core.php");
- if (!isset($_SESSION['logged_uid']) or !isset($_SESSION['logged_lvl']) or !isset($_SESSION['logged_key']) or ($_SESSION['logged_lvl'] != "subscriber")) {
- exit;
- }
- $quota = imap_get_quotaroot($mbox,$folder);
- if (is_array($quota) and ($quota[limit] > 0)) {
- $quota_usage = HumanReadableFileSize($quota[usage] * 1024);
- $quota_limit = HumanReadableFileSize($quota[limit] * 1024);
- $quota_pct = ($quota[usage] / $quota[limit]) * 100;
- $quota_pct = number_format($quota_pct,2);
- if ($quota_pct > 75) {
- $quota_bar_bgcolor = "#ffbbbb";
- $quota_bar_border = "#ff6666";
- $quota_bar_shadow = "0.188rem";
- }
- else {
- $quota_bar_bgcolor = "#cde2a7";
- $quota_bar_border = "#74ae0b";
- $quota_bar_shadow = "0.125rem";
- }
- $quota_bar_max = "100";
- $quota_bar_width = ($quota[usage] / $quota[limit]) * ($quota_bar_max / 100) * 100;
- $quota_bar_width = number_format($quota_bar_width, 0);
- echo "<style>";
- echo "\r\n@-webkit-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
- echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 0.688rem; } }";
- echo "\r\n.bar { height: 0.688rem; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 0.063rem; -webkit-animation-name: quota; -moz-animation-name: quota; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -moz-animation-timing-function: ease; -moz-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 0.063rem #777; }";
- echo "\r\n</style>";
- }
- echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"1\" callpadding=\"2\">";
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"new\" value=\"1\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-new.png\"></td><td>Compose</td></tr>";
- echo "</form>";
- if (!isset($_POST['get']) and !isset($_POST['rep'])) {
- $mbox_prev = $mbox_min - $mbox_ppg;
- if ($mbox_prev >= 0) {
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"mbox_min\" value=\"$mbox_prev\">";
- echo "<input type=\"hidden\" name=\"box\" value=\"$folder\">";
- if (isset($_POST['imap_search_query']) and !empty($_POST['imap_search_query']) and isset($_POST['imap_search_where']) and !empty($_POST['imap_search_where'])) {
- echo "<input type=\"hidden\" name=\"imap_search_query\" value=\"{$_POST['imap_search_query']}\">";
- echo "<input type=\"hidden\" name=\"imap_search_where\" value=\"{$_POST['imap_search_where']}\">";
- }
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-next.png\"></td><td>Prev</td></tr>";
- echo "</form>";
- }
- $mbox_next = $mbox_min + $mbox_ppg;
- if ($mbox_next < $msgCount) {
- if (($msgCount - $mbox_next) < $mbox_ppg) {
- $mbox_ppg = $msgCount - $mbox_next;
- }
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"mbox_min\" value=\"$mbox_next\">";
- echo "<input type=\"hidden\" name=\"box\" value=\"$folder\">";
- if (isset($_POST['imap_search_query']) and !empty($_POST['imap_search_query']) and isset($_POST['imap_search_where']) and !empty($_POST['imap_search_where'])) {
- echo "<input type=\"hidden\" name=\"imap_search_query\" value=\"{$_POST['imap_search_query']}\">";
- echo "<input type=\"hidden\" name=\"imap_search_where\" value=\"{$_POST['imap_search_where']}\">";
- }
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-prev.png\"></td><td>Next</td></tr>";
- echo "</form>";
- }
- }
- if (($folder == "Trash") or ($folder == "Spam")) {
- $trash_status = imap_status($mbox, "{$imap_host}$folder", SA_MESSAGES+SA_UNSEEN);
- if ($trash_status->messages > 0) {
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"emt\" value=\"1\">";
- echo "<input type=\"hidden\" name=\"box\" value=\"$folder\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/trashcan_purge.png\" onclick=\"if (confirm('Delete ALL messages in $folder permanently?')) {return true;} else {return false;}\"></td><td><nobr>Empty $folder</nobr></td></tr>";
- echo "</form>";
- }
- }
- echo "</table></div>";
- echo "<div style=\"height: 0.250rem;\"></div>";
- echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"dig\" value=\"1\">";
- echo "<input type=\"hidden\" name=\"box\" value=\"$folder\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-search.png\"></td><td>Search</td></tr>";
- echo "</form>";
- echo "</table></div>";
- echo "<div style=\"height: 0.250rem;\"></div>";
- if (is_array($quota) and ($quota[limit] > 0)) {
- echo "<div class=\"folders\">";
- echo "<table style=\"-moz-box-shadow: inset 0 0 0.188rem #dedede; -khtml-box-shadow: inset 0 0 0.188rem #dedede; -webkit-box-shadow: inset 0 0 0.188rem #dedede; box-shadow: inset 0 0 0.188rem #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}%;\"></td></tr></table>";
- echo "<font style=\"font-size: 0.5625rem;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
- echo "</div>";
- echo "<div style=\"height: 0.250rem;\"></div>";
- }
- $get_folders = kartero_sort_folders($imap_host,imap_list($mbox,$imap_host,"*"));
- if (is_array($get_folders)) {
- echo "\n\n<div class=\"folders\"><table border=\"0\" cellspacing=\"1\" callpadding=\"2\">";
- foreach ($get_folders as $get_folder) {
- $status = imap_status($mbox, $get_folder, SA_MESSAGES+SA_UNSEEN);
- $status_folder = "(" . $status->unseen . "/" . $status->messages . ")";
- $get_folder = imap_utf7_decode(trim(str_replace($imap_host,"",$get_folder)));
- echo "<tr><form method=\"post\"><td align=\"center\"><input type=\"hidden\" name=\"box\" value=\"$get_folder\">";
- if ($folder == $get_folder) {
- echo "<input type=\"image\" src=\"images/folder-open.png\"></td></form>";
- echo "<td><nobr><b>$get_folder</b> $status_folder</nobr></td></tr>";
- }
- else {
- echo "<input type=\"image\" src=\"images/folder-close.png\"></td></form>";
- echo "<td><nobr>$get_folder $status_folder</nobr></td></tr>";
- }
- }
- echo "</table></div>";
- }
- else {
- echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
- }
- echo "<div style=\"height: 0.250rem;\"></div>";
- echo "<div class=\"folders\"><table border=\"0\" cellspacing=\"0\" callpadding=\"0\">";
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"addr\" value=\"1\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-contacts.png\"></td><td>Contacts</td></tr>";
- echo "</form>";
- echo "<form method=\"post\">";
- echo "<input type=\"hidden\" name=\"set\" value=\"1\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/mail-settings.png\"></td><td>Settings</td></tr>";
- echo "</form>";
- echo "</table></div>";
- ?>