Removed more warnings
[squirrelmail.git] / src / left_main.php
index e2b6872c1f1123a029c700ec835c6dcef172efb7..3d38e173f87a7952661bdc5e8b25c0af08035b76 100644 (file)
    include('../src/validate.php');
    include("../functions/array.php");
    include("../functions/imap.php");
-   include("../functions/page_header.php");
    include("../functions/plugin.php");
-   include("../src/load_prefs.php");
 
    // open a connection on the imap port (143)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
-
+   
    displayHtmlHeader();
 
+   if ($auto_create_special && ! isset($auto_create_done)) {
+         if (isset ($sent_folder) && $sent_folder != "none") {
+                if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
+                       sqimap_mailbox_create ($imapConnection, $sent_folder, "");
+                }
+         }
+         if (isset ($trash_folder) && $trash_folder != "none") {
+                if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)) {
+                       sqimap_mailbox_create ($imapConnection, $trash_folder, "");
+                }
+         }
+         $auto_create_done = true;
+         session_register('auto_create_done');
+   }
+
    function formatMailboxName($imapConnection, $box_array, $delimeter) {
       global $folder_prefix, $trash_folder, $sent_folder;
       global $color, $move_to_sent, $move_to_trash;