59177427 |
1 | <?php |
2a32fc83 |
2 | session_start(); |
3 | |
d068c0ec |
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"); |
b40316f9 |
14 | |
d3cdb279 |
15 | include("../src/load_prefs.php"); |
16 | |
e1469126 |
17 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
813eba2f |
18 | $dm = sqimap_get_delimiter($imapConnection); |
7ce342dc |
19 | |
ecf51658 |
20 | if (strpos($folder_name, "\"") || strpos($folder_name, "\\") || |
7ce342dc |
21 | strpos($folder_name, "'") || strpos($folder_name, "$dm")) { |
9f2215a1 |
22 | plain_error_message(_("Illegal folder name. Please select a different name.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color); |
7ce342dc |
23 | exit; |
24 | } |
25 | |
26 | if ($contain_subs == true) |
27 | $folder_name = "$folder_name$dm"; |
28 | |
5479d709 |
29 | if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) { |
30 | $folder_prefix = $folder_prefix . $dm; |
31 | } |
32 | if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != $folder_prefix)){ |
33 | $subfolder_orig = $subfolder; |
34 | $subfolder = $folder_prefix . $subfolder; |
9988d19e |
35 | } else { |
36 | $subfolder_orig = $subfolder; |
5479d709 |
37 | } |
38 | |
ecf51658 |
39 | if ((trim($subfolder_orig) == "[ None ]") || (trim(stripslashes($subfolder_orig)) == "[ None ]")) { |
5479d709 |
40 | sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, ""); |
d92b6f31 |
41 | } else { |
813eba2f |
42 | sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, ""); |
d92b6f31 |
43 | } |
b40316f9 |
44 | fputs($imapConnection, "1 logout\n"); |
45 | |
813eba2f |
46 | // if ($auto_forward == true) { |
47 | // header ("Location: webmail.php?right_frame=folders.php"); |
48 | // } else { |
813eba2f |
49 | displayPageHeader($color, "None"); |
813eba2f |
50 | echo "<BR><BR><BR><CENTER><B>"; |
51 | echo _("Folder Created!"); |
52 | echo "</B><BR><BR>"; |
53 | echo _("The folder has been successfully created."); |
9f2215a1 |
54 | echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>"; |
813eba2f |
55 | echo _("Click here"); |
56 | echo "</A> "; |
57 | echo _("to continue."); |
aae41ae9 |
58 | echo "</CENTER>"; |
813eba2f |
59 | echo "</BODY></HTML>"; |
60 | // } |
b40316f9 |
61 | ?> |
b40316f9 |
62 | |