changed <? to <?php in everything
[squirrelmail.git] / src / folders_create.php
CommitLineData
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
20 if (strpos($folder_name, "\"") || strpos($folder_name, ".") ||
21 strpos($folder_name, "/") || strpos($folder_name, "\\") ||
22 strpos($folder_name, "'") || strpos($folder_name, "$dm")) {
2a32fc83 23 plain_error_message(_("Illegal folder name. Please select a different name.")."<BR><A HREF=\"../src/folders.php?PHPSESSID=$PHPSESSID\">"._("Click here to go back")."</A>.", $color);
7ce342dc 24 exit;
25 }
26
27 if ($contain_subs == true)
28 $folder_name = "$folder_name$dm";
29
5479d709 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, "");
d92b6f31 40 } else {
813eba2f 41 sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, "");
d92b6f31 42 }
b40316f9 43 fputs($imapConnection, "1 logout\n");
44
813eba2f 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");
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.");
2a32fc83 54 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php?PHPSESSID=$PHPSESSID\" 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