Removed a lot of the warnings generated when PHP has all warnings enabled.
[squirrelmail.git] / src / folders_create.php
index 7b321d9400a6450994fe778b47f2f6e3396a1136..3bbe0e6667d35a7a6187177d8a0043c9d0c1bdcf 100644 (file)
@@ -1,4 +1,16 @@
 <?php
+   /**
+    **  folders_create.php
+    **
+    **  Copyright (c) 1999-2000 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Creates folders on the IMAP server. 
+    **  Called from folders.php
+    **
+    **  $Id$
+    **/
+
    session_start();
 
    if (!isset($config_php))
@@ -19,7 +31,9 @@
 
    if (strpos($folder_name, "\"") || strpos($folder_name, "\\") ||
        strpos($folder_name, "'") || strpos($folder_name, "$dm")) {
+               print "<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);
       exit;
    }
 
       $subfolder_orig = $subfolder;
    }
 
-   if ((trim($subfolder_orig) == "[ None ]") || (trim(stripslashes($subfolder_orig)) == "[ None ]")) {
+   if ((trim($subfolder_orig) == "[ None ]") || (trim(sqStripSlashes($subfolder_orig)) == "[ None ]")) {
       sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, "");
    } else {
       sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, "");
    }
    fputs($imapConnection, "1 logout\n");
 
-//   if ($auto_forward == true) {
-//      header ("Location: webmail.php?right_frame=folders.php");
-//   } else {
-      displayPageHeader($color, "None");
-      echo "<BR><BR><BR><CENTER><B>";
-      echo _("Folder Created!");
-      echo "</B><BR><BR>";
-      echo _("The folder has been successfully created.");
-      echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
-      echo _("Click here");
-      echo "</A> ";
-      echo _("to continue.");
-      echo "</CENTER>";
-      echo "</BODY></HTML>";
-//   }
+   $location = get_location();
+   header ("Location: $location/folders.php?success=create");
+   sqimap_logout($imapConnection);
 ?>