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 adccf776650b01cb17b87963d1a0b00f89c962f9..8432ee6d440905fed69a13b4020190ddcf6d226e 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 b4b1a7f8398bf6d4fce5f32c9a7a30591411f181..a3403f95688ae344dfc49b9070dd0480802627ca 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 fdfba0a3e36936d51f31a2a56ae7faaab2d7eb10..c73dea1afcc3121bd7d6b8688049385a7fb35a96 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 1bf3a248048c2be843095c2e0958025841130732..1ef7ace33eb5a6a60ce8d510c23db715fa68a41b 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 ed7e12369fb5e0f433d064362e6e1dd26511a5e3..7ec2a6f72475c68530c3472b06f45299138c0849 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 2ff5d656e4ba2178b79260f4e2996512f7307879..8b364a37ea2e949addcbc07caa7eda70d161ee29 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 cd4ba6ae9279f863690ffa9e002c149b415154c2..2887a9a44c947ddc0acf8273c6253c0fd6f68947 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 097c2dac2d0bc53a9ab4a92a8a73c129962096d7..254d10cc54e48c6b16283b28551805f01fb7f733 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 9859c7edecb9478384f00972ae68c48cb5fc2a05..7beb63ce452460b64e2ad5abdad44f42bbb5deb0 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 2f7a92a531ee114739a4b263b93b26d721189cb8..2fd536e859fe58afee0bcc2bb7ccd3064d6cc187 100644 (file)
@@ -1,5 +1,7 @@
 <?
 
+   $strings_php = true;
+
    //*************************************************************************
    // Count the number of occurances of $needle are in $haystack.
    //*************************************************************************
index d3416b220e4549a79f7e1cccd18567dc22a1f16f..ba3f2a51693b272f6e7eeb18405e6c5bec71cd3e 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 8c1a12dec0bbf26124143df567f82b5267944c8c..5518624b613ef24e1a2e15bdc644491b974c1079 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 2a5b1a620e8e6a66ded13af15070ca0a6a670d7d..f8a334d180b98465c4ba92fd0e356e109034d43a 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 75363d03d8047cccd8c74de842e6ac924f06acf7..f35b84d8a224dfcad694932c1a0a5bb89fed3854 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 3c95663b035ad921f056efc773dad2f6c0aa81a8..4e42dd14a39e7a764864ca4d2883ceae96aa2daf 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 e22f8c26122c5bd76b39f2ef674336d73f58b8b5..d4c493e79927c234d9ae0e4f2559c9504f6751e7 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 b5d04d04bfbd0717474c9d3228ba305a024a097a..0366c728edeee13052f22dde057ee6adf8a1ebae 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 d5fb28842e73a8a1ec6612ba1a1a4c925e2b32c8..0aa812ba0865a3837b9c353f065249c5c178f42e 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 a674eaaf75f793a1bbc545f825bd3deaeb3244fd..9079b7e5541a309312065ff9522b290d705a294b 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 8ae5ea37d8cd8fa67c68f8bf7807fa909b04b8d3..1367b92ffa1782f9f429c9a75dd394e28e630001 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 33967ba42c639dddbe3f619c511e751606cf777e..dbe4b68bbef3b63aed0f6611342b7107f8c59866 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 39ce5680210caa6eb18b45da7e4b64b103968e44..e13c771057fbf5d191971467464435884f4f6757 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 58cb15ec45902be8c1be6e23653d58822f5a7ef7..21bd2399efea4c7297b61896eff54fc6c3996e8f 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 de61e2d8a2a53dc67036b1b7fc2c233a1a5fdf1b..bf3d1c9b90da22cabd766339f761c0bd1db60e1f 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 b87ea8d40335de4902b7ef517952808739d7a064..3d48d1ba6afecc9fab3ec46b6f22d05a1f737b35 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">