Part 1 of switch to use of SM_PATH with require_once.
authorthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 6 Sep 2002 00:19:37 +0000 (00:19 +0000)
committerthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 6 Sep 2002 00:19:37 +0000 (00:19 +0000)
Feel free to convert things in functions/, class/, plugins/, etc too. I
have everything in src/ done.

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

41 files changed:
src/addrbook_popup.php
src/addrbook_search.php
src/addrbook_search_html.php
src/addressbook.php
src/compose.php
src/delete_message.php
src/download.php
src/draft_actions.php
src/empty_trash.php
src/folders.php
src/folders_create.php
src/folders_delete.php
src/folders_rename_do.php
src/folders_rename_getname.php
src/folders_subscribe.php
src/help.php
src/image.php
src/left_main.php
src/load_prefs.php
src/login.php
src/move_messages.php
src/options.php
src/options_folder.php
src/options_highlight.php
src/options_identities.php
src/options_order.php
src/options_personal.php
src/printer_friendly_bottom.php
src/printer_friendly_main.php
src/printer_friendly_top.php
src/read_body.php
src/redirect.php
src/retrievalerror.php
src/right_main.php
src/search.php
src/signout.php
src/validate.php
src/vcard.php
src/view_header.php
src/view_text.php
src/webmail.php

index c38a379..c459762 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/addressbook.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/addressbook.php');
    
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
index 7fd7ee8..e6bedde 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* Function to include JavaScript code */
 function insert_javascript() {
index 54de9f8..0614557 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/date.php');
-require_once('../functions/smtp.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/addressbook.php');
-require_once('../functions/plugin.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/smtp.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/addressbook.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* Insert hidden data */
 function addr_insert_hidden() {
index 9f8e039..5f2907b 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/array.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/addressbook.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/addressbook.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* Make an input field */
 function adressbook_inp_field($label, $field, $name, $size, $values, $add) {
index 73ff63f..b0b8257 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/date.php');
-require_once('../functions/mime.php');
-//require_once('../functions/smtp.php');
-require_once('../functions/plugin.php');
-require_once('../functions/display_messages.php');
-require_once('../class/deliver/Deliver.class.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/mime.php');
+//require_once(SM_PATH . 'functions/smtp.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'class/deliver/Deliver.class.php');
 
 /* --------------------- Specific Functions ------------------------------ */
 
@@ -1206,7 +1210,7 @@ function sendMessage($composeMessage, $draft=false) {
     $composeMessage->rfc822_header = $rfc822_header;
 
     if (!$useSendmail && !$draft) {
-       require_once('../class/deliver/Deliver_SMTP.class.php');
+       require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
        $deliver = new Deliver_SMTP();
        global $smtpServerAddress, $smtpPort, $use_authenticated_smtp, $pop_before_smtp;
        if ($use_authenticated_smtp) {
@@ -1221,18 +1225,18 @@ function sendMessage($composeMessage, $draft=false) {
        $stream = $deliver->initStream($composeMessage,$domain,0,
                          $smtpServerAddress, $smtpPort, $authPop);
     } elseif (!$draft) {
-       require_once('../class/deliver/Deliver_SendMail.class.php');
+       require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
        global $sendmail_path;
        $deliver = new Deliver_SendMail();
        $stream = $deliver->initStream($composeMessage,$sendmail_path);
     } elseif ($draft) {
        global $draft_folder;
-       require_once('../class/deliver/Deliver_IMAP.class.php');
+       require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
        $imap_deliver = new Deliver_IMAP();
        $imap_stream = sqimap_login($username, $key, $imapServerAddress,
                       $imapPort, 0);
        if (sqimap_mailbox_exists ($imap_stream, $draft_folder)) {
-           require_once('../class/deliver/Deliver_IMAP.class.php');
+           require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
            $imap_deliver = new Deliver_IMAP();
            $length = $imap_deliver->mail($composeMessage);
            sqimap_append ($imap_stream, $draft_folder, $length);        
@@ -1258,7 +1262,7 @@ function sendMessage($composeMessage, $draft=false) {
         $imapPort, 0);
        if (sqimap_mailbox_exists ($imap_stream, $sent_folder)) {
            sqimap_append ($imap_stream, $sent_folder, $length);
-           require_once('../class/deliver/Deliver_IMAP.class.php');
+           require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
            $imap_deliver = new Deliver_IMAP();
            $imap_deliver->mail($composeMessage, $imap_stream);
            sqimap_append_done ($imap_stream);
index 7cc08b1..711a665 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
index 7778bb7..f3ec577 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/mime.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/mime.php');
 
 header('Pragma: ');
 header('Cache-Control: cache');
index 1bb549a..b6c0afd 100644 (file)
@@ -9,7 +9,11 @@
  * $Id$
  */
 
-require_once ('../src/validate.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
 
 /* Print all the needed RFC822 headers */
 function write822HeaderForDraft ($fp, $t, $c, $b, $subject, $more_headers, $session) {
index 18d89d9..c3d79a5 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/tree.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/tree.php');
 
 $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
index 69ee1a2..c010636 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap_utf7_decode_local.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/plugin.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap_utf7_decode_local.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/html.php');
 
 displayPageHeader($color, 'None');
 
index d3309f6..3a5da96 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/display_messages.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/display_messages.php');
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 global $delimiter;
index 6775f67..fd501b8 100644 (file)
  * $Id$
  */
 
-
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/tree.php');
-require_once('../functions/display_messages.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/tree.php');
+require_once(SM_PATH . 'functions/display_messages.php');
 
 /*
 *  Incoming values:
index 79175d1..2918ea5 100644 (file)
 
 global $delimiter, $base_uri;
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
 
 $new_name = trim($new_name);
 
index 633c3ea..ab147e2 100644 (file)
 
 global $delimiter;
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/html.php');
 
 if ($old == '') {
     displayPageHeader($color, 'None');
index ae7eb17..f49f562 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/display_messages.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/display_messages.php');
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
index 3c3d838..e72d3bc 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
 
 displayPageHeader($color, 'None' );
 
index 776549d..ca830b5 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/date.php');
-require_once('../functions/page_header.php');
-require_once('../functions/html.php');
-require_once('../src/load_prefs.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/html.php');
+require_once(SM_PATH . 'src/load_prefs.php');
 
 displayPageHeader($color, 'None');
 
index 16f8bd4..6b91905 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/array.php');
-require_once('../functions/imap.php');
-require_once('../functions/plugin.php');
-require_once('../functions/page_header.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* These constants are used for folder stuff. */
 define('SM_BOX_UNCOLLAPSED', 0);
index 0e8f7a9..965c6c1 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/prefs.php');
-require_once('../functions/plugin.php');
-require_once('../functions/constants.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/constants.php');
 
 $username = ( !isset($username) ? '' : $username );
 
index dd73704..d87f749 100644 (file)
  * $Id$
  */
 
-require_once('../functions/strings.php');
-require_once('../config/config.php');
-require_once('../functions/i18n.php');
-require_once('../functions/plugin.php');
-require_once('../functions/constants.php');
-require_once('../functions/page_header.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'functions/i18n.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/constants.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /*
  * $squirrelmail_language is set by a cookie when the user selects
@@ -30,7 +34,7 @@ set_up_language($squirrelmail_language, TRUE);
  * Find out the base URI to set cookies.
  */
 if (!function_exists('sqm_baseuri')){
-    require_once('../functions/display_messages.php');
+    require_once(SM_PATH . 'functions/display_messages.php');
 }
 $base_uri = sqm_baseuri();
 @session_destroy();
index 121a18c..2188ef8 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/html.php');
+
 global $compose_new_win;
 
 function putSelectedMessagesIntoString($msg) {
index d913187..65fd9cd 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/options.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/options.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /*********************************/
 /*** Build the resultant page. ***/
index 3ee4910..f103cbc 100644 (file)
  * $Id$
  */
 
-require_once('../functions/imap.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'functions/imap.php');
 
 /* Define the group constants for the folder options page. */   
 define('SMOPT_GRP_SPCFOLDER', 0);
index 0739a1b..b429ab0 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/plugin.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 function oh_opt( $val, $sel, $tit ) {
     echo "<option value=\"$val\"";
index 25e087a..91560c7 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/html.php');
 
     if (isset($return)) {
        SaveUpdateFunction();
@@ -337,4 +341,4 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post)
 
     return ($return_val);
 }
-?>
\ No newline at end of file
+?>
index 2f64907..cb26a74 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
-require_once('../functions/plugin.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/html.php');
 
 if (! isset($action)) { $action = ''; }
 if ($action == 'delete' && isset($theid)) {
index dae0c92..c91b217 100644 (file)
  * $Id$
  */
 
-require_once('../functions/imap.php');
-require_once('../functions/array.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/array.php');
 
 /* Define the group constants for the personal options page. */
 define('SMOPT_GRP_CONTACT', 0);
index 9e8aba7..bbab3b7 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/strings.php');
-require_once('../config/config.php');
-require_once('../src/load_prefs.php');
-require_once('../functions/imap.php');
-require_once('../functions/page_header.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'src/load_prefs.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/html.php');
 
 $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
 $mailbox = urldecode($mailbox);
index 3013c5a..29e5eb8 100644 (file)
@@ -9,8 +9,12 @@
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/page_header.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/page_header.php');
 
 displayHtmlHeader( _("Printer Friendly"), '', FALSE );
 
index 7375ac8..6fe4da1 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/strings.php');
-require_once('../config/config.php');
-require_once('../src/load_prefs.php');
-require_once('../functions/page_header.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'src/load_prefs.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/html.php');
 
 displayHtmlHeader( _("Printer Friendly"),
              "<script language=\"javascript\" type=\"text/javascript\">\n".
index 33a5d6b..102b683 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/mime.php');
-require_once('../functions/date.php');
-require_once('../functions/url_parser.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/url_parser.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /**
  * Given an IMAP message id number, this will look it up in the cached
@@ -272,7 +276,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
 
 
     if (!$useSendmail) {
-       require_once('../class/deliver/Deliver_SMTP.class.php');
+       require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
        $deliver = new Deliver_SMTP();
        global $smtpServerAddress, $smtpPort, $use_authenticated_smtp, $pop_before_smtp;
        if ($use_authenticated_smtp) {
@@ -287,7 +291,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
        $stream = $deliver->initStream($composeMessage,$domain,0,
                          $smtpServerAddress, $smtpPort, $authPop);
     } else {
-       require_once('../class/deliver/Deliver_SendMail.class.php');
+       require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
        global $sendmail_path;
        $deliver = new Deliver_SendMail();
        $stream = $deliver->initStream($composeMessage,$sendmail_path);
@@ -299,13 +303,13 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     }
     if (!$succes) {
         $msg  = $deliver->dlv_msg . '<br>Server replied: '.$deliver->dlv_ret_nr;
-       require_once('../functions/display_messages.php');
+       require_once(SM_PATH . 'functions/display_messages.php');
         plain_error_message($msg, $color);
     } else {
         unset ($deliver);
        if (sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
            sqimap_append ($imapConnection, $sent_folder, $length);
-           require_once('../class/deliver/Deliver_IMAP.class.php');
+           require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
            $imap_deliver = new Deliver_IMAP();
            $imap_deliver->mail($composeMessage, $imapConnection);
            sqimap_append_done ($imapConnection);
index 826e21d..31b73ad 100644 (file)
 * $Id$
 */
 
-require_once('../functions/i18n.php');
-require_once('../functions/strings.php');
-require_once('../config/config.php');
-require_once('../functions/prefs.php');
-require_once('../functions/imap.php');
-require_once('../functions/plugin.php');
-require_once('../functions/constants.php');
-require_once('../functions/page_header.php');
-require_once('../functions/global.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'functions/i18n.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/constants.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/global.php');
 
 // Remove slashes if PHP added them
 if (get_magic_quotes_gpc()) {
@@ -38,7 +42,7 @@ if (get_magic_quotes_gpc()) {
 /* Before starting the session, the base URI must be known. Assuming */
 /* that this file is in the src/ subdirectory (or something).        */
 if (!function_exists('sqm_baseuri')){
-    require_once('../functions/display_messages.php');
+    require_once(SM_PATH . 'functions/display_messages.php');
 }
 $base_uri = sqm_baseuri();
 
@@ -197,4 +201,4 @@ function attachment_common_parse($str, $debug) {
 }
 
 
-?>
\ No newline at end of file
+?>
index 9f9bbac..2bfc9c8 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/smtp.php');
-require_once('../functions/page_header.php');
-require_once('../src/load_prefs.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/smtp.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'src/load_prefs.php');
 
 $destination = 'retrievalerror@squirrelmail.org';
 $attachments = array();
index fb68c39..aadcc70 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/date.php');
-require_once('../functions/array.php');
-require_once('../functions/mime.php');
-require_once('../functions/mailbox_display.php');
-require_once('../functions/display_messages.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'functions/mailbox_display.php');
+require_once(SM_PATH . 'functions/display_messages.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /***********************************************************
  * incoming variables from URL:                            *
index 5c2a865..01be5ff 100644 (file)
@@ -9,12 +9,16 @@
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/imap_search.php');
-require_once('../functions/imap_mailbox.php');
-require_once('../functions/array.php');
-require_once('../functions/strings.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/imap_search.php');
+require_once(SM_PATH . 'functions/imap_mailbox.php');
+require_once(SM_PATH . 'functions/array.php');
+require_once(SM_PATH . 'functions/strings.php');
 
 global $allow_thread_sort;
 
index 706088f..151a5d7 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/prefs.php');
-require_once('../functions/plugin.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* Erase any lingering attachments */
 if (isset($attachments) && is_array($attachments) 
@@ -37,7 +41,7 @@ if (!isset($frame_top)) {
  * because it was deleted with the session. */
 if (!isset($base_uri)) {
     if (!function_exists('sqm_baseuri')){
-        require_once('../functions/display_messages.php');
+        require_once(SM_PATH . 'functions/display_messages.php');
     }
     $base_uri = sqm_baseuri();
 }
@@ -87,4 +91,4 @@ html_tag( 'table',
 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>
index 12c2619..69e0994 100644 (file)
  * messages with a session_register.
  */
  
-require_once('../class/mime.class.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'class/mime.class.php');
 
 session_start();
 
-require_once('../functions/i18n.php');
-require_once('../functions/auth.php');
-require_once('../functions/strings.php');
-require_once('../functions/global.php');
+require_once(SM_PATH . 'functions/i18n.php');
+require_once(SM_PATH . 'functions/auth.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/global.php');
 
 is_logged_in();
 
@@ -77,10 +81,10 @@ global $theme;
 unset($theme);
 $theme=array();
 
-require_once('../config/config.php');
-require_once('../src/load_prefs.php');
-require_once('../functions/page_header.php');
-require_once('../functions/prefs.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'src/load_prefs.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/prefs.php');
 
 /* Set up the language (i18n.php was included by auth.php). */
 global $username, $data_dir;
index 21b5133..213711a 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/date.php');
-require_once('../functions/page_header.php');
-require_once('../functions/mime.php');
-require_once('../src/load_prefs.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/date.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'src/load_prefs.php');
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 sqimap_mailbox_select($imapConnection, $mailbox);
index 2cf9d1f..96f2e99 100644 (file)
  *
  * $Id$
  */
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/html.php');
-require_once('../functions/url_parser.php');
+
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/html.php');
+require_once(SM_PATH . 'functions/url_parser.php');
 
 function  parse_viewheader($imapConnection,$id, $passed_ent_id) {
    global $uid_support;
index b1ed0c4..e152b43 100644 (file)
@@ -1,57 +1,73 @@
 <?php
 
-   require_once('../src/validate.php');
-   require_once('../functions/imap.php');
-   require_once('../functions/mime.php');
-   require_once('../functions/html.php');
+/**
+ * view_text.php -- Displays the main frameset
+ *
+ * Copyright (c) 1999-2002 The SquirrelMail development team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Who knows what this file does. However PUT IT HERE DID NOT PUT
+ * A SINGLE FREAKING COMMENT IN! Whoever is responsible for this,
+ * be very ashamed.
+ *
+ * $Id$
+ */
+
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'functions/html.php');
    
-   $mailbox = urldecode($mailbox);
-   if (!isset($passed_ent_id)) {
-      $passed_ent_id = '';
-   }
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-   $mbx_response =  sqimap_mailbox_select($imapConnection, $mailbox);
-
-   $message = &$messages[$mbx_response['UIDVALIDITY']]["$passed_id"];
-   $message_ent = &$message->getEntity($ent_id);
-   if ($passed_ent_id) {
-      $message = &$message->getEntity($passed_ent_id);
-   }
+$mailbox = urldecode($mailbox);
+if (!isset($passed_ent_id)) {
+    $passed_ent_id = '';
+}
+
+$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+$mbx_response =  sqimap_mailbox_select($imapConnection, $mailbox);
+
+$message = &$messages[$mbx_response['UIDVALIDITY']]["$passed_id"];
+$message_ent = &$message->getEntity($ent_id);
+if ($passed_ent_id) {
+    $message = &$message->getEntity($passed_ent_id);
+}
    
-   $header = $message_ent->header;
-   $charset = $header->getParameter('charset');
-   $type0 = $header->type0;
-   $type1 = $header->type1;
-   $encoding = strtolower($header->encoding);
-
-   $msg_url = 'read_body.php?' . $QUERY_STRING;
-   $msg_url = set_url_var($msg_url, 'ent_id', 0);
-
-   $body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
-   $body = decodeBody($body, $encoding);
-
-    displayPageHeader($color, 'None');
-
-    echo "<BR><TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-         "<B><CENTER>".
-         _("Viewing a text attachment") . " - ";
-    echo '<a href="'.$msg_url.'">'. _("View message") . '</a>';
-
-    $dwnld_url = '../src/download.php?'. $QUERY_STRING.'&amp;absolute_dl=true';
-    echo '</b></td><tr><tr><td><CENTER><A HREF="'.$dwnld_url. '">'.
-         _("Download this as a file").
-         "</A></CENTER><BR>".
-         "</CENTER></B>".
-         "</TD></TR></TABLE>".
-         "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
-         "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
-    if ($type1 == 'html' || 
-         (isset($override_type1) &&  $override_type1 == 'html')) {
-        $body = MagicHTML( $body, $passed_id, $message, $mailbox);
-    } else {
-        translateText($body, $wrap_at, $charset);
-    }
-    echo $body .
-         "</TT></TD></TR></TABLE>";
+$header = $message_ent->header;
+$charset = $header->getParameter('charset');
+$type0 = $header->type0;
+$type1 = $header->type1;
+$encoding = strtolower($header->encoding);
+
+$msg_url = 'read_body.php?' . $QUERY_STRING;
+$msg_url = set_url_var($msg_url, 'ent_id', 0);
+
+$body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
+$body = decodeBody($body, $encoding);
+
+displayPageHeader($color, 'None');
+
+echo "<BR><TABLE WIDTH=\"100%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
+     "<B><CENTER>".
+     _("Viewing a text attachment") . " - ";
+echo '<a href="'.$msg_url.'">'. _("View message") . '</a>';
+
+$dwnld_url = '../src/download.php?'. $QUERY_STRING.'&amp;absolute_dl=true';
+echo '</b></td><tr><tr><td><CENTER><A HREF="'.$dwnld_url. '">'.
+     _("Download this as a file").
+     "</A></CENTER><BR>".
+     "</CENTER></B>".
+     "</TD></TR></TABLE>".
+     "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
+     "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
+if ($type1 == 'html' || (isset($override_type1) &&  $override_type1 == 'html')) {
+    $body = MagicHTML( $body, $passed_id, $message, $mailbox);
+} else {
+    translateText($body, $wrap_at, $charset);
+}
+echo $body . "</TT></TD></TR></TABLE>";
+
 ?>
index 0466064..6498291 100644 (file)
  * $Id$
  */
 
-require_once('../functions/strings.php');
-require_once('../config/config.php');
-require_once('../functions/prefs.php');
-require_once('../functions/imap.php');
-require_once('../functions/plugin.php');
-require_once('../functions/i18n.php');
-require_once('../functions/auth.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/i18n.php');
+require_once(SM_PATH . 'functions/auth.php');
 
 if (!function_exists('sqm_baseuri')){
-    require_once('../functions/display_messages.php');
+    require_once(SM_PATH . 'functions/display_messages.php');
 }
 $base_uri = sqm_baseuri();