This segment of code should be left in until at least Squirrelmail 1.7.x, to give...
[squirrelmail.git] / src / folders_create.php
index 18d76fbf7492492d9b4577f71b68db15f16f6965..2aa59316155a8a3fbde75755307d5f30ba2bbb46 100644 (file)
@@ -3,35 +3,33 @@
 /**
  * folders_create.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Creates folders on the IMAP server.
  * Called from folders.php
  *
  * $Id$
+ * @package squirrelmail
  */
 
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 
 /* get globals we may need */
-
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$delimiter = $_SESSION['delimiter'];
-$onetimepad = $_SESSION['onetimepad'];
-$folder_name = $_POST['folder_name'];
-$subfolder = $_POST['subfolder'];
-if (isset($_POST['contain_subs'])) {
-    $contain_subs = $_POST['contain_subs'];
-}
-
+sqgetGlobalVar('key',          $key,           SQ_COOKIE);
+sqgetGlobalVar('username',     $username,      SQ_SESSION);
+sqgetGlobalVar('onetimepad',   $onetimepad,    SQ_SESSION);
+sqgetGlobalVar('delimiter',    $delimiter,     SQ_SESSION);
+sqgetGlobalVar('folder_name',  $folder_name,   SQ_POST);
+sqgetGlobalVar('subfolder',    $subfolder,     SQ_POST);
+sqgetGlobalVar('contain_subs', $contain_subs,  SQ_POST);
 /* end of get globals */
 
 $folder_name = trim($folder_name);
@@ -46,7 +44,7 @@ if (substr_count($folder_name, '"') || substr_count($folder_name, "\\") ||
     exit;
 }
 
-$subfolder = imap_utf7_decode_local($subfolder);
+$folder_name = imap_utf7_encode_local($folder_name);
 
 if (isset($contain_subs) && $contain_subs ) {
     $folder_name = $folder_name . $delimiter;