Bladeren bron

* 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

Tyler Akins 24 jaren geleden
bovenliggende
commit
36cf35b7f1

+ 0 - 4
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'));
    
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

+ 0 - 2
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();
 

+ 0 - 2
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() {

+ 0 - 3
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);

+ 0 - 2
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))
    {

+ 0 - 2
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);

+ 0 - 3
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:

+ 0 - 2
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);
 

+ 0 - 2
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"));
 

+ 0 - 2
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);

+ 0 - 2
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:

+ 0 - 2
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) {

+ 0 - 2
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);
 

+ 0 - 2
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);

+ 0 - 2
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");

+ 0 - 2
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

+ 9 - 5
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 "               </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";

+ 0 - 2
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;

+ 0 - 2
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"));
 
 ?>

+ 0 - 2
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');  

+ 0 - 2
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');
 

+ 0 - 2
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');
 ?>
    <br>

+ 0 - 2
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();

+ 0 - 2
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');
 ?>
    <br>

+ 0 - 2
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');
 

+ 0 - 2
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);

+ 3 - 0
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 "<html><body bgcolor=\"ffffff\">\n";
       echo "<br><br>";
       echo "<center>";

+ 0 - 6
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');
 
-?>
-<?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);
    }

+ 0 - 2
src/search.php

@@ -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);

+ 0 - 2
src/signout.php

@@ -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.

+ 7 - 1
src/validate.php

@@ -104,5 +104,11 @@
    // 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'));
 ?>