/** Parse the incoming mailbox name and return a string that is the FOLDER.MAILBOX **/
function findMailboxName($mailbox) {
$mailbox = trim($mailbox);
- if (substr($mailbox, strlen($mailbox)-1, strlen($mailbox)) == "\"") {
- $mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
- $pos = strrpos($mailbox, "\"") + 1;
- $box = substr($mailbox, $pos, strlen($mailbox));
- } else {
+// if (substr($mailbox, strlen($mailbox)-1, strlen($mailbox)) == "\"") {
+// $mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
+// $pos = strrpos($mailbox, "\"") + 1;
+// $box = substr($mailbox, $pos, strlen($mailbox));
+// } else {
$box = substr($mailbox, strrpos($mailbox, " ")+1, strlen($mailbox));
- }
+// }
return $box;
}
return $read;
}
- function getMailboxFlags($mailbox) {
+ function getMailboxFlags($imapConnection, $mailbox) {
+ $name = findMailboxName($mailbox);
+ fputs ($imapConnection, "1 LIST \"$name\" *\n");
+ $data = imapReadData($imapConnection, "1", true, $response, $message);
+ $mailbox = $data[0];
$mailbox = trim($mailbox);
$mailbox = substr($mailbox, strpos($mailbox, "(")+1, strlen($mailbox));
$mailbox = substr($mailbox, 0, strpos($mailbox, ")"));
}
function removeFolder($imapConnection, $folder) {
+ fputs ($imapConnection, "1 unsubscribe \"$folder\"\n");
+ $data = imapReadData($imapConnection, "1", true, $response, $message);
+ echo $data[0] . "<BR>";
fputs($imapConnection, "1 delete \"$folder\"\n");
$data = imapReadData($imapConnection, "1", false, $response, $message);
if ($response == "NO") {
$mailbox = findMailboxName($mailbox);
$periodCount = countCharInString($mailbox, $dm);
+ if (substr($mailbox, -1) == $dm)
+ $periodCount--;
// indent the correct number of spaces.
for ($j = 0;$j < $periodCount;$j++)
if (substr(findMailboxName($mailbox), 0, 1) != ".") {
$boxes[$g]["RAW"] = $mailbox;
+ // Get the mailbox name and format it. If there is a $dm at the end of it, remove it.
$mailbox = findMailboxName($mailbox);
$periodCount = countCharInString($mailbox, $dm);
+ if (substr($mailbox, -1) == $dm)
+ $periodCount = $periodCount - 1;
// indent the correct number of spaces.
for ($j = 0;$j < $periodCount;$j++)
// of the $haystack is reached.
//*************************************************************************
function readShortMailboxName($haystack, $needle) {
+ if (substr($haystack, -1) == $needle)
+ $haystack = substr($haystack, 0, strlen($haystack) - 1);
+
if (strpos($haystack, $needle)) {
$pos = strrpos($haystack, $needle) + 1;
$data = substr($haystack, $pos, strlen($haystack));
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-02-08 07:02-0500\n"
+"POT-Creation-Date: 2000-02-09 07:13-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#: squirrelmail/src/folders_create.php:35
-#: squirrelmail/src/folders_delete.php:77
+msgid "Folder Created!"
+msgstr ""
+
+#: squirrelmail/src/folders_create.php:36
+#: squirrelmail/src/folders_delete.php:80
+msgid "You will be automatically forwarded."
+msgstr ""
+
+#: squirrelmail/src/folders_create.php:36
+#: squirrelmail/src/folders_delete.php:80
+msgid "If not,"
+msgstr ""
+
+#: squirrelmail/src/folders_create.php:36
+#: squirrelmail/src/folders_delete.php:80
+msgid "click here"
+msgstr ""
+
+#: squirrelmail/src/folders_delete.php:79
+msgid "Folder Deleted!"
+msgstr ""
+
#: squirrelmail/src/folders_rename_do.php:67
msgid "Return"
msgstr ""
msgstr ""
#: squirrelmail/src/folders_rename_getname.php:34
-#: squirrelmail/src/options.php:259
+#: squirrelmail/src/options.php:258
msgid "Submit"
msgstr ""
msgid " Size of editor window (in characters):"
msgstr ""
-#: squirrelmail/src/options.php:147
+#: squirrelmail/src/options.php:146
msgid " Time between auto refresh of folder list:"
msgstr ""
-#: squirrelmail/src/options.php:245
+#: squirrelmail/src/options.php:244
msgid "Use a signature?"
msgstr ""
if (trim($subfolder) == "[ None ]") {
createFolder($imapConnection, "$folder_name");
} else {
- createFolder($imapConnection, "$subfolder$dm$folder_name");
+ createFolder($imapConnection, "$subfolder$folder_name");
}
fputs($imapConnection, "1 logout\n");
- echo "<BR><BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
- echo _("Return");
- echo "</A>";
+ echo "<FONT FACE=\"Arial,Helvetica\">";
+ echo "<BR><BR><CENTER><B>" . _("Folder Created!") . "</B><BR><BR>";
+ echo _("You will be automatically forwarded.") . "<BR>" . _("If not,") . " <A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>" . _("click here") . "</a>.";
+ echo "</CENTER></FONT>";
+
?>
</BODY></HTML>
include("../src/load_prefs.php");
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+ displayPageHeader($color, "None");
+
$imapConnection = loginToImapServer($username, $key, $imapServerAddress, 0);
getFolderList($imapConnection, $boxes);
$tmp_trash_folder = $boxes[$i]["RAW"];
}
- $tmpflags = getMailboxFlags($tmp_trash_folder);
+ $tmpflags = getMailboxFlags($imapConnection, $tmp_trash_folder);
$can_move_to_trash = true;
for ($i = 0; $i < count($tmpflags); $i++) {
if (strtolower($tmpflags[$i]) == "noinferiors")
if (($boxes[$i]["UNFORMATTED"] == $mailbox) ||
(substr($boxes[$i]["UNFORMATTED"], 0, strlen($mailbox . $dm)) == $mailbox . $dm)) {
$folderWithoutINBOX = getFolderNameMinusINBOX($boxes[$i]["UNFORMATTED"], $dm);
- $flags = getMailboxFlags($boxes[$i]["RAW"]);
+ $flags = getMailboxFlags($imapConnection, $boxes[$i]["RAW"]);
for ($b = 0; $b < count($flags); $b++) {
$type = $flags[$b];
}
/** Log out this session **/
fputs($imapConnection, "1 logout");
- echo "<BR><BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
- echo _("Return");
- echo "</A>";
+ echo "<FONT FACE=\"Arial,Helvetica\">";
+ echo "<BR><BR><CENTER><B>" . _("Folder Deleted!") . "</B><BR><BR>";
+ echo _("You will be automatically forwarded.") . "<BR>" . _("If not,") . " <A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>" . _("click here") . "</A>";
+ echo "</CENTER></FONT>";
+
echo "</BODY></HTML>";
?>
include("../functions/imap.php");
include("../functions/mailbox.php");
- function formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash) {
+ function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) {
require ("../config/config.php");
$mailboxURL = urlencode($mailbox);
- selectMailbox($imapConnection, $mailbox, $numNessages);
+ selectMailbox($imapConnection, $real_box, $numNessages);
$unseen = unseenMessages($imapConnection, $numUnseen);
echo "<NOBR>";
echo "<FONT FACE=\"Arial,Helvetica\">\n";
$delimeter = findMailboxDelimeter($imapConnection);
for ($i = 0;$i < count($boxes); $i++) {
- $mailbox = $boxes[$i]["UNFORMATTED"];
- $boxFlags = getMailboxFlags($boxes[$i]["RAW"]);
-
- $boxCount = countCharInString($mailbox, $delimeter);
-
$line = "";
- // indent the correct number of spaces.
- for ($j = 0;$j < $boxCount;$j++)
- $line .= " ";
+ $mailbox = $boxes[$i]["FORMATTED"];
+ $boxFlags = getMailboxFlags($imapConnection, $boxes[$i]["RAW"]);
if (trim($boxFlags[0]) != "") {
$noselect = false;
if (strtolower($boxFlags[$h]) == "noselect")
$noselect = true;
}
-
if ($noselect == true) {
$line .= "<FONT COLOR=\"$color[10]\" FACE=\"Arial,Helvetica\">";
$line .= readShortMailboxName($mailbox, $delimeter);
$line .= "</FONT><FONT FACE=\"Arial,Helvetica\">";
} else {
- $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash);
+ $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["UNFORMATTED"], $delimeter, $color, $move_to_trash);
}
} else {
- $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color, $move_to_trash);
+ $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["UNFORMATTED"], $delimeter, $color, $move_to_trash);
}
echo "$line<BR>";
}