- Security: Possible cookie theft in src/redirect.php if
[squirrelmail.git] / src / folders.php
index 5dec790ad015d9706176f08b9e4d3a06a73aff8d..f5ccdbed253ebacb8e5e76a2cdf19046f68151cd 100644 (file)
@@ -3,13 +3,12 @@
 /**
  * folders.php
  *
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
  * Handles all interaction between the user and the other folder
  * scripts which do most of the work. Also handles the Special
  * Folders.
  *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
@@ -21,7 +20,7 @@
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
+include_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/folder_manip.php');
 require_once(SM_PATH . 'functions/plugin.php');
@@ -143,9 +142,9 @@ $server_type = strtolower($imap_server_type);
 if ( $server_type == 'courier' ) {
     /**
      * If we use courier, we should hide system trash folder
-     * FIXME: (tokul) Who says that courier does not allow storing folders in 
-     * INBOX.Trash or inbox.trash? Can't reproduce it 3.0.8. This entry is 
-     * useless, because in_array() check is case sensitive and INBOX is in 
+     * FIXME: (tokul) Who says that courier does not allow storing folders in
+     * INBOX.Trash or inbox.trash? Can't reproduce it 3.0.8. This entry is
+     * useless, because in_array() check is case sensitive and INBOX is in
      * upper case.
      */
     array_push($skip_folders, 'inbox.trash');
@@ -154,6 +153,11 @@ if ( $server_type == 'courier' ) {
         // We don't need INBOX, since it is top folder
         array_push($skip_folders, 'INBOX');
     }
+} elseif ( $server_type == 'bincimap' ) {
+    if ( $default_folder_prefix == 'INBOX/' ) {
+        // We don't need INBOX, since it is top folder
+        array_push($skip_folders, 'INBOX');
+    }
 }
 
 if ( $default_sub_of_inbox == false ) {
@@ -188,14 +192,14 @@ foreach ($boxes as $index => $aBoxData) {
     if (isSpecialMailbox($aBoxData['unformatted']) &&
         ! in_array($aBoxData['unformatted'],$skip_folders)) {
         $skip_folders[] = $aBoxData['unformatted'];
-    } 
+    }
 }
 
 /**
  * Retrieve list of folders when special folders are excluded. Special folders
  * should be unavailable in rename/delete/unsubscribe. Theoretically user can
- * modify form and perform these operations with special folders, but if user 
- * manages to delete/rename/unsubscribe special folder by hacking form... 
+ * modify form and perform these operations with special folders, but if user
+ * manages to delete/rename/unsubscribe special folder by hacking form...
  *
  * If script or program depends on special folder, they should not assume that
  * folder is available.
@@ -354,4 +358,6 @@ sqimap_logout($imapConnection);
     </table>
 </td></tr>
 </table>
-</body></html>
\ No newline at end of file
+<?php
+$oTemplate->display('footer.tpl');
+?>
\ No newline at end of file