This blob has been accessed 390 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 = "3px";
- }
- else {
- $quota_bar_bgcolor = "#cde2a7";
- $quota_bar_border = "#74ae0b";
- $quota_bar_shadow = "2px";
- }
- $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: 11px; } }";
- echo "\r\n@-moz-keyframes quota { 0% { width: 0; height: 11px; } }";
- echo "\r\n.bar { height: 11px; padding: 0; margin: 0; background: $quota_bar_bgcolor; border: $quota_bar_border solid 1px; -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 1px #777; -webkit-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #777; -khtml-box-shadow: inset 0 0 $quota_bar_shadow $quota_bar_border, 0 0 1px #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") {
- $trash_status = imap_status($mbox, "{$host}Trash", 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=\"Trash\">";
- echo "<tr><td width=\"32\"><input type=\"image\" src=\"images/trashcan_purge.png\" onclick=\"if (confirm('Delete ALL messages in Trash permanently?')) {return true;} else {return false;}\"></td><td><nobr>Empty Trash</nobr></td></tr>";
- echo "</form>";
- }
- }
- echo "</table></div>";
- echo "<div style=\"height: 4px;\"></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: 4px;\"></div>";
- if (is_array($quota) and ($quota[limit] > 0)) {
- echo "<div class=\"folders\">";
- echo "<table style=\"-moz-box-shadow: inset 0 0 3px #dedede; -khtml-box-shadow: inset 0 0 3px #dedede; -webkit-box-shadow: inset 0 0 3px #dedede; box-shadow: inset 0 0 3px #dedede;\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\"><tr bgcolor=\"#ffffff\"><td><div class=\"bar\" style=\"width: {$quota_bar_width}px;\"></td></tr></table>";
- echo "<font style=\"font-size: 0.75em;\"><nobr>$quota_usage of $quota_limit ($quota_pct%)</nobr></font>";
- echo "</div>";
- echo "<div style=\"height: 4px;\"></div>";
- }
- $get_folders = kartero_sort_folders($host,imap_list($mbox,$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($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: 4px;\"></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>";
- ?>