This blob has been accessed 377 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;
- }
- 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>";
- $get_folders = imap_list($mbox, $host, "*");
- if (is_array($get_folders)) {
- if (in_array("{$host}INBOX",$get_folders)) {
- $inbox = array_search("{$host}INBOX",$get_folders);
- unset($get_folders[$inbox]);
- unset($inbox);
- }
- sort($get_folders);
- array_unshift($get_folders,"{$host}INBOX");
- reset($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 = 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=\"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>";
- ?>