These fixes were needed in order to make work save stuff from newmail. Please Paul...
[squirrelmail.git] / src / folders_subscribe.php
index ef8c984778b576208515ae11c2038cf74b65007f..2ae7412acb22b770823ae96479fc676be29ea65d 100644 (file)
@@ -1,34 +1,25 @@
 <?php
+
    /**
     **  folders_subscribe.php
     **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
+    **  Copyright (c) 1999-2001 The SquirrelMail development team
     **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
     **  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);
 
    $location = get_location();
-   if ($method == "sub") {
+   if ($method == 'sub') {
       for ($i=0; $i < count($mailbox); $i++) {
          $mailbox[$i] = trim($mailbox[$i]);
          sqimap_subscribe ($imapConnection, $mailbox[$i]);
          header("Location: $location/folders.php?success=unsubscribe");
       }
    }
+   if (!isset($mailbox)) {
+         header("Location: $location/folders.php");
+   }
    sqimap_logout($imapConnection);
 
    /*
-   displayPageHeader($color, "None");
+   displayPageHeader($color, 'None');
    echo "<BR><BR><BR><CENTER><B>";
    if ($method == "sub") {
       echo _("Subscribed Successfully!");
@@ -63,4 +57,3 @@
    echo "</BODY></HTML>";
    */
 ?>
-