* 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 a042eae..f12575e 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 a8dd816..6c42aa1 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 7a683a4..9cdf82a 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 8201f4c..4789080 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 b1a9221..f7817bf 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 691c97a..dd59af6 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 37cb370..5cf6fb8 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 486b15e..16d54e0 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 4052a9a..ed1dac5 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 a16b43d..607bbac 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 7cbea84..7cda701 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 e2db9cc..99324ca 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 44c7a69..a7803a8 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 286064e..5c04336 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 f689c6d..e95e0b1 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 e2b6872..324f0a8 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 04ee698..b990525 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 953fcbd..c5f4c83 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 b0dc93d..3e079eb 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 a117f11..fc84d56 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 139a85f..1f05f8b 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 7d96320..83627a7 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 92152a2..8233855 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 f18e44d..7c4ca65 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 8f6291e..62b62e4 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 ee8ebeb..d410520 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 e3ebf80..fa3d601 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 630d585..b8bf19a 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 8071a43..de5471b 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 3dd17fd..413473f 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 f0e0b99..e8542ce 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'));
 ?>