From: thomppj Date: Fri, 6 Sep 2002 00:31:43 +0000 (+0000) Subject: Converted all files in functions/ to use SM_PATH. This will break all X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=b68edc750e3b478f5302681e8fbd289b17447550 Converted all files in functions/ to use SM_PATH. This will break all plugins. Each callable script needs a: define('SM_PATH', '../../'); Or something like that put at the top. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3579 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/addressbook.php b/functions/addressbook.php index 0e2a44aa..f62ccde5 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -30,8 +30,8 @@ Include backends here. */ -require_once('../functions/abook_local_file.php'); -require_once('../functions/abook_ldap_server.php'); +require_once(SM_PATH . 'functions/abook_local_file.php'); +require_once(SM_PATH . 'functions/abook_ldap_server.php'); global $addrbook_dsn; diff --git a/functions/constants.php b/functions/constants.php index 10342589..a6ac0909 100644 --- a/functions/constants.php +++ b/functions/constants.php @@ -13,7 +13,7 @@ * $Id$ */ -require_once('../functions/plugin.php'); // Required for the hook +require_once(SM_PATH . 'functions/plugin.php'); /* Required for the hook */ /**************************************************************/ /* Set values for constants used by Squirrelmail preferences. */ diff --git a/functions/date.php b/functions/date.php index 706616fc..f38deda1 100644 --- a/functions/date.php +++ b/functions/date.php @@ -14,7 +14,7 @@ * $Id$ */ -require_once( '../functions/constants.php' ); +require_once(SM_PATH . 'functions/constants.php'); /* corrects a time stamp to be the local time */ function getGMTSeconds($stamp, $gmt) { diff --git a/functions/db_prefs.php b/functions/db_prefs.php index 2742d90c..a8a5ba3a 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -33,7 +33,7 @@ define('SMDB_MYSQL', 1); define('SMDB_PGSQL', 2); require_once('DB.php'); -require_once('../config/config.php'); +require_once(SM_PATH . 'config/config.php'); global $prefs_are_cached, $prefs_cache; diff --git a/functions/imap.php b/functions/imap.php index 7bcb5676..4bd9ce28 100644 --- a/functions/imap.php +++ b/functions/imap.php @@ -12,9 +12,10 @@ * $Id$ */ -require_once('../functions/imap_mailbox.php'); -require_once('../functions/imap_messages.php'); -require_once('../functions/imap_general.php'); -require_once('../functions/imap_search.php'); -require_once('../functions/imap_parse.php'); +require_once(SM_PATH . 'functions/imap_mailbox.php'); +require_once(SM_PATH . 'functions/imap_messages.php'); +require_once(SM_PATH . 'functions/imap_general.php'); +require_once(SM_PATH . 'functions/imap_search.php'); +require_once(SM_PATH . 'functions/imap_parse.php'); + ?> diff --git a/functions/imap_general.php b/functions/imap_general.php index 2b4b9e9d..4e7db9ae 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -11,7 +11,7 @@ * $Id$ */ -require_once('../functions/page_header.php'); +require_once(SM_PATH . 'functions/page_header.php'); global $sqimap_session_id; $sqimap_session_id = 1; diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index aed2c432..40b281a2 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -10,8 +10,8 @@ * * $Id$ */ -require_once('../functions/imap_utf7_encode_local.php'); -require_once('../functions/imap_utf7_decode_local.php'); +require_once(SM_PATH . 'functions/imap_utf7_encode_local.php'); +require_once(SM_PATH . 'functions/imap_utf7_decode_local.php'); global $boxesnew; class mailboxes { @@ -461,8 +461,8 @@ function sqimap_mailbox_list($imap_stream) { $inbox_in_list = false; $inbox_subscribed = false; - require_once('../src/load_prefs.php'); - require_once('../functions/array.php'); + require_once(SM_PATH . 'src/load_prefs.php'); + require_once(SM_PATH . 'functions/array.php'); if ($noselect_fix_enable) { $lsub_args = "LSUB \"$folder_prefix\" \"*%\""; @@ -615,7 +615,7 @@ function sqimap_mailbox_list($imap_stream) { function sqimap_mailbox_list_all($imap_stream) { global $list_special_folders_first, $folder_prefix, $delimiter; - require_once('../functions/array.php'); + require_once(SM_PATH . 'functions/array.php'); $ssid = sqimap_session_id(); $lsid = strlen( $ssid ); @@ -711,8 +711,8 @@ function sqimap_mailbox_tree($imap_stream) { $inbox_in_list = false; $inbox_subscribed = false; - require_once('../src/load_prefs.php'); - require_once('../functions/array.php'); + require_once(SM_PATH . 'src/load_prefs.php'); + require_once(SM_PATH . 'functions/array.php'); /* LSUB array */ $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*\"", diff --git a/functions/imap_search.php b/functions/imap_search.php index 463d6908..d7b1924b 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -11,11 +11,11 @@ * $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'); +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/mailbox_display.php'); +require_once(SM_PATH . 'functions/mime.php'); function sqimap_search($imapConnection, $search_where, $search_what, $mailbox, $color, $search_position = '', $search_all, $count_all) { diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 1a3b14c0..b33fd32d 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -12,10 +12,10 @@ * $Id$ */ -require_once('../functions/strings.php'); -require_once('../functions/html.php'); -require_once('../class/html.class.php'); -require_once('../functions/imap_mailbox.php'); +require_once(SM_PATH . 'functions/strings.php'); +require_once(SM_PATH . 'functions/html.php'); +require_once(SM_PATH . 'class/html.class.php'); +require_once(SM_PATH . 'functions/imap_mailbox.php'); /* Default value for page_selector_max. */ define('PG_SEL_MAX', 10); diff --git a/functions/mime.php b/functions/mime.php index d2e88463..273e6b3e 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -12,8 +12,8 @@ * $Id$ */ -require_once('../functions/imap.php'); -require_once('../functions/attachment_common.php'); +require_once(SM_PATH . 'functions/imap.php'); +require_once(SM_PATH . 'functions/attachment_common.php'); /* --------------------------------------------------------------------------------- */ /* MIME DECODING */ @@ -268,7 +268,7 @@ function translateText(&$body, $wrap_at, $charset) { global $where, $what; /* from searching */ global $color; /* color theme */ - require_once('../functions/url_parser.php'); + require_once(SM_PATH . 'functions/url_parser.php'); $body_ary = explode("\n", $body); for ($i=0; $i < count($body_ary); $i++) { diff --git a/functions/page_header.php b/functions/page_header.php index 3626507a..e48bf2a0 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -11,10 +11,10 @@ * $Id$ */ -require_once('../functions/strings.php'); -//require_once('../functions/imap_utf7_decode_local.php'); -require_once('../functions/html.php'); -require_once('../functions/imap_mailbox.php'); +require_once(SM_PATH . 'functions/strings.php'); +require_once(SM_PATH . 'functions/html.php'); +require_once(SM_PATH . 'functions/imap_mailbox.php'); + /* Always set up the language before calling these functions */ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { diff --git a/functions/plugin.php b/functions/plugin.php index 2d9083fb..159fb154 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -89,10 +89,10 @@ if (isset($plugins) && is_array($plugins)) { global $HTTP_USER_AGENT, $SQSPELL_SOUP_NAZI; - require_once('../plugins/squirrelspell/sqspell_config.php'); + require_once(SM_PATH . 'plugins/squirrelspell/sqspell_config.php'); $soup_menu = explode( ',', $SQSPELL_SOUP_NAZI ); return( in_array( trim( $HTTP_USER_AGENT ), $soup_menu ) ); } -?> \ No newline at end of file +?> diff --git a/functions/prefs.php b/functions/prefs.php index 047e1de6..bc534c34 100644 --- a/functions/prefs.php +++ b/functions/prefs.php @@ -23,9 +23,9 @@ if ( !session_is_registered('prefs_are_cached') || } if (isset($prefs_dsn) && !empty($prefs_dsn)) { - require_once('../functions/db_prefs.php'); + require_once(SM_PATH . 'functions/db_prefs.php'); } else { - require_once('../functions/file_prefs.php'); + require_once(SM_PATH . 'functions/file_prefs.php'); } /* Hashing functions */ diff --git a/functions/smtp.php b/functions/smtp.php index c57936c4..ad556115 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -12,9 +12,9 @@ * $Id$ */ -require_once('../functions/addressbook.php'); -require_once('../functions/plugin.php'); -require_once('../functions/prefs.php'); +require_once(SM_PATH . 'functions/addressbook.php'); +require_once(SM_PATH . 'functions/plugin.php'); +require_once(SM_PATH . 'functions/prefs.php'); global $username, $popuser, $domain; diff --git a/functions/tree.php b/functions/tree.php index 2a0b9bbd..3557f594 100644 --- a/functions/tree.php +++ b/functions/tree.php @@ -12,7 +12,7 @@ * $Id$ */ -require_once('../functions/imap.php'); +require_once(SM_PATH . 'functions/imap.php'); /** * findParentForChild