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