Some user interface changes.
[squirrelmail.git] / src / folders_subscribe.php
index ef8c984778b576208515ae11c2038cf74b65007f..761d2e183ea7f67691c4bfc4a2c98c4ef7cde573 100644 (file)
@@ -7,22 +7,13 @@
     **
     **  Subscribe and unsubcribe form folders. 
     **  Called from folders.php
+    **
+    **  $Id$
     **/
 
-   session_start();
-
-   if (!isset($config_php))
-      include("../config/config.php");
-   if (!isset($strings_php))
-      include("../functions/strings.php");
-   if (!isset($page_header_php))
-      include("../functions/page_header.php");
-   if (!isset($imap_php))
-      include("../functions/imap.php");
-   if (!isset($display_messages_php))
-      include("../functions/display_messages.php");
-
-   include("../src/load_prefs.php");
+   require_once('../src/validate.php');
+   require_once('../functions/imap.php');
+   require_once('../functions/display_messages.php');
 
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $dm = sqimap_get_delimiter($imapConnection);
@@ -41,6 +32,9 @@
          header("Location: $location/folders.php?success=unsubscribe");
       }
    }
+   if (!isset($mailbox)) {
+         header("Location: $location/folders.php");
+   }
    sqimap_logout($imapConnection);
 
    /*
@@ -63,4 +57,3 @@
    echo "</BODY></HTML>";
    */
 ?>
-