Added (c) stuff and some formatting.
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 21 Nov 2001 18:38:12 +0000 (18:38 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 21 Nov 2001 18:38:12 +0000 (18:38 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1785 7612ce4b-ef26-0410-bec9-ea0150e637f0

30 files changed:
functions/abook_database.php
functions/abook_global_file.php
functions/abook_ldap_server.php
functions/abook_local_file.php
functions/addressbook.php
functions/array.php
functions/attachment_common.php
functions/auth.php
functions/constants.php
functions/date.php
functions/db_prefs.php
functions/display_messages.php
functions/gettext.php
functions/i18n.php
functions/imap.php
functions/imap_general.php
functions/imap_mailbox.php
functions/imap_messages.php
functions/imap_search.php
functions/index.php
functions/mailbox_display.php
functions/mime.php
functions/options.php
functions/page_header.php
functions/plugin.php
functions/prefs.php
functions/smtp.php
functions/strings.php
functions/tree.php
functions/url_parser.php

index 0964a85273a5b1463431e8eb75d75f511a43cd4c..3788bfe5b209986d27eebf2a80a1fb427fd5810c 100644 (file)
@@ -3,6 +3,9 @@
    /**
     **  abook_database.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  Backend for personal addressbook stored in a database,
     **  accessed using the DB-classes in PEAR.
     **
index c59b6bc7eaf8efaf2c0f28929b82dfb8db66be08..2317948ffb1739123d6f9b749d3f0417be04fa6a 100644 (file)
@@ -1,20 +1,23 @@
 <?php
 
-  /**
-   **  abook_local_file.php
-   **
-   **  Backend for addressbook as a pipe separated file
-   **
-   **  An array with the following elements must be passed to
-   **  the class constructor (elements marked ? are optional):
-   **
-   **  NOTE. This class should not be used directly. Use the
-   **        "AddressBook" class instead.
-   **
-   **  Make sure you configure this before using it!
-   **
-   ** $Id$
-   **/
+   /**
+    **  abook_local_file.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Backend for addressbook as a pipe separated file
+    **
+    **  An array with the following elements must be passed to
+    **  the class constructor (elements marked ? are optional):
+    **
+    **  NOTE. This class should not be used directly. Use the
+    **        "AddressBook" class instead.
+    **
+    **  Make sure you configure this before using it!
+    **
+    ** $Id$
+    **/
 
    class abook_global_file extends addressbook_backend {
      var $btype = 'local';
index 5db39cc10780ba6804edc75c15556c43c1f0cd5d..33dee156360764bf7300432fb39d5a98e5a49c8e 100644 (file)
@@ -1,28 +1,31 @@
 <?php
 
-  /**
-   **  abook_ldap_server.php
-   **
-   **  Address book backend for LDAP server
-   **
-   **  An array with the following elements must be passed to
-   **  the class constructor (elements marked ? are optional):
-   **
-   **     host      => LDAP server hostname/IP-address
-   **     base      => LDAP server root (base dn). Empty string allowed.
-   **   ? port      => LDAP server TCP port number (default: 389)
-   **   ? charset   => LDAP server charset (default: utf-8)
-   **   ? name      => Name for LDAP server (default "LDAP: hostname")
-   **                  Used to tag the result data
-   **   ? maxrows   => Maximum # of rows in search result
-   **   ? timeout   => Timeout for LDAP operations (in seconds, default: 30)
-   **                  Might not work for all LDAP libraries or servers.
-   **
-   **  NOTE. This class should not be used directly. Use the
-   **        "AddressBook" class instead.
-   **
-   ** $Id$
-   **/
+   /**
+    **  abook_ldap_server.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Address book backend for LDAP server
+    **
+    **  An array with the following elements must be passed to
+    **  the class constructor (elements marked ? are optional):
+    **
+    **     host      => LDAP server hostname/IP-address
+    **     base      => LDAP server root (base dn). Empty string allowed.
+    **   ? port      => LDAP server TCP port number (default: 389)
+    **   ? charset   => LDAP server charset (default: utf-8)
+    **   ? name      => Name for LDAP server (default "LDAP: hostname")
+    **                  Used to tag the result data
+    **   ? maxrows   => Maximum # of rows in search result
+    **   ? timeout   => Timeout for LDAP operations (in seconds, default: 30)
+    **                  Might not work for all LDAP libraries or servers.
+    **
+    **  NOTE. This class should not be used directly. Use the
+    **        "AddressBook" class instead.
+    **
+    ** $Id$
+    **/
 
    class abook_ldap_server extends addressbook_backend {
      var $btype = 'remote';
index d47316955add5c1d5e8cec75dfa06d673e1bf119..b5c7c8d7d08ee7e99058ab03a81047cf5c0457b6 100644 (file)
@@ -1,22 +1,25 @@
 <?php
 
-  /**
-   **  abook_local_file.php
-   **
-   **  Backend for addressbook as a pipe separated file
-   **
-   **  An array with the following elements must be passed to
-   **  the class constructor (elements marked ? are optional):
-   **
-   **     filename  => path to addressbook file
-   **   ? create    => if true: file is created if it does not exist.
-   **   ? umask     => umask set before opening file.
-   **
-   **  NOTE. This class should not be used directly. Use the
-   **        "AddressBook" class instead.
-   **
-   ** $Id$
-   **/
+   /**
+    **  abook_local_file.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Backend for addressbook as a pipe separated file
+    **
+    **  An array with the following elements must be passed to
+    **  the class constructor (elements marked ? are optional):
+    **
+    **     filename  => path to addressbook file
+    **   ? create    => if true: file is created if it does not exist.
+    **   ? umask     => umask set before opening file.
+    **
+    **  NOTE. This class should not be used directly. Use the
+    **        "AddressBook" class instead.
+    **
+    ** $Id$
+    **/
 
    class abook_local_file extends addressbook_backend {
      var $btype = 'local';
index ca57150e08588187635b3d17445d2b997bec919f..08246cd6cf9446d62b145f1872b2cc2f15690d19 100644 (file)
@@ -1,12 +1,15 @@
 <?php
 
-  /**
-   **  addressbook.php
-   **
-   **  Functions and classes for the addressbook system.
-   **
-   **  $Id$
-   **/
+   /**
+    **  addressbook.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Functions and classes for the addressbook system.
+    **
+    **  $Id$
+    **/
 
 
    // This is the path to the global site-wide addressbook.
index d17662bbdb22bba67612bf1abbe30a124b49dc8a..ead0d55f38e3d07abf485a772f0bae9b3218dbce 100644 (file)
@@ -1,12 +1,15 @@
 <?php
    /**
-    * array.php
-    *
-    * This contains functions that work with array manipulation.  They
-    * will help sort, and do other types of things with arrays
-    *
-    *  $Id$
-    */
+    ** array.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    ** This contains functions that work with array manipulation.  They
+    ** will help sort, and do other types of things with arrays
+    **
+    **  $Id$
+    **/
 
 
    function ary_sort($ary,$col, $dir = 1){
index 46eeacd91ddfd37224b605eff564e5c128e1c407..37f06288701cef35ac4a06c1076877c523eb9f39 100644 (file)
@@ -1,11 +1,14 @@
 <?php
-/**
- ** attachment_common.php
- **
- ** This file provides the handling of often-used attachment types.
- **
- ** $Id$
- **/
+    /**
+    ** attachment_common.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    ** This file provides the handling of often-used attachment types.
+    **
+    ** $Id$
+    **/
 
   global $FileExtensionToMimeType, $attachment_common_types;
   $FileExtensionToMimeType = array('bmp'  => 'image/x-bitmap',
index 7dd58a7a14a636405097bdb2564d8dd452b64c39..5b3f31e5e6b3f32b09fde2c360f3de135fc358bb 100644 (file)
@@ -3,11 +3,15 @@
     /**
     ** auth.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     ** Contains functions used to do authentication.
     **
     ** $Id$
     **/
 
+    require_once( '../functions/page_header.php' );
 
     function is_logged_in () {
         global $squirrelmail_language;
 
         set_up_language($squirrelmail_language, true);
 
-        echo "<html><body bgcolor=\"ffffff\">\n" .
-            '<br><br>echo "<center><b>'.
-            _("You must be logged in to access this page.").'</b><br>'.
+        displayHtmlHeader( 'SquirrelMail', '', FALSE );
+
+        echo "<body bgcolor=\"ffffff\">\n" .
+            '<br><br><center><b>'.
+            _("You must be logged in to access this page.").'</b><br><br>'.
             "<a href=\"../src/login.php\" target=\"_top\">"._("Go to the login page")."</a>\n".
             "</center></body></html>\n";
         exit;
index c2b4ec26a56caa1b8ddd3519bd48dbe9a5df9d32..2a3620f83145e91159b5288c9c4aa6943802e275 100644 (file)
@@ -1,16 +1,17 @@
 <?php
+
     /**
-     * constants.php
-     *
-     * Copyright (c) 1999-2001 The SquirrelMail Development Team
-     * Licensed under the GNU GPL. For full terms see the file COPYING.
-     *
-     * Loads constants used by the rest of the Squirrelmail source.
-     * This file is include by src/login.php, src/redirect.php and
-     * src/load_prefs.php.
-     *
-     * $Id$
-     */
+     ** constants.php
+     **
+     ** Copyright (c) 1999-2001 The SquirrelMail Development Team
+     ** Licensed under the GNU GPL. For full terms see the file COPYING.
+     **
+     ** Loads constants used by the rest of the Squirrelmail source.
+     ** This file is include by src/login.php, src/redirect.php and
+     ** src/load_prefs.php.
+     **
+     ** $Id$
+     **/
 
     /**************************************************************/
     /* Set values for constants used by Squirrelmail preferences. */
index d822396b248bd63c647f2507d84f7e361bed6ad7..4ed0426a032d385a154fb94690e60f5212e63941 100644 (file)
@@ -2,6 +2,9 @@
    /**
     **  date.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  Takes a date and parses it into a usable format.  The form that a
     **  date SHOULD arrive in is:
     **        <Tue,> 29 Jun 1999 09:52:11 -0500 (EDT)
index e23f320f8b681023b16f03ca0a7bf702ac854a85..b4f07f5d486ec8c00c226edd7df6f8acf623bb13 100644 (file)
@@ -2,6 +2,9 @@
    /**
     **  db_prefs.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  This contains functions for manipulating user preferences
     **  stored in a database, accessed though the Pear DB layer.
     **
index 06bc2fcbbe2ac747b861cfd13dd3696954b91e64..e59a3c469ecafed2297ca3a084f58cb90c1a699e 100644 (file)
@@ -1,7 +1,11 @@
 <?php
+
    /**
     **  display_messages.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  This contains all messages, including information, error, and just
     **  about any other message you can think of.
     **
     **/
 
     function error_username_password_incorrect($color) {
-      echo '<BR>';
-      echo " <TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
-      echo '   <TR>';
-      echo "      <TD BGCOLOR=\"$color[0]\">";
-      echo '         <B><CENTER>ERROR</CENTER></B>';
-      echo '   </TD></TR><TR><TD>';
-      echo '      <CENTER><BR>' . _("Unknown user or password incorrect.") . '<BR><A HREF="login.php" TARGET=_top>' . _("Click here to try again") . '</A>.</CENTER>';
-      echo '   </TD></TR>';
-      echo '</TABLE>';
-      echo '</BODY></HTML>';
+
+        echo '<BR>'.
+                "<TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
+                '<TR>'.
+                    "<TD BGCOLOR=\"$color[0]\">".
+                        '<B><CENTER>ERROR</CENTER></B>'.
+                    '</TD></TR><TR><TD>'.
+                        '<CENTER><BR>' . _("Unknown user or password incorrect.") .
+                        '<BR><A HREF="login.php" TARGET=_top>' .
+                        _("Click here to try again") .
+                        '</A>.</CENTER>'.
+                    '</TD></TR>'.
+                '</TABLE>'.
+            '</BODY></HTML>';
+
     }
 
     function general_info($motd, $org_logo, $version, $org_name, $color) {
index 90da1db65fed1d77b44e95671c379131c8d64772..48fec079c744dfa607851734ee558ff083e359ff 100644 (file)
@@ -1,15 +1,20 @@
 <?PHP
 
-   /* Alternate to the system's built-in gettext.
-    * relies on .po files (can't read .mo easily).
-    * Uses the session for caching (speed increase)
-    * Possible use in other PHP scripts?  The only SM-specific thing is
-    *   $sm_language, I think
-    *
-    * Very special thanks to Konstantin Riabitsev for letting me use a
-    * server that didn't already have gettext on it!
-    */
-   
+   /**
+    **  gettext.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  Alternate to the system's built-in gettext.
+    **  relies on .po files (can't read .mo easily).
+    **  Uses the session for caching (speed increase)
+    **  Possible use in other PHP scripts?  The only SM-specific thing is
+    **    $sm_language, I think
+    **
+    ** $Id$
+    **/
+
    global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded,
       $gettext_php_translateStrings, $gettext_php_loaded_language,
       $gettext_php_short_circuit;
index 22d83a8b82cb081a46366bf7798b0f6db909113c..aa1fe21df848a31fd619ceea5d033a941707244f 100644 (file)
@@ -1,16 +1,19 @@
 <?php
 
-/**
- ** i18n.php
- ** 
- ** This file contains variuos functions that are needed to do
- ** internationalization of SquirrelMail.
- **
- ** Internally the output character set is used. Other characters are
- ** encoded using Unicode entities according to HTML 4.0.
- **
- ** $Id$
- **/
+    /**
+    ** i18n.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    ** This file contains variuos functions that are needed to do
+    ** internationalization of SquirrelMail.
+    **
+    ** Internally the output character set is used. Other characters are
+    ** encoded using Unicode entities according to HTML 4.0.
+    **
+    ** $Id$
+    **/
 
    global $squirrelmail_language, $languages;
    if (! isset($squirrelmail_language)) { $squirrelmail_language = ''; }
index 384753f76886e45960307c56fe8e2a3af5ffc6e5..9a3a41d22aa571d3da9ea38c61d5108383d6ea2e 100644 (file)
@@ -1,6 +1,12 @@
 <?php
 
-   /**  This just includes the different sections of the imap functions.
+   /**
+    **  imap.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  This just includes the different sections of the imap functions.
     **  They have been organized into these sections for simplicity sake.
     **
     **  $Id$
index 16f19b0ccb2bddc7526223e1846db17ab7e86fa2..165a02a50051ccc1935bc2cb491ba1488e66b558 100755 (executable)
@@ -2,6 +2,7 @@
 
    /**
     **  imap.php
+    **
     **  Copyright (c) 1999-2001 The Squirrelmail Development Team
     **  Licensed under the GNU GPL. For full terms see the file COPYING.    
     **
index 35fe479e8fb098dac5bb540bf05b5588de2c3a8c..5d8db15662c225a66c4020e4b58cdc248f683b71 100755 (executable)
@@ -2,6 +2,7 @@
 
    /**
     **  imap_mailbox.php
+    **
     **  Copyright (c) 1999-2001 The Squirrelmail Development Team
     **  Licensed under the GNU GPL. For full terms see the file COPYING.        
     **
index 8a1956c4e82d77efe5a561961d34fc766f1e1d8f..59e948a5b1c02ea5c22605c9328963d8ae415a53 100755 (executable)
@@ -2,6 +2,9 @@
    /**
     **  imap_messages.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  This implements functions that manipulate messages
     **
     **  $Id$
index e65126fc06e24c16ddc5a08cf992cf4709061b03..e7b432f4c7ec42e3043562672fdaa19a9d003a90 100644 (file)
 <?php
-   /******************************************************************
-    ** IMAP SEARCH ROUTIES
+
+   /**
+    **  imap_search.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  IMAP search routines
+    **
     ** $Id$
-    *****************************************************************/
-   
-   require_once('../functions/imap.php');
-   require_once('../functions/date.php');
-   require_once('../functions/array.php');
-   require_once('../functions/mailbox_display.php');
-   require_once('../functions/mime.php');
-
-
-function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
-   global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order;
-
-   $urlMailbox = urlencode($mailbox);
-   $isid = sqimap_session_id();
-
-   /* Construct the Search QuERY */
-   $ss = $isid;
-   if (isset($languages[$squirrelmail_language]['CHARSET']) &&
-       $languages[$squirrelmail_language]['CHARSET']) {
-      $ss .= " SEARCH CHARSET ".$languages[$squirrelmail_language]['CHARSET']." ALL $search_where \"$search_what\"\r\n";
-   } else {
-      $ss .= " SEARCH ALL $search_where \"$search_what\"\r\n";
-   }
-   fputs($imapConnection,$ss);
-
-   # Read Data Back From IMAP
-   $readin = sqimap_read_data ($imapConnection, $isid, false, $result, $message);
-   if (isset($languages[$squirrelmail_language]['CHARSET']) && strtolower($result) == 'no') {
-      $ss = $isid . " SEARCH CHARSET \"US-ASCII\" ALL $search_where \"$search_what\"\r\n";
-      fputs ($imapConnection, $ss);
-      $readin = sqimap_read_data ($imapConnection, $isid, true, $result, $message);
-   }
-
-   unset($messagelist); $msgs=""; $c = 0;
-
-   /* Keep going till we find the SEARCH responce */
-   while ($c < count( $readin )) {
-
-      /* Check to see if a SEARCH Responce was recived */
-      if (substr($readin[$c],0,9) == "* SEARCH ")
-         $messagelist = explode(" ",substr($readin[$c],9));
-      else if (isset($errors))
-         $errors = $errors.$readin[$c];
-      else
-         $errors = $readin[$c];
-      $c++;
-   }
-
-   #If nothing is found * SEARCH should be the first error else echo errors
-   if (isset($errors) && strstr($errors,"* SEARCH")) {
-      echo "<br><CENTER>No Messages Found</CENTER>";
-      return;
-   } else if (isset($errors)) {
-      echo "<!-- ".$errors." -->";
-   }
-
-   # HACKED CODED FROM ANOTHER FUNCTION, Could Probably dump this and mondify 
-   # exsitising code with a search true/false varible.
-
-
-   global $sent_folder;
-   for ($q = 0; $q < count($messagelist); $q++) {
-      $id[$q] = trim($messagelist[$q]);
-   }
-   $issent = ($mailbox == $sent_folder);
-   $hdr_list = sqimap_get_small_header_list($imapConnection, $id, $issent);
-   $flags = sqimap_get_flags_list($imapConnection, $id, $issent);
-   foreach ($hdr_list as $hdr) {
-      $from[] = $hdr->from;
-      $date[] = $hdr->date;
-      $subject[] = $hdr->subject;
-      $to[] = $hdr->to;
-      $priority[] = $hdr->priority;
-      $cc[] = $hdr->cc;
-      $size[] = $hdr->size;
-      $type[] = $hdr->type0;
-   }   
-
-   $j = 0;
-   while ($j < count($messagelist)) {
-         $date[$j] = ereg_replace('  ', ' ', $date[$j]);
-         $tmpdate = explode(" ", trim($date[$j]));
-
-         $messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate);
-         $messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]);
-         $messages[$j]["ID"] = $id[$j];
-         $messages[$j]["FROM"] = decodeHeader($from[$j]);
-         $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j])));
-         $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
-         $messages[$j]["SUBJECT-SORT"] = strtolower(decodeHeader($subject[$j]));
-         $messages[$j]["TO"] = decodeHeader($to[$j]);
-         $messages[$j]["PRIORITY"] = $priority[$j];
-         $messages[$j]["CC"] = $cc[$j];
-                $messages[$j]["SIZE"] = $size[$j];
-                $messages[$j]["TYPE0"] = $type[$j];
-
-         $num = 0;
-         while ($num < count($flags[$j])) {
-            if ($flags[$j][$num] == "Deleted") {
-               $messages[$j]["FLAG_DELETED"] = true;
-            }
-            else if ($flags[$j][$num] == "Answered") {
-               $messages[$j]["FLAG_ANSWERED"] = true;
-            }
-            else if ($flags[$j][$num] == "Seen") {
-               $messages[$j]["FLAG_SEEN"] = true;
+    **/
+
+
+    require_once('../functions/imap.php');
+    require_once('../functions/date.php');
+    require_once('../functions/array.php');
+    require_once('../functions/mailbox_display.php');
+    require_once('../functions/mime.php');
+
+
+    function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
+
+        global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order;
+
+        $urlMailbox = urlencode($mailbox);
+        $isid = sqimap_session_id();
+
+        /* Construct the Search QuERY */
+        $ss = $isid;
+        if (isset($languages[$squirrelmail_language]['CHARSET']) &&
+            $languages[$squirrelmail_language]['CHARSET']) {
+            $ss .= " SEARCH CHARSET ".$languages[$squirrelmail_language]['CHARSET']." ALL $search_where \"$search_what\"\r\n";
+        } else {
+            $ss .= " SEARCH ALL $search_where \"$search_what\"\r\n";
+        }
+        fputs($imapConnection,$ss);
+
+        # Read Data Back From IMAP
+        $readin = sqimap_read_data ($imapConnection, $isid, false, $result, $message);
+        if (isset($languages[$squirrelmail_language]['CHARSET']) && strtolower($result) == 'no') {
+            $ss = $isid . " SEARCH CHARSET \"US-ASCII\" ALL $search_where \"$search_what\"\r\n";
+            fputs ($imapConnection, $ss);
+            $readin = sqimap_read_data ($imapConnection, $isid, true, $result, $message);
+        }
+
+        unset($messagelist); $msgs=""; $c = 0;
+
+        /* Keep going till we find the SEARCH responce */
+        while ($c < count( $readin )) {
+
+            /* Check to see if a SEARCH Responce was recived */
+            if (substr($readin[$c],0,9) == "* SEARCH ")
+                $messagelist = explode(" ",substr($readin[$c],9));
+            else if (isset($errors))
+                $errors = $errors.$readin[$c];
+            else
+                $errors = $readin[$c];
+            $c++;
+        }
+
+        #If nothing is found * SEARCH should be the first error else echo errors
+        if (isset($errors) && strstr($errors,"* SEARCH")) {
+            echo '<br><CENTER>' . _("No Messages Found") . '</CENTER>';
+            return;
+        } else if (isset($errors)) {
+            echo "<!-- ".$errors." -->";
+        }
+
+        # HACKED CODED FROM ANOTHER FUNCTION, Could Probably dump this and mondify
+        # exsitising code with a search true/false varible.
+
+
+        global $sent_folder;
+        for ($q = 0; $q < count($messagelist); $q++) {
+            $id[$q] = trim($messagelist[$q]);
+        }
+        $issent = ($mailbox == $sent_folder);
+        $hdr_list = sqimap_get_small_header_list($imapConnection, $id, $issent);
+        $flags = sqimap_get_flags_list($imapConnection, $id, $issent);
+        foreach ($hdr_list as $hdr) {
+            $from[] = $hdr->from;
+            $date[] = $hdr->date;
+            $subject[] = $hdr->subject;
+            $to[] = $hdr->to;
+            $priority[] = $hdr->priority;
+            $cc[] = $hdr->cc;
+            $size[] = $hdr->size;
+            $type[] = $hdr->type0;
+        }
+
+        $j = 0;
+        while ($j < count($messagelist)) {
+                $date[$j] = ereg_replace('  ', ' ', $date[$j]);
+                $tmpdate = explode(" ", trim($date[$j]));
+
+                $messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate);
+                $messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]);
+                $messages[$j]["ID"] = $id[$j];
+                $messages[$j]["FROM"] = decodeHeader($from[$j]);
+                $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j])));
+                $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
+                $messages[$j]["SUBJECT-SORT"] = strtolower(decodeHeader($subject[$j]));
+                $messages[$j]["TO"] = decodeHeader($to[$j]);
+                $messages[$j]["PRIORITY"] = $priority[$j];
+                $messages[$j]["CC"] = $cc[$j];
+                $messages[$j]["SIZE"] = $size[$j];
+                $messages[$j]["TYPE0"] = $type[$j];
+
+                $num = 0;
+                while ($num < count($flags[$j])) {
+                    if ($flags[$j][$num] == 'Deleted') {
+                        $messages[$j]['FLAG_DELETED'] = true;
+                    } else if ($flags[$j][$num] == 'Answered') {
+                        $messages[$j]['FLAG_ANSWERED'] = true;
+                    } else if ($flags[$j][$num] == 'Seen') {
+                        $messages[$j]['FLAG_SEEN'] = true;
+                    } else if ($flags[$j][$num] == 'Flagged') {
+                        $messages[$j]['FLAG_FLAGGED'] = true;
+                    }
+                    $num++;
+                }
+                $j++;
+        }
+
+        /** Find and remove the ones that are deleted */
+        $i = 0;
+        $j = 0;
+        while ($j < count($messagelist)) {
+            if (isset($messages[$j]["FLAG_DELETED"]) && $messages[$j]["FLAG_DELETED"] == true) {
+                $j++;
+                continue;
             }
-            else if ($flags[$j][$num] == "Flagged") {
-               $messages[$j]["FLAG_FLAGGED"] = true;
-            }
-            $num++;
-         }
-         $j++;
-   }
-
-      /** Find and remove the ones that are deleted */
-      $i = 0;
-      $j = 0;
-      while ($j < count($messagelist)) {
-         if (isset($messages[$j]["FLAG_DELETED"]) && $messages[$j]["FLAG_DELETED"] == true) {
-            $j++;
-            continue;
-         }
-         $msgs[$i] = $messages[$j];
-
-         $i++;
-         $j++;
-      }
-      $numMessages = $i;
-
-      // There's gotta be messages in the array for it to sort them.
-
-      if (count($messagelist) > 0) {
-         $j=0;
-                if (!isset ($msg)) { $msg = ""; }
-         mail_message_listing_beginning($imapConnection, 
-            "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=".urlencode($search_where)."&what=".urlencode($search_what),
-             $mailbox, -1, '<b>' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '</b>',
-             '&nbsp;');
-         
-         while ($j < count($msgs)) {
-            printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what);
+            $msgs[$i] = $messages[$j];
+
+            $i++;
             $j++;
-         }
-         echo '</table></tr></td></table>';
-      }
-   }
+        }
+        $numMessages = $i;
+
+        // There's gotta be messages in the array for it to sort them.
+
+        if (count($messagelist) > 0) {
+            $j=0;
+            if (!isset ($msg)) { $msg = ""; }
+            mail_message_listing_beginning($imapConnection,
+                "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=".urlencode($search_where)."&what=".urlencode($search_what),
+                $mailbox, -1, '<b>' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '</b>',
+                '&nbsp;');
+
+
+            while ($j < count($msgs)) {
+                printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what);
+                $j++;
+            }
+            echo '</table></tr></td></table>';
+        }
+    }
 
-?>
+?>
\ No newline at end of file
index a7e265088bad49796e37fd55793094819dadebb8..ac36ecda8f044633d91002629dde632be0b3f74f 100644 (file)
@@ -2,13 +2,19 @@
     /**
     ** index.php
     **
-    ** This file simply takes any attempt to view source files
-    ** and sends those people to the login screen. At this
-    ** point no attempt is made to see if the person is logged
-    ** or not.
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  This file simply takes any attempt to view source files
+    **  and sends those people to the login screen. At this
+    **  point no attempt is made to see if the person is logged
+    **  or not.
+    **
+    **  $Id$
     **/
 
     header("Location:../index.php");
 
     /** pretty impressive huh? **/
-?>
+
+?>
\ No newline at end of file
index d0f620131b93e1d91b6daa048bb0c9514107d8da..aeb5285bb2bf03b136d95eb9ac52da6cd6a8ffe9 100644 (file)
@@ -1,15 +1,16 @@
 <?php
+
    /**
-    * mailbox_display.php
-    *
-    * Copyright (c) 1999-2001 The Squirrelmail Development Team
-    * Licensed under the GNU GPL. For full terms see the file COPYING.
-    *
-    * This contains functions that display mailbox information, such as the
-    * table row that has sender, date, subject, etc...
-    *
-    * $Id$
-    */
+    * mailbox_display.php
+    **
+    * Copyright (c) 1999-2001 The Squirrelmail Development Team
+    * Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    * This contains functions that display mailbox information, such as the
+    * table row that has sender, date, subject, etc...
+    **
+    * $Id$
+    **/
 
    define('PG_SEL_MAX', 10);  /* Default value for page_selector_max. */
 
       /* Loop through and display the info for each message. */
       $t = 0; // $t is used for the checkbox number
       if ($num_msgs == 0) { // if there's no messages in this folder
-          echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=" . count($index_order) . ">\n";
-          echo "  <CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR>&nbsp;</CENTER>\n";
-          echo "</TD></TR>";
+          echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=" . count($index_order) . ">\n".
+               "  <CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR>&nbsp;</CENTER>\n".
+               "</TD></TR>";
       } else if ($start_msg == $end_msg) {
           /* If there's only one message in the box, handle it differently. */
           if ($sort != 6) {
           } while ($i && $i < $endVar);
       }
 
-      echo '</table>';
-      echo "<table bgcolor=\"$color[9]\" width=100% border=0 cellpadding=1 cellspacing=1>" .
+      echo '</table>'.
+           "<table bgcolor=\"$color[9]\" width=100% border=0 cellpadding=1 cellspacing=1>" .
               "<tr BGCOLOR=\"$color[4]\">" .
                  "<table width=100% BGCOLOR=\"$color[4]\" border=0 cellpadding=1 cellspacing=0><tr><td>$paginator_str</td>".
                  "<td align=right>$msg_cnt_str</td></tr></table>".
        * This is the beginning of the message list table. *
        * It wraps around all messages                     *
        ****************************************************/
-      echo "<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\">\n";
-
-      echo "<TR BGCOLOR=\"$color[0]\"><TD>";
-      echo "  <TABLE BGCOLOR=\"$color[4]\" width=\"100%\" CELLPADDING=\"2\" CELLSPACING=\"0\" BORDER=\"0\"><TR>\n";
-      echo "    <TD ALIGN=LEFT>$paginator</TD>\n";
-      echo '    <TD ALIGN=CENTER>' . get_selectall_link($start_msg, $sort) . "</TD>\n";
-      echo "    <TD ALIGN=RIGHT>$msg_cnt_str</TD>\n";
-      echo "  </TR></TABLE>\n";
-      echo "</TD></TR>";
-
-      /** The delete and move options */
-      echo "<TR><TD BGCOLOR=\"$color[0]\">";
-
-      echo "\n<FORM name=messageList method=post action=\"$moveURL\">\n";
-      echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0 cellpadding=0 cellspacing=0 width=100%>\n";
-
-      echo "   <TR>\n" .
+      echo "<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\">\n".
+           "<TR BGCOLOR=\"$color[0]\"><TD>".
+             "<TABLE BGCOLOR=\"$color[4]\" width=\"100%\" CELLPADDING=\"2\" CELLSPACING=\"0\" BORDER=\"0\"><TR>\n".
+           "    <TD ALIGN=LEFT>$paginator</TD>\n".
+           '    <TD ALIGN=CENTER>' . get_selectall_link($start_msg, $sort) . "</TD>\n".
+           "    <TD ALIGN=RIGHT>$msg_cnt_str</TD>\n".
+           "  </TR></TABLE>\n".
+           '</TD></TR>'.
+           "<TR><TD BGCOLOR=\"$color[0]\">\n".
+           "<FORM name=messageList method=post action=\"$moveURL\">\n".
+           "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0 cellpadding=0 cellspacing=0 width=100%>\n".
+           "   <TR>\n" .
            "      <TD ALIGN=LEFT VALIGN=CENTER NOWRAP>\n" .
            '         <SMALL>&nbsp;' . _("Move selected to:") . "</SMALL>\n" .
            "      </TD>\n" .
             echo "         <OPTION VALUE=\"$box\">$box2</option>\n";
          }
       }
-      echo '         </SELECT></TT></SMALL>';
-      echo "         <SMALL><INPUT TYPE=SUBMIT NAME=\"moveButton\" VALUE=\"" . _("Move") . "\"></SMALL>\n";
-      echo "      </TD>\n";
-      echo "      <TD ALIGN=RIGHT NOWRAP>&nbsp;&nbsp;&nbsp;\n";
+      echo '         </SELECT></TT></SMALL>'.
+                    "<SMALL><INPUT TYPE=SUBMIT NAME=\"moveButton\" VALUE=\"" . _("Move") . "\"></SMALL>\n".
+           "      </TD>\n".
+           "      <TD ALIGN=RIGHT NOWRAP>&nbsp;&nbsp;&nbsp;\n";
       if (!$auto_expunge) {
          echo '         <INPUT TYPE=SUBMIT NAME="expungeButton" VALUE="'. _("Expunge") .'">&nbsp;'. _("mailbox") ."&nbsp;\n";
       }
-      echo "         <INPUT TYPE=SUBMIT NAME=\"markRead\" VALUE=\"". _("Read")."\">\n";
-      echo "         <INPUT TYPE=SUBMIT NAME=\"markUnread\" VALUE=\"". _("Unread")."\">\n";
-      echo "         <INPUT TYPE=SUBMIT VALUE=\"". _("Delete") . "\">&nbsp;\n";
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-      echo "</TABLE>\n";
+      echo "         <INPUT TYPE=SUBMIT NAME=\"markRead\" VALUE=\"". _("Read")."\">\n".
+           "         <INPUT TYPE=SUBMIT NAME=\"markUnread\" VALUE=\"". _("Unread")."\">\n".
+           "         <INPUT TYPE=SUBMIT VALUE=\"". _("Delete") . "\">&nbsp;\n".
+           "      </TD>\n".
+           "   </TR>\n".
+           "</TABLE>\n";
       do_hook('mailbox_form_before');
-      echo '</TD></TR>';
+      echo '</TD></TR>'.
 
-      echo "<TR><TD BGCOLOR=\"$color[0]\">";
-      echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=";
+           "<TR><TD BGCOLOR=\"$color[0]\">".
+           "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=";
       if ($GLOBALS['alt_index_colors']) {
         echo "0";
       } else {
         echo "1";
       }
-      echo " BGCOLOR=\"$color[0]\">";
-      echo "<TR BGCOLOR=\"$color[5]\" ALIGN=\"center\">";
+      echo " BGCOLOR=\"$color[0]\">".
+           "<TR BGCOLOR=\"$color[5]\" ALIGN=\"center\">";
 
       /* Print the headers. */
       for ($i=1; $i <= count($index_order); $i++) {
                    echo '   <TD WIDTH="25%"><B>'. _("From") .'</B>';
                }
 
-           ShowSortButton($sort, $mailbox, 2, 3);
+               ShowSortButton($sort, $mailbox, 2, 3);
                echo "</TD>\n";
                break;
 
       return substr($subject, 0, $trim_val) . '...';
    }
 
-?>
+?>
\ No newline at end of file
index 750a48ae4eb81e8236cc74ad5a035d5ff3b89fea..a790fb20740eff3daa19cc1362fcf2983dce4981 100644 (file)
@@ -1,5 +1,9 @@
 <?php
+
    /** mime.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
     ** This contains the functions necessary to detect and decode MIME
     ** messages.
index a205bbf62687537969b0c09e9561c87834f3dbbe..c944f995dfb889b1cf87984142017e1752032250 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
     /**
      * options.php
      *
index e664170e26bbfeec19b360a492fdbd594bbcf6a3..3afdeef122aae02e436b5ca8af13256d383878d8 100644 (file)
@@ -2,6 +2,9 @@
    /**
     **  page_header.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  Prints the page header (duh)
     **
     **  $Id$
 
       /** Here is the header and wrapping table **/
       $shortBoxName = readShortMailboxName($mailbox, $delimiter);
-      echo "<A NAME=pagetop></A>\n";
-      // echo "<table cellpadding=1 cellspacing=1 BGCOLOR=\"$color[4]\" width=100%><tr><td>";
-      echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
-      echo "   <TR BGCOLOR=\"$color[9]\" >\n";
-      echo "      <TD ALIGN=left><b>\n";
+      echo "<A NAME=pagetop></A>\n".
+      // "<table cellpadding=1 cellspacing=1 BGCOLOR=\"$color[4]\" width=100%><tr><td>".
+           "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
+           "   <TR BGCOLOR=\"$color[9]\" >\n".
+           "      <TD ALIGN=left><b>\n";
       displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
-      echo "      </b></TD><TD ALIGN=right>\n";
-      echo '         ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n";
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-      echo "   <TR BGCOLOR=\"$color[4]\">\n";
-      echo "      <TD ALIGN=left>\n";
+      echo "      </b></TD><TD ALIGN=right>\n".
+           '         ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
+           "      </TD>\n".
+           "   </TR>\n".
+           "   <TR BGCOLOR=\"$color[4]\">\n".
+           "      <TD ALIGN=left>\n";
       $urlMailbox = urlencode($mailbox);
       displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
       echo "&nbsp;&nbsp;\n";
       echo "      </TD><TD ALIGN=right>\n";
       echo ($hide_sm_attributions ? '&nbsp;' :
             "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-      echo "</TABLE>\n\n";
+      echo "      </TD>\n".
+           "   </TR>\n".
+           "</TABLE>\n\n";
       // echo "</td></tr></table>";
   }
-?>
+
+?>
\ No newline at end of file
index 7d209e844818d68e3feeca9676d0921db57f561b..bb77c0685fa4c4aff4e1e30bbb40b471a32acc82 100644 (file)
@@ -1,18 +1,16 @@
 <?php
 
-    /**
-    ** plugin.php
+   /**
+    **  plugin.php
     **
-    ** This file provides the framework for a plugin architecture.
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
-    ** Plugins will eventually be a way to provide added functionality
-    ** without having to patch the SquirrelMail source code. Have some
-    ** patience, though, as the these funtions might change in the near
-    ** future.
+    **  This file provides the framework for a plugin architecture.
     **
-    ** Documentation on how to write plugins might show up some time.
+    **  Documentation on how to write plugins might show up some time.
     **
-    ** $Id$
+    **  $Id$
     **/
 
     global $squirrelmail_plugin_hooks;
index 210e9e3cdee59da7dd3cdd73a5270660d10c180b..1b70943c8d1bb086bce7dede3088981431b7fffb 100644 (file)
@@ -1,7 +1,11 @@
 <?php
+
    /**
     **  prefs.php
     **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  This contains functions for manipulating user preferences
     **
     **  $Id$
index c2b433078c08fcf3e7bae13351c0a2abe3aa6024..221ae0ec09e9a00690ffc763bb33296e40526350 100644 (file)
@@ -1,5 +1,9 @@
 <?php
+
    /** smtp.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
     ** This contains all the functions needed to send messages through
     ** an smtp server or sendmail.
index 4cd1388ae304e4b7f00f1c3fc0682742d36cb8a0..a9d8c063f016220933f48daea62dcd8314dca7b3 100644 (file)
@@ -1,13 +1,14 @@
 <?php
    /**
-    * strings.php
-    * Copyright (c) 1999-2001 The Squirrelmail Development Team
-    * Licensed under the GNU GPL. For full terms see the file COPYING.
-    *
-    * This code provides various string manipulation functions that are
-    * used by the rest of the Squirrelmail code.
-    *
-    * $Id$
+    **  strings.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  This code provides various string manipulation functions that are
+    **  used by the rest of the Squirrelmail code.
+    **
+    **  $Id$
     */
 
    /**
index 3e139252a3b261827406b9b9208fa6aac3026768..6265e15f7b534ccd4e7594ae3f2d4b0f6361691a 100644 (file)
@@ -1,14 +1,15 @@
 <?php
 
    /**
-    * tree.php
-    * Copyright (c) 1999-2001 The Squirrelmail Development Team
-    * Licensed under the GNU GPL. For full terms see the file COPYING.
-    *
-    * This code provides various string manipulation functions that are
-    * used by the rest of the Squirrelmail code.
-    *
-    * $Id$
+    **  tree.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  This code provides various string manipulation functions that are
+    **  used by the rest of the Squirrelmail code.
+    **
+    **  $Id$
     */
 
    require_once('../functions/imap.php');
index 37b022c4d29738e98a30891a64438bbfe8c89620..3e20d76325ece638490bfa36c3519d21ac932575 100644 (file)
@@ -1,15 +1,16 @@
 <?php
 
    /**
-    * url_parser.php
-    * Copyright (c) 1999-2001 The Squirrelmail Development Team
-    * Licensed under the GNU GPL. For full terms see the file COPYING.
-    *
-    * This code provides various string manipulation functions that are
-    * used by the rest of the Squirrelmail code.
-    *
-    * $Id$
-    */
+    **  url_parser.php
+    **
+    **  Copyright (c) 1999-2001 The Squirrelmail Development Team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  This code provides various string manipulation functions that are
+    **  used by the rest of the Squirrelmail code.
+    **
+    **  $Id$
+    **/
 
    function replaceBlock (&$in, $replace, $start, $end) {
       $begin = substr($in,0,$start);