* Moved load_prefs.php and display_page.php (or whatever it is called) into
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 May 2001 19:01:57 +0000 (19:01 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 May 2001 19:01:57 +0000 (19:01 +0000)
  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

31 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/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/left_main.php
src/login.php
src/move_messages.php
src/options.php
src/options_display.php
src/options_folder.php
src/options_highlight.php
src/options_identities.php
src/options_order.php
src/options_personal.php
src/read_body.php
src/redirect.php
src/right_main.php
src/search.php
src/signout.php
src/validate.php

index a042eae5e77539f1900f2a3ff9344b489bf46212..f12575e34a4cde89b6da6e2ac8fe1b4b12c43fc0 100644 (file)
     **/
 
    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'));
    
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
index a8dd816ae8cfb43bd36bc5628b6e8030c2d525b4..6c42aa1804c2b36fc74da7d8e893bad2384f5e99 100644 (file)
@@ -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();
 
index 7a683a4800fd5ebfca7b4152cd8e7cd24e55b6ec..9cdf82a9117fa2def492f898742fdac89fe5b84c 100644 (file)
     **/
 
    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() {
index 8201f4c92431db5c76c515ff0c82d2e7b69d3fb2..4789080d9729ece60381f5e63ea00a91066f8d52 100644 (file)
@@ -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);
index b1a922152eb0334d896c47ad2957ea400efddc12..f7817bf607834dab4bd8331e3d939ba6e6075981 100644 (file)
     **/
 
    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))
    {
index 691c97af3bedfb762d5ecc92325c7c9262903603..dd59af6f1fa469c5589e2357293f3e54f4e0e393 100644 (file)
     **/
 
    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);
index 37cb370fdf76e819ed46b5d8d47273388428518b..5cf6fb839977022d1536aace664966848ff5a508 100644 (file)
@@ -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");
             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);
          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:
index 486b15e6d96883a1e00fb09f364a47e411b32a69..16d54e04cdff95c27985bae43c01493f04ed96cb 100644 (file)
     **/
 
    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);
 
index 4052a9a33d5aed88eee62352621eb7300cf1cdef..ed1dac5d6a69d9799a35e10ff46846935b2ce7b3 100644 (file)
     **/
 
    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"));
 
index a16b43d933be6c14561b4bb27f0ba1a726f4e72e..607bbac71d2e006b93cef0e72f42f84e83a8813b 100644 (file)
     **/
 
    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);
index 7cbea84f3b12ba48c5bd1643fae16a958042b92d..7cda7013ae9fd11ed9989aa0421b6d8821af99ce 100644 (file)
     **/
 
    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:
index e2db9ccbdf49afd2ed047ccc8f32aa49463cb159..99324ca09170d7b97012bc2bef304c18edb9a7dd 100644 (file)
@@ -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) {
index 44c7a69ef6fe377d41e093f4a1500f27f8d00288..a7803a882a78c7967a2d4728796390b6e8c52032 100644 (file)
@@ -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);
 
index 286064ef24d3b42e65ef1394caa0c62e5e188a3c..5c0433669410da1016ce6b3d44cbf48b41f884c0 100644 (file)
     **/
 
    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);
index f689c6d946df88eac5c77239eaf3ac93f4ee35ab..e95e0b1326b1795136470e9ab1a9056c9444f6c2 100644 (file)
     **/
 
    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");
index e2b6872c1f1123a029c700ec835c6dcef172efb7..324f0a8098aac905d1c9f9f2f32c74cb88f825bc 100644 (file)
@@ -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
index 04ee698a4f77bf87fd524367bd6398542f4aefd7..b9905252d70586788318bd34d67e7eb9e24997bc 100644 (file)
     **  $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');
    echo "               </TD><TD WIDTH=* ALIGN=left>\n";
    echo "                  <INPUT TYPE=PASSWORD NAME=\"$password_form_name\">\n";
    echo "               </TD>\n";
-   if (isset($emailaddress)) {
-      if (stristr($emailaddress,"mailto:"))
-         $rcptaddress = substr ($emailaddress, 7,strlen($emailaddress)-7);
-      else
-         $rcptaddress = $emailaddress;
+   if ($rcptaddress != '') {
       echo "               <INPUT TYPE=HIDDEN NAME=\"rcptemail\" VALUE=\"".htmlspecialchars($rcptaddress)."\">\n";
    }
    echo "         </TABLE>\n";
index 953fcbd366784b428bb68bfdf5fa09f09e35181a..c5f4c837d9bc53913160a24f89604c368755d9df 100644 (file)
     **/
 
    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;
index b0dc93d632adfde946a7fefd1e3dc1f0ad44e87b..3e079ebe437aacdae2673305c9035bc23dd33a94 100644 (file)
@@ -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"));
 
 ?>
index a117f118009dd6e9989a6c788c49f197a0f4d0ee..fc84d562bcbcde8b72a478e0e4768217d2f99a1d 100644 (file)
     **/
 
    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');  
index 139a85f10ba2790e53bdd4dcbfe9680aeb3e41cc..1f05f8ba6533e2371a7e8693b3566a8c70ecc90e 100644 (file)
     **/
 
    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');
 
index 7d96320c707fa2f2d5fb5b9e5eaee53783d7d85e..83627a7ee7f3b27a2e90fe8a791a92d59c2fc097 100644 (file)
@@ -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');
 ?>
    <br>
index 92152a29ff22f7e4811e2d5e78922c0a1be5fe3e..82338553b695fd1f06d8b79e862b7ce6c5320397 100644 (file)
@@ -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();
index f18e44d32d484387a275d85f87d1b287e80379f2..7c4ca65ab765450a374ceddb37ac4028e313d0cd 100644 (file)
@@ -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');
 ?>
    <br>
index 8f6291ebb5232b08fe7401dd37aac9b531db2950..62b62e4e80b29bd18cabfa87bb59313a99e12a3c 100644 (file)
     **/
 
    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');
 
index ee8ebebc6d1e222acc62a211328c9f5f03c6ba2b..d410520937bbc38942b5ce4ba34a244052e472dd 100644 (file)
    **/
 
    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);
index e3ebf8022026e8cf7eeb650cd01cf7391471aea0..fa3d601b0c9e62c12daf191480fdc996b5c2d024 100644 (file)
@@ -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 "<html><body bgcolor=\"ffffff\">\n";
       echo "<br><br>";
       echo "<center>";
index 630d585f85a6e76c4425f60cf3099ab1c8071923..b8bf19ab492d77119bff1f4b1becccb8f68445b6 100644 (file)
    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');
 
-?>
-<?php
    /////////////////////////////////////////////////////////////////////////////////
    //
    // incoming variables from URL:
@@ -40,9 +37,6 @@
    // open a connection on the imap port (143)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
-   /** If it was a successful login, lets load their preferences **/
-   include('../src/load_prefs.php');
-
    if (isset($newsort) && $newsort != $sort) {
       setPref($data_dir, $username, 'sort', $newsort);
    }
index 8071a435ebe56f36f4b69b7d6436f7fb9fbfc6da..de5471bbd36a76433970d2d3accd0b1fe4f0e6c2 100644 (file)
@@ -3,11 +3,9 @@
    /* $Id$ */
 
    include('../src/validate.php');
-   include('../functions/page_header.php');
    include('../functions/imap.php');
    include('../functions/imap_search.php');
    include('../functions/array.php');
-   include('../src/load_prefs.php');
 
    displayPageHeader($color, $mailbox);
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
index 3dd17fd977712fb8ed6bc8ac564bb32bc99e2216..413473f3ed21598ce69e3c37520439b308396c3f 100644 (file)
@@ -12,7 +12,6 @@
     **/
 
    include('../src/validate.php');
-   include ('../src/load_prefs.php');
    include ('../functions/prefs.php');
    include ('../functions/plugin.php');
 
@@ -25,7 +24,6 @@
            unlink($attachment_dir . $info['localfilename']);
        }
    }
-   set_up_language(getPref($data_dir, $username, 'language'));
 
    // If a user hits reload on the last page, $base_uri isn't set
    // because it was deleted with the session.
index f0e0b99a59261b6e8ef1b0fcaf049794ba025945..e8542ce9ca4c50541a2cb32720b2444f9320ef8e 100644 (file)
    // variables overwrite any passed in variables (for security)
    include ('../functions/strings.php');
    include ('../config/config.php');
-   
+   include ('../src/load_prefs.php');
+   include ('../functions/page_header.php');
+
+   // Set up the language
+   // i18n.php was included by auth.php
+   global $username, $data_dir;
+   set_up_language(getPref($data_dir, $username, 'language'));
 ?>