X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=c8bc624aa7411bed2e8ed2e7e22318c46236c61b;hb=e1c11171cd580d0d27e1a596ab53afac90075bf3;hp=3b2929e230e602deb6bcc1a5fb54961bd8cd09ec;hpb=ff89ac8a64bfe112bb528df0d143f90a5b73c76e;p=squirrelmail.git
diff --git a/src/left_main.php b/src/left_main.php
index 3b2929e2..c8bc624a 100644
--- a/src/left_main.php
+++ b/src/left_main.php
@@ -1,4 +1,4 @@
-
+
-
-
-
-
-
-
-
- include("../config/config.php");
- include("../functions/strings.php");
- include("../functions/imap.php");
- include("../functions/mailbox.php");
- // open a connection on the imap port (143)
- $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
-
- fputs($imapConnection, "1 list \"\" *\n");
- $str = imapReadData($imapConnection);
-
- echo "";
- echo "Folders
";
- echo "(refresh folder list)
";
- echo "\n";
- for ($i = 0;$i < count($str); $i++) {
- $mailbox = Chop($str[$i]);
- $mailbox = findMailboxName($mailbox);
-
- // find the quote at the begining of the mailbox name.
- // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
- $periodCount = countCharInString($mailbox, ".");
-
- // indent the correct number of spaces.
- for ($j = 0;$j < $periodCount;$j++)
- echo " ";
-
- $mailboxURL = urlencode($mailbox);
- selectMailbox($imapConnection, $mailbox, $numNessages);
- $unseen = unseenMessages($imapConnection, $numUnseen);
- if ($unseen)
- echo "";
- echo "";
- echo readShortMailboxName($mailbox, ".");
- if (($move_to_trash == true) && ($mailbox == $trash_folder)) {
- $urlMailbox = urlencode($mailbox);
- echo " (empty)";
+ if (($move_to_trash == true) && ($real_box == $trash_folder)) {
+ $urlMailbox = urlencode($real_box);
+ $line .= "";
+ $line .= " ("._("purge").")";
+ $line .= "\n";
}
- echo "\n";
- if ($numUnseen > 0) {
- echo " ($numUnseen)";
+ return $line;
+ echo "";
+ }
+
+ // open a connection on the imap port (143)
+ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
+
+ /** If it was a successful login, lets load their preferences **/
+ include("../src/load_prefs.php");
+
+ if (isset($left_refresh) && ($left_refresh != "None") && ($left_refresh != "")) {
+ echo "";
+ echo "";
+ echo "";
+ }
+
+ echo "";
+
+ $boxes = sqimap_mailbox_list($imapConnection);
+
+ echo "";
+ echo _("Folders") . "
";
+
+ echo "(";
+ echo _("refresh folder list");
+ echo ")
";
+ $delimeter = sqimap_get_delimiter($imapConnection);
+
+ for ($i = 0;$i < count($boxes); $i++) {
+ $line = "";
+ $mailbox = $boxes[$i]["formatted"];
+
+ if ($boxes[$i]["flags"]) {
+ $noselect = false;
+ for ($h = 0; $h < count($boxes[$i]["flags"]); $h++) {
+ if (strtolower($boxes[$i]["flags"][$h]) == "noselect")
+ $noselect = true;
+ }
+ if ($noselect == true) {
+ $line .= "";
+ $line .= replace_spaces(readShortMailboxName($mailbox, $delimeter));
+ $line .= "";
+ } else {
+ $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
+ }
+ } else {
+ $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
}
- echo "
\n";
+ echo "$line
";
}
- echo "";
+
fclose($imapConnection);
?>
-
+