Added some folder functionality
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 28 Nov 1999 22:03:13 +0000 (22:03 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 28 Nov 1999 22:03:13 +0000 (22:03 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@29 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap.php
src/folders.php
src/left_main.php

index c757cf7ac43c52ad56342c492be9ceacfa25f552..2121271fe30f16ecb28242e3fb1287530d3b5f75 100644 (file)
       }
       return $data;
    }
+
+   /** Parse the incoming mailbox name and return a string that is the FOLDER.MAILBOX **/
+   function findMailboxName($mailbox) {
+      // start at -2 so that we skip the initial quote at the end of the mailbox name
+      $i = -2;
+      $char = substr($mailbox, $i, 1);
+      while ($char != "\"") {
+         $i--;
+         $temp .= $char;
+         $char = substr($mailbox, $i, 1);
+      }
+      return strrev($temp);
+   }
 ?>
index 5133e2294bdd74a0f26b8994aeaddb1e471fdd94..a3abbf5bd05cbd126f8cbe571ec961037182920d 100644 (file)
@@ -1,2 +1,47 @@
+<HTML><BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#0000EE" ALINK="#0000EE">
 <?
-?>
\ No newline at end of file
+   include("../config/config.php");
+   include("../functions/strings.php");
+   include("../functions/page_header.php");
+   include("../functions/imap.php");
+
+   displayPageHeader("None");
+
+   echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
+   echo "   <TR><TD BGCOLOR=DCDCDC ALIGN=CENTER>\n";
+   echo "      <FONT FACE=\"Arial,Helvetica\">Folders</FONT>\n";
+   echo "   </TD></TR>\n";
+   echo "</TABLE>\n";
+
+   $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
+   if (!$imapConnection) {
+      echo "Error connecting to IMAP Server.<br>";
+      echo "$errorNumber : $errorString<br>";
+      exit;
+   }
+   $serverInfo = fgets($imapConnection, 256);
+
+   fputs($imapConnection, "1 login $username $key\n");
+   $read = fgets($imapConnection, 1024);
+
+   fputs($imapConnection, "1 list \"\" *\n");
+   $str = imapReadData($imapConnection);
+
+   for ($i = 0;$i < count($str); $i++) {
+      $mailbox = Chop($str[$i]);
+      // find the quote at the begining of the mailbox name.
+      //    i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
+      $mailbox = findMailboxName($mailbox);
+      $periodCount = countCharInString($mailbox, ".");
+
+      // indent the correct number of spaces.
+      for ($j = 0;$j < $periodCount;$j++)
+         echo "&nbsp;&nbsp;";
+
+      $mailboxURL = urlencode($mailbox);
+      echo "<FONT FACE=\"Arial,Helvetica\">\n";
+      echo readShortMailboxName($mailbox, ".");
+      echo "</FONT><BR>\n";
+   }
+?>
+</BODY></HTML>
\ No newline at end of file
index 568de7eed6b618907cd3a60652a0af3775c0a26f..3bf51e5955ef106b342bbf8e30824de8830acf73 100644 (file)
    include("../functions/strings.php");
    include("../functions/imap.php");
 
-   // *****************************************
-   //    Parse the incoming mailbox name and return a string that is the FOLDER.MAILBOX
-   // *****************************************
-   function findMailboxName($mailbox) {
-      // start at -2 so that we skip the initial quote at the end of the mailbox name
-      $i = -2;
-      $char = substr($mailbox, $i, 1);
-      while ($char != "\"") {
-         $i--;
-         $temp .= $char;
-         $char = substr($mailbox, $i, 1);
-      }
-      return strrev($temp);
-   }
-
    // open a connection on the imap port (143)
    $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
    if (!$imapConnection) {