| 1 | <?php |
| 2 | session_start(); |
| 3 | |
| 4 | if (!isset($config_php)) |
| 5 | include("../config/config.php"); |
| 6 | if (!isset($strings_php)) |
| 7 | include("../functions/strings.php"); |
| 8 | if (!isset($page_header_php)) |
| 9 | include("../functions/page_header.php"); |
| 10 | if (!isset($imap_php)) |
| 11 | include("../functions/imap.php"); |
| 12 | if (!isset($display_messages_php)) |
| 13 | include("../functions/display_messages.php"); |
| 14 | |
| 15 | include("../src/load_prefs.php"); |
| 16 | |
| 17 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
| 18 | $dm = sqimap_get_delimiter($imapConnection); |
| 19 | |
| 20 | if (strpos($folder_name, "\"") || strpos($folder_name, ".") || |
| 21 | strpos($folder_name, "/") || strpos($folder_name, "\\") || |
| 22 | strpos($folder_name, "'") || strpos($folder_name, "$dm")) { |
| 23 | plain_error_message(_("Illegal folder name. Please select a different name.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color); |
| 24 | exit; |
| 25 | } |
| 26 | |
| 27 | if ($contain_subs == true) |
| 28 | $folder_name = "$folder_name$dm"; |
| 29 | |
| 30 | if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) { |
| 31 | $folder_prefix = $folder_prefix . $dm; |
| 32 | } |
| 33 | if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != $folder_prefix)){ |
| 34 | $subfolder_orig = $subfolder; |
| 35 | $subfolder = $folder_prefix . $subfolder; |
| 36 | } |
| 37 | |
| 38 | if (trim($subfolder_orig) == "[ None ]") { |
| 39 | sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, ""); |
| 40 | } else { |
| 41 | sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, ""); |
| 42 | } |
| 43 | fputs($imapConnection, "1 logout\n"); |
| 44 | |
| 45 | // if ($auto_forward == true) { |
| 46 | // header ("Location: webmail.php?right_frame=folders.php"); |
| 47 | // } else { |
| 48 | echo "<html><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n"; |
| 49 | displayPageHeader($color, "None"); |
| 50 | echo "<BR><BR><BR><CENTER><B>"; |
| 51 | echo _("Folder Created!"); |
| 52 | echo "</B><BR><BR>"; |
| 53 | echo _("The folder has been successfully created."); |
| 54 | echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>"; |
| 55 | echo _("Click here"); |
| 56 | echo "</A> "; |
| 57 | echo _("to continue."); |
| 58 | echo "</CENTER>"; |
| 59 | echo "</BODY></HTML>"; |
| 60 | // } |
| 61 | ?> |
| 62 | |