From d4e84069d1d9af8760b8e858672d3ea3d4eac8b0 Mon Sep 17 00:00:00 2001 From: fidian Date: Tue, 15 May 2001 19:01:57 +0000 Subject: [PATCH] * Moved load_prefs.php and display_page.php (or whatever it is called) into validate.php * validate.php now sets up the language * Any errors? Call 1-800-cvs-commit git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1366 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/addrbook_popup.php | 4 ---- src/addrbook_search.php | 2 -- src/addrbook_search_html.php | 2 -- src/addressbook.php | 3 --- src/compose.php | 2 -- src/delete_message.php | 2 -- src/download.php | 3 --- src/empty_trash.php | 2 -- src/folders.php | 2 -- src/folders_create.php | 2 -- src/folders_delete.php | 2 -- src/folders_rename_do.php | 2 -- src/folders_rename_getname.php | 2 -- src/folders_subscribe.php | 2 -- src/help.php | 2 -- src/left_main.php | 2 -- src/login.php | 14 +++++++++----- src/move_messages.php | 2 -- src/options.php | 2 -- src/options_display.php | 2 -- src/options_folder.php | 2 -- src/options_highlight.php | 2 -- src/options_identities.php | 2 -- src/options_order.php | 2 -- src/options_personal.php | 2 -- src/read_body.php | 2 -- src/redirect.php | 3 +++ src/right_main.php | 6 ------ src/search.php | 2 -- src/signout.php | 2 -- src/validate.php | 8 +++++++- 31 files changed, 19 insertions(+), 70 deletions(-) diff --git a/src/addrbook_popup.php b/src/addrbook_popup.php index a042eae5..f12575e3 100644 --- a/src/addrbook_popup.php +++ b/src/addrbook_popup.php @@ -11,11 +11,7 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/addressbook.php'); - include('../src/load_prefs.php'); - - set_up_language(getPref($data_dir, $username, 'language')); ?> diff --git a/src/addrbook_search.php b/src/addrbook_search.php index a8dd816a..6c42aa18 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -130,9 +130,7 @@ function bcc_address($addr) { include('../functions/array.php'); include('../functions/strings.php'); - include('../functions/page_header.php'); include('../functions/addressbook.php'); - include('../src/load_prefs.php'); displayHtmlHeader(); diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 7a683a48..9cdf82a9 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -17,13 +17,11 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/date.php'); include('../functions/smtp.php'); include('../functions/display_messages.php'); include('../functions/addressbook.php'); include('../functions/plugin.php'); - include('../src/load_prefs.php'); // Insert hidden data function addr_insert_hidden() { diff --git a/src/addressbook.php b/src/addressbook.php index 8201f4c9..4789080d 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -12,7 +12,6 @@ include('../src/validate.php'); include('../functions/array.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/addressbook.php'); @@ -76,8 +75,6 @@ } - include('../src/load_prefs.php'); - // Open addressbook, with error messages on but without LDAP (the // second "true"). Don't need LDAP here anyway $abook = addressbook_init(true, true); diff --git a/src/compose.php b/src/compose.php index b1a92215..f7817bf6 100644 --- a/src/compose.php +++ b/src/compose.php @@ -16,14 +16,12 @@ **/ include('../src/validate.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"); include ("../functions/plugin.php"); - include("../src/load_prefs.php"); if (!isset($attachments)) { diff --git a/src/delete_message.php b/src/delete_message.php index 691c97af..dd59af6f 100644 --- a/src/delete_message.php +++ b/src/delete_message.php @@ -11,10 +11,8 @@ **/ include("../src/validate.php"); - include("../functions/page_header.php"); include("../functions/display_messages.php"); include("../functions/imap.php"); - include("../src/load_prefs.php"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); diff --git a/src/download.php b/src/download.php index 37cb370f..5cf6fb83 100644 --- a/src/download.php +++ b/src/download.php @@ -17,7 +17,6 @@ include("../functions/imap.php"); include("../functions/mime.php"); include("../functions/date.php"); - include("../src/load_prefs.php"); header("Pragma: "); header("Cache-Control: cache"); @@ -144,7 +143,6 @@ if ($type1 == "plain" || $type1 == "html") { $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id); $body = decodeBody($body, $header->encoding); - include("../functions/page_header.php"); viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at); } else { DumpHeaders($type0, $type1, $filename, 0); @@ -156,7 +154,6 @@ case "message": $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id); $body = decodeBody($body, $header->encoding); - include("../functions/page_header.php"); viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at); break; default: diff --git a/src/empty_trash.php b/src/empty_trash.php index 486b15e6..16d54e04 100644 --- a/src/empty_trash.php +++ b/src/empty_trash.php @@ -12,12 +12,10 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/display_messages.php"); include("../functions/imap.php"); include("../functions/array.php"); include("../functions/tree.php"); - include("../src/load_prefs.php"); $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); diff --git a/src/folders.php b/src/folders.php index 4052a9a3..ed1dac5d 100644 --- a/src/folders.php +++ b/src/folders.php @@ -13,11 +13,9 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/imap.php"); include("../functions/array.php"); include("../functions/plugin.php"); - include("../src/load_prefs.php"); displayPageHeader($color, _("None")); diff --git a/src/folders_create.php b/src/folders_create.php index a16b43d9..607bbac7 100644 --- a/src/folders_create.php +++ b/src/folders_create.php @@ -12,10 +12,8 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/imap.php"); include("../functions/display_messages.php"); - include("../src/load_prefs.php"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $dm = sqimap_get_delimiter($imapConnection); diff --git a/src/folders_delete.php b/src/folders_delete.php index 7cbea84f..7cda7013 100644 --- a/src/folders_delete.php +++ b/src/folders_delete.php @@ -12,11 +12,9 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/imap.php"); include("../functions/array.php"); include("../functions/tree.php"); - include("../src/load_prefs.php"); /* * Incoming values: diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index e2db9ccb..99324ca0 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -12,9 +12,7 @@ **/ include("../src/validate.php"); - include("../functions/page_header.php"); include("../functions/imap.php"); - include("../src/load_prefs.php"); if($old_name == $new_name) { diff --git a/src/folders_rename_getname.php b/src/folders_rename_getname.php index 44c7a69e..a7803a88 100644 --- a/src/folders_rename_getname.php +++ b/src/folders_rename_getname.php @@ -12,9 +12,7 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/imap.php"); - include("../src/load_prefs.php"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); diff --git a/src/folders_subscribe.php b/src/folders_subscribe.php index 286064ef..5c043366 100644 --- a/src/folders_subscribe.php +++ b/src/folders_subscribe.php @@ -12,10 +12,8 @@ **/ include ('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/imap.php"); include("../functions/display_messages.php"); - include("../src/load_prefs.php"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $dm = sqimap_get_delimiter($imapConnection); diff --git a/src/help.php b/src/help.php index f689c6d9..e95e0b13 100644 --- a/src/help.php +++ b/src/help.php @@ -11,11 +11,9 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/display_messages.php"); include("../functions/imap.php"); include("../functions/array.php"); - include("../src/load_prefs.php"); displayPageHeader($color, "None"); diff --git a/src/left_main.php b/src/left_main.php index e2b6872c..324f0a80 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -13,9 +13,7 @@ include('../src/validate.php'); include("../functions/array.php"); include("../functions/imap.php"); - include("../functions/page_header.php"); include("../functions/plugin.php"); - include("../src/load_prefs.php"); // open a connection on the imap port (143) $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output diff --git a/src/login.php b/src/login.php index 04ee698a..b9905252 100644 --- a/src/login.php +++ b/src/login.php @@ -11,6 +11,14 @@ ** $Id$ **/ + $rcptaddress = ''; + if (isset($emailaddress)) { + if (stristr($emailaddress, 'mailto:')) + $rcptaddress = substr($emailaddress, 7); + else + $rcptaddress = $emailaddress; + } + include("../functions/strings.php"); include("../config/config.php"); include('../functions/i18n.php'); @@ -77,11 +85,7 @@ echo " \n"; echo " \n"; echo " \n"; - if (isset($emailaddress)) { - if (stristr($emailaddress,"mailto:")) - $rcptaddress = substr ($emailaddress, 7,strlen($emailaddress)-7); - else - $rcptaddress = $emailaddress; + if ($rcptaddress != '') { echo " \n"; } echo " \n"; diff --git a/src/move_messages.php b/src/move_messages.php index 953fcbd3..c5f4c837 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -11,10 +11,8 @@ **/ include('../src/validate.php'); - include("../functions/page_header.php"); include("../functions/display_messages.php"); include("../functions/imap.php"); - include("../src/load_prefs.php"); function putSelectedMessagesIntoString($msg) { $j = 0; diff --git a/src/options.php b/src/options.php index b0dc93d6..3e079ebe 100644 --- a/src/options.php +++ b/src/options.php @@ -12,7 +12,6 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); @@ -22,7 +21,6 @@ $squirrelmail_language = $language; } - include('../src/load_prefs.php'); displayPageHeader($color, _("None")); ?> diff --git a/src/options_display.php b/src/options_display.php index a117f118..fc84d562 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -11,12 +11,10 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); include('../functions/plugin.php'); - include('../src/load_prefs.php'); displayPageHeader($color, 'None'); $chosen_language = getPref($data_dir, $username, 'language'); diff --git a/src/options_folder.php b/src/options_folder.php index 139a85f1..1f05f8ba 100644 --- a/src/options_folder.php +++ b/src/options_folder.php @@ -11,12 +11,10 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); include('../functions/plugin.php'); - include('../src/load_prefs.php'); displayPageHeader($color, 'None'); diff --git a/src/options_highlight.php b/src/options_highlight.php index 7d96320c..83627a7e 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -11,7 +11,6 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); @@ -47,7 +46,6 @@ $message_highlight_list[$theid]['value'] = $value; $message_highlight_list[$theid]['match_type'] = $match_type; } - include('../src/load_prefs.php'); displayPageHeader($color, 'None'); ?>
diff --git a/src/options_identities.php b/src/options_identities.php index 92152a29..82338553 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -6,9 +6,7 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); - include('../src/load_prefs.php'); if (isset($return)) { SaveUpdateFunction(); diff --git a/src/options_order.php b/src/options_order.php index f18e44d3..7c4ca65a 100644 --- a/src/options_order.php +++ b/src/options_order.php @@ -11,7 +11,6 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); @@ -23,7 +22,6 @@ removePref($data_dir, $username, "highlight$theid"); } else if ($action == 'save') { } - include('../src/load_prefs.php'); displayPageHeader($color, 'None'); ?>
diff --git a/src/options_personal.php b/src/options_personal.php index 8f6291eb..62b62e4e 100644 --- a/src/options_personal.php +++ b/src/options_personal.php @@ -11,12 +11,10 @@ **/ include('../src/validate.php'); - include('../functions/page_header.php'); include('../functions/display_messages.php'); include('../functions/imap.php'); include('../functions/array.php'); include('../functions/plugin.php'); - include('../src/load_prefs.php'); displayPageHeader($color, 'None'); diff --git a/src/read_body.php b/src/read_body.php index ee8ebebc..d4105209 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -12,12 +12,10 @@ **/ include("../src/validate.php"); - include('../functions/page_header.php'); include('../functions/imap.php'); include('../functions/mime.php'); include('../functions/date.php'); include('../functions/url_parser.php'); - include('../src/load_prefs.php'); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); diff --git a/src/redirect.php b/src/redirect.php index e3ebf802..fa3d601b 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -33,6 +33,9 @@ session_register ('base_uri'); if(!isset($login_username)) { + if (! isset($squirrelmail_language)) + $squirrelmail_language = ''; + set_up_language($squirrelmail_language, true); echo "\n"; echo "

"; echo "
"; diff --git a/src/right_main.php b/src/right_main.php index 630d585f..b8bf19ab 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -14,14 +14,11 @@ include('../src/validate.php'); include('../functions/imap.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'); -?> - -- 2.25.1