Version 1.2.6 -- CVS
--------------------
- Fixed resume draft bug #513521, #514639
- - Newmail plugin: admin can disablethe use of audio (patch #517698)
+ - Newmail plugin: admin can disable the use of audio (patch #517698)
- Fixed quoting problem in safe html (patch #516542)
- SPAM folder no longer special folder (filters plugin)
- Filtering now happens on folder list refresh (filters plugin)
+ - Added checking of input of the folders page
+ - Made erronous deleting of folders harder (patch #514208)
Version 1.2.5 -- 22 February 2002
---------------------------------
echo "<tr><td bgcolor=\"$color[4]\"> </td></tr>\n";
+
+/** count special folders **/
+$count_special_folders = 0;
+$num_max = 1;
+if (strtolower($imap_server_type) == "courier" || $move_to_trash) {
+ $num_max++;
+}
+if ($move_to_sent) {
+ $num_max++;
+}
+if ($save_as_draft) {
+ $num_max++;
+}
+for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) {
+ if (strtolower($boxes[$p]['unformatted']) == 'inbox')
+ $count_special_folders++;
+ else if (strtolower($imap_server_type) == 'courier' &&
+ strtolower($boxes[$p]['unformatted']) == 'inbox.trash')
+ $count_special_folders++;
+ else if ($boxes[$p]['unformatted'] == $trash_folder && $trash_folder)
+ $count_special_folders++;
+ else if ($boxes[$p]['unformatted'] == $sent_folder && $sent_folder)
+ $count_special_folders++;
+ else if ($boxes[$p]['unformatted'] == $draft_folder && $draft_folder)
+ $count_special_folders++;
+}
+
+
/** RENAMING FOLDERS **/
echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>".
_("Rename a Folder").
"</B></TD></TR>".
"<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-if (count($boxes)) {
- echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n".
- "<TT><SELECT NAME=old>\n";
+if ($count_special_folders < count($boxes)) {
+ echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n"
+ . "<TT><SELECT NAME=old>\n"
+ . ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
for ($i = 0; $i < count($boxes); $i++) {
$use_folder = true;
echo "</B></TD></TR>";
echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-$count_special_folders = 0;
-$num_max = 1;
-if (strtolower($imap_server_type) == "courier" || $move_to_trash) {
- $num_max++;
-}
-if ($move_to_sent) {
- $num_max++;
-}
-if ($save_as_draft) {
- $num_max++;
-}
-for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) {
- if (strtolower($boxes[$p]['unformatted']) == 'inbox')
- $count_special_folders++;
- else if (strtolower($imap_server_type) == 'courier' &&
- strtolower($boxes[$p]['unformatted']) == 'inbox.trash')
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $trash_folder && $trash_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $sent_folder && $sent_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $draft_folder && $draft_folder)
- $count_special_folders++;
-}
-
if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_delete.php\" METHOD=\"POST\">\n";
- echo "<TT><SELECT NAME=mailbox>\n";
+ echo "<FORM ACTION=\"folders_delete.php\" METHOD=\"POST\">\n"
+ . "<TT><SELECT NAME=mailbox>\n"
+ . ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
for ($i = 0; $i < count($boxes); $i++) {
$use_folder = true;
if ((strtolower($boxes[$i]['unformatted']) != 'inbox') &&
sqimap_logout($imapConnection);
?>
-</body></html>
\ No newline at end of file
+</body></html>
$folder_name = trim($folder_name);
if (strpos($folder_name, "\"") || strpos($folder_name, "\\") ||
- strpos($folder_name, "'") || strpos($folder_name, "$delimiter")) {
+ strpos($folder_name, "'") || strpos($folder_name, "$delimiter") ||
+ ($folder_name == '')) {
+ displayPageHeader($color, 'None');
echo "<html><body bgcolor=$color[4]>";
plain_error_message(_("Illegal folder name. Please select a different name.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color);
sqimap_logout($imapConnection);
* $mailbox - selected mailbox from the form
*/
+if ($mailbox == '') {
+ displayPageHeader($color, 'None');
+ echo "<html><body bgcolor=$color[4]>";
+ plain_error_message(_("You have not selected a folder to delete. Please do so.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color);
+ exit;
+}
+
+
$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list ($imap_stream);
global $delimiter, $delete_folder;
/** lets see if we CAN move folders to the trash.. otherwise,
** just delete them **/
-// Courier IMAP doesn't like subfolders of Trash
+/* Courier IMAP doesn't like subfolders of Trash */
if (strtolower($imap_server_type) == "courier") {
$can_move_to_trash = false;
}
-// If global options say we can't move it into Trash
+/* If global options say we can't move it into Trash */
else if(isset($delete_folder) && $delete_folder == true) {
$can_move_to_trash = false;
}
-// If it's already a subfolder of trash, we'll have to delete it
+/* If it's already a subfolder of trash, we'll have to delete it */
else if(eregi("^".$trash_folder.".+", $mailbox)) {
$can_move_to_trash = false;
}
-// Otherwise, check if trash folder exits and support sub-folders
+/* Otherwise, check if trash folder exits and support sub-folders */
else {
for ($i = 0; $i < count($boxes); $i++) {
if ($boxes[$i]["unformatted"] == $trash_folder) {
continue;
}
}
-// Now create the nodes for subfolders of the parent folder
-// You can tell that it is a subfolder by tacking the mailbox delimiter
-// on the end of the $mailbox string, and compare to that.
+/* Now create the nodes for subfolders of the parent folder
+ You can tell that it is a subfolder by tacking the mailbox delimiter
+ on the end of the $mailbox string, and compare to that. */
$j = 0;
for ($i = 0;$i < count($boxes);$i++) {
if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox_no_dm . $delimiter)) == ($mailbox_no_dm . $delimiter)) {
addChildNodeToTree($boxes[$i]["unformatted"], $boxes[$i]["unformatted-dm"], $foldersTree);
}
}
-// simpleWalkTreePre(0, $foldersTree);
+/* simpleWalkTreePre(0, $foldersTree); */
/** Lets start removing the folders and messages **/
if (($move_to_trash == true) && ($can_move_to_trash == true)) { /** if they wish to move messages to the trash **/
require_once('../src/validate.php');
require_once('../functions/imap.php');
+if ($old == '') {
+ displayPageHeader($color, 'None');
+ echo "<html><body bgcolor=$color[4]>";
+ plain_error_message(_("You have not selected a folder to rename. Please do so.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color);
+ exit;
+}
+
+
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
/** Log out this session **/
sqimap_logout($imapConnection);
-?>
\ No newline at end of file
+?>