Added a constat to all files in functions/ to be able to chech whether the
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Mar 2000 08:44:35 +0000 (08:44 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Mar 2000 08:44:35 +0000 (08:44 +0000)
file has already been included.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@255 7612ce4b-ef26-0410-bec9-ea0150e637f0

25 files changed:
functions/array.php
functions/date.php
functions/display_messages.php
functions/imap.php
functions/mailbox_display.php
functions/mime.php
functions/page_header.php
functions/prefs.php
functions/smtp.php
functions/strings.php
src/compose.php
src/delete_message.php
src/download.php
src/folders.php
src/folders_create.php
src/folders_delete.php
src/folders_rename_do.php
src/folders_rename_getname.php
src/left_main.php
src/login.php
src/move_messages.php
src/options.php
src/options_submit.php
src/read_body.php
src/right_main.php

index adccf77..8432ee6 100644 (file)
@@ -7,6 +7,8 @@
     **
     **/
 
+   $array_php = true;
+
    function ary_sort($ary,$col, $dir = 1){
       // The globals are used because USORT determines what is passed to comp2
       // These should be $this->col and $this->dir in a class
index b4b1a7f..a3403f9 100644 (file)
@@ -9,6 +9,8 @@
     **
     **/
 
+   $date_php = true;
+
    function getMinutes($hour) {
       $date = $hour;
 
        **        and everything would be bumped up one.
        **/
 
-      // Simply check to see if the first element in the dateParts array is an integer or not.
+      // Simply check to see if the first element in the dateParts
+      // array is an integer or not.
       //    Since the day of week is optional, this check is needed.  
       //    
-      //    The old code used eregi("mon|tue|wed|thu|fri|sat|sun", $dateParts[0], $tmp) 
-      //    to find if the first element was the day of week or day of month.  This is an
-      //    expensive call (processing time) to have inside a loop.  Doing it this way saves
-      //    quite a bit of time for large mailboxes.
+      //    The old code used eregi("mon|tue|wed|thu|fri|sat|sun",
+      //    $dateParts[0], $tmp) to find if the first element was the
+      //    day of week or day of month. This is an expensive call
+      //    (processing time) to have inside a loop. Doing it this way
+      //    saves quite a bit of time for large mailboxes.
       //
-      //    It is also quicker to call explode only once rather than the 3 times it was getting
-      //    called by calling the functions getHour, getMinute, and getSecond.
+      //    It is also quicker to call explode only once rather than
+      //    the 3 times it was getting called by calling the functions
+      //    getHour, getMinute, and getSecond.
       //
       if (intval(trim($dateParts[0])) > 0) {
          $time = explode(":", $dateParts[3]);
       return getGMTSeconds(mktime($d[0], $d[1], $d[2], $d[3], $d[4], $d[5]), $dateParts[5]);
    }
 
-   // I use this function for profiling.  Should never be called in actual versions of squirrelmail
-   //    released to public.
+   // I use this function for profiling. Should never be called in
+   // actual versions of squirrelmail released to public.
    function getmicrotime() {
       $mtime = microtime();
       $mtime = explode(" ",$mtime);
index fdfba0a..c73dea1 100644 (file)
@@ -7,6 +7,8 @@
     **
     **/
 
+    $display_messages_php = true;
+
     function error_username_password_incorrect($color) {
       echo "<BR>";
       echo "<TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
index 1bf3a24..1ef7ace 100644 (file)
@@ -2,6 +2,8 @@
    /**  This just includes the different sections of the imap functions.
     **  They have been organized into these sections for simplicity sake.
     **/
+
+   $imap_php = true;
    
    include ("../functions/imap_mailbox.php");
    include ("../functions/imap_messages.php");
index ed7e123..7ec2a6f 100644 (file)
@@ -8,6 +8,8 @@
     **
     **/
 
+   $mailbox_info = true;
+
    function printMessageInfo($imapConnection, $t, $i, $from, $subject, $dateString, $answered, $seen, $mailbox, $sort, $startMessage) {
       require ("../config/config.php");
 
index 2ff5d65..8b364a3 100644 (file)
@@ -1,9 +1,12 @@
 <?
    /** mime.php
     **
-    ** This contains the functions necessary to detect and decode MIME messages.
+    ** This contains the functions necessary to detect and decode MIME
+    ** messages.
+    **
     **/
 
+   $mime_php = true;
 
    if (!isset($i18n_php))
       include "../functions/i18n.php";
                $p = 0;
 
                /** Lets find the header for this entity **/
-               /** If the first line after the boundary is blank, we use default values **/
+               /** If the first line after the boundary is blank, we
+                   use default values **/
                if (trim($body[$j]) == "") {
                   $ent_type0 = "text";
                   $ent_type1 = "plain";
                   $charset = "us-ascii";
                   $j++;
-               /** If the first line ISNT blank, read in the header for this entity **/
+               /** If the first line ISNT blank, read in the header
+                   for this entity **/
                } else {
                   while ((substr(trim($body[$j]), 0, strlen("--$bound")) != "--$bound") && (trim($body[$j]) != "")) {
                      $entity_header[$p] = $body[$j];
@@ -39,7 +44,8 @@
                }
 
 
-               /** OK, we have the header information, now lets decide what to do with it **/
+               /** OK, we have the header information, now lets decide
+                   what to do with it **/
                if ($ent_type0 == "multipart") {
                   $y = 0;
                   while (substr($body[$j], 0, strlen("--$bound--")) != "--$bound--") {
       return false;
    }
 
-   /** This returns a parsed string called $body.  That string can then be displayed
-       as the actual message in the HTML.   It contains everything needed, including
-       HTML Tags, Attachments at the bottom, etc.
+   /** This returns a parsed string called $body. That string can then
+       be displayed as the actual message in the HTML. It contains
+       everything needed, including HTML Tags, Attachments at the
+       bottom, etc.
     **/
    function formatBody($message, $color, $wrap_at) {
 
-      /** this if statement checks for the entity to show as the primary message.  To
-          add more of them, just put them in the order that is their priority.
+      /** this if statement checks for the entity to show as the
+          primary message. To add more of them, just put them in the
+          order that is their priority.
        **/
       $id = $message["INFO"]["ID"];
       $urlmailbox = urlencode($message["INFO"]["MAILBOX"]);
          }
       }
 
-      /** If there are other types that shouldn't be formatted, add them here **/
+      /** If there are other types that shouldn't be formatted, add
+          them here **/
       if ($message["ENTITIES"][$ent_num]["TYPE1"] != "html")
          $body = translateText($body, $wrap_at);
 
index cd4ba6a..2887a9a 100644 (file)
@@ -6,6 +6,8 @@
     **
     **/
 
+   $page_header_php = true;
+
    // This is done to ensure that the character set is correct when
    // receiving input from HTTP forms
    header ("Content-Type: text/html; charset=iso-8859-1");
index 097c2da..254d10c 100644 (file)
@@ -5,6 +5,8 @@
     **  This contains functions for manipulating user preferences
     **/
 
+   $prefs_php = true;
+
    /** returns the value for $string **/
    function getPref($data_dir, $username, $string) {
       $filename = "$data_dir$username.pref";
@@ -69,7 +71,8 @@
 
 
 
-   /** This checks if there is a pref file, if there isn't, it will create it. **/
+   /** This checks if there is a pref file, if there isn't, it will
+       create it. **/
    function checkForPrefs($data_dir, $username) {
       $filename = "$data_dir$username.pref";
       if (!file_exists($filename)) {
index 9859c7e..7beb63c 100644 (file)
@@ -5,6 +5,7 @@
     ** an smtp server or sendmail.
     **/
 
+   $smtp_php = true;
 
    // Returns true only if this message is multipart
    function isMultipart () {
index 2f7a92a..2fd536e 100644 (file)
@@ -1,5 +1,7 @@
 <?
 
+   $strings_php = true;
+
    //*************************************************************************
    // Count the number of occurances of $needle are in $haystack.
    //*************************************************************************
index d3416b2..ba3f2a5 100644 (file)
@@ -7,14 +7,22 @@
     **  - Send mail
     **/
 
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/date.php");
-   include("../functions/mime.php");
-   include("../functions/smtp.php");
-   include("../functions/display_messages.php");
+   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($date_php))
+      include("../functions/date.php");
+   if (!isset($mime_php))
+      include("../functions/mime.php");
+   if (!isset($smtp_php))
+      include("../functions/smtp.php");
+   if (!isset($display_messages_php))
+      include("../functions/display_messages.php");
 
    include("../src/load_prefs.php");
 
index 8c1a12d..5518624 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/display_messages.php");
-   include("../functions/imap.php");
+   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($display_message_php))
+      include("../functions/display_messages.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
 
    include("../src/load_prefs.php");
 
index 2a5b1a6..f8a334d 100644 (file)
@@ -1,10 +1,16 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/mime.php");
-   include("../functions/date.php");
+   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($mime_php))
+      include("../functions/mime.php");
+   if (!isset($date_php))
+      include("../functions/date.php");
 
    include("../src/load_prefs.php");
 
index 75363d0..f35b84d 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
+   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($array_php))
+      include("../functions/array.php");
 
    include("../src/load_prefs.php");
 
index 3c95663..4e42dd1 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/display_messages.php");
+   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");
 
index e22f8c2..d4c493e 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
+   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($array_php))
+      include("../functions/array.php");
 
    include("../src/load_prefs.php");
 
index b5d04d0..0366c72 100644 (file)
@@ -1,8 +1,12 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
+   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");
 
    include("../src/load_prefs.php");
 
index d5fb288..0aa812b 100644 (file)
@@ -1,8 +1,12 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
+   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");
 
    include("../src/load_prefs.php");
 
index a674eaa..9079b7e 100644 (file)
 ?>
 <HTML>
 <?
-   include("../config/config.php");
-   include("../functions/array.php");
-   include("../functions/strings.php");
-   include("../functions/imap.php");
+   if (!isset($config_php))
+      include("../config/config.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
 
    function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) {
       require ("../config/config.php");
index 8ae5ea3..1367b92 100644 (file)
 ?>
 <HTML>
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
+   if (!isset($config_php))
+      include("../config/config.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
 
    echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
  
index 33967ba..dbe4b68 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/display_messages.php");
-   include("../functions/imap.php");
+   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($display_messages_php))
+      include("../functions/display_messages.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
 
    include("../src/load_prefs.php");
 
@@ -14,8 +19,9 @@
       $i = 0;
       $firstLoop = true;
       
-      // If they have selected nothing msg is size one still, but will be an infinite
-      //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
+      // If they have selected nothing msg is size one still, but will
+      // be an infinite loop because we never increment j. so check to
+      // see if msg[0] is set or not to fix this.
       while (($j < count($msg)) && ($msg[0])) {
          if ($msg[$i]) {
             if ($firstLoop != true)
index 39ce568..e13c771 100644 (file)
@@ -1,10 +1,16 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/display_messages.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
+   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($display_messages_php))
+      include("../functions/display_messages.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
 
    include("../src/load_prefs.php");
 
index 58cb15e..21bd239 100644 (file)
@@ -1,10 +1,16 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/display_messages.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
+   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($dipslay_messages_php))
+      include("../functions/display_messages.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
 
    include("../src/load_prefs.php");
 
index de61e2d..bf3d1c9 100644 (file)
@@ -1,10 +1,16 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/mime.php");
-   include("../functions/date.php");
+   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($mime_php))
+      include("../functions/mime.php");
+   if (!isset($date_php))
+      include("../functions/date.php");
 
    include("../src/load_prefs.php");
 
index b87ea8d..3d48d1b 100644 (file)
       exit;
    }
 
-   include("../config/config.php");
-   include("../functions/imap.php");
-   include("../functions/strings.php");
-   include("../functions/date.php");
-   include("../functions/page_header.php");
-   include("../functions/array.php");
-   include("../functions/mime.php");
-   include("../functions/mailbox_display.php");
-   include("../functions/display_messages.php");
+   if (!isset($config_php))
+      include("../config/config.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+   if (!isset($date_php))
+      include("../functions/date.php");
+   if (!isset($page_header_php))
+      include("../functions/page_header.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
+   if (!isset($mime_php))
+      include("../functions/mime.php");
+   if (!isset($mailbox_display_php))
+      include("../functions/mailbox_display.php");
+   if (!isset($display_messages_php))
+      include("../functions/display_messages.php");
 ?>
 <HTML>
 <FONT FACE="Arial,Helvetica">