* More minor changes
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 May 2001 19:11:58 +0000 (19:11 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 May 2001 19:11:58 +0000 (19:11 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1367 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/auth.php
functions/i18n.php
functions/page_header.php
src/download.php
src/login.php
src/redirect.php
src/signout.php
src/validate.php

index ea692eeb653e1c954c6d59963aea9140f915fa63..8cddd0024bde4860ca5deb4a99115fbdde26b3a0 100644 (file)
       return; 
    define ('auth_php', true);
    
-   include '../functions/i18n.php';
-
    function is_logged_in () {
+      global $squirrelmail_language;
+      
       if (session_is_registered('user_is_logged_in'))
          return;
-        
+
+      set_up_language($squirrelmail_language, true);
+      
       echo "<html><body bgcolor=\"ffffff\">\n";
       echo "<br><br>";
       echo "<center>";
index fec6daff1e0c0a2f3884e4d00a4e9e270edf3336..0c30fa19efad4f57ab166eb2433ee9c98fe06eaa 100644 (file)
          bindtextdomain('squirrelmail', '../locale/');
          textdomain('squirrelmail');
          header ('Content-Type: text/html; charset=' . $languages[$sm_language]['CHARSET']);
-         $charset_headers_sent=true;
       }
-      return $charset_headers_sent;
    }
 
    function set_my_charset(){
index 6b6663edb6df6eab77bb48d85a2d55faca4b00c7..2bc875069a79839dff551aa4976ab22349c5367d 100644 (file)
        return;
    define('page_header_php', true);
 
-   include('../src/validate.php');
-   include("../functions/prefs.php");
-   include("../functions/plugin.php");
-
-   // Check to see if gettext is installed
-   $headers_sent=set_up_language(getPref($data_dir, $username, "language"));
-
-   // This is done to ensure that the character set is correct.
-   // But first checks whether we have already sent headers
-   // with charset when we were setting up the user language.
-   // Otherwise user ends up with the default charset overriding
-   // his selected one.
-   if (!$headers_sent && $default_charset != "")
-      header ("Content-Type: text/html; charset=$default_charset");
+   // Always set up the language before calling these functions
 
    function displayHtmlHeader ($title="SquirrelMail") {
      global $theme_css;
index 5cf6fb839977022d1536aace664966848ff5a508..b9976a8d9113bee5a803aa10175a1328ce8d2389 100644 (file)
    if (isset($absolute_dl) && $absolute_dl == "true") {
       switch($type0) {
          case "text":
-            set_up_language(getPref($data_dir, $username, "language"));
            DumpHeaders($type0, $type1, $filename, 1);
             $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id);
             $body = decodeBody($body, $header->encoding);
index b9905252d70586788318bd34d67e7eb9e24997bc..4b7218e97bca7c53247490f6adcc584010f4fcfe 100644 (file)
@@ -34,7 +34,6 @@
 
    setcookie("username", '', 0, $base_uri);
    setcookie("key", '', 0, $base_uri);
-   setcookie("logged_in", 0, 0, $base_uri);
    header ("Pragma: no-cache");
 
    // In case the last session was not terminated properly, make sure
index fa3d601b0c9e62c12daf191480fdc996b5c2d024..074fe366690fffda9ea54f9da3275b0aedeadfe4 100644 (file)
@@ -14,7 +14,7 @@
     **/
 
    include('../functions/i18n.php');
-   include ('../functions/strings.php');
+   include('../functions/strings.php');
    include('../config/config.php');
 
    // Before starting the session, the base URI must be known.
    session_unregister ('user_is_logged_in');
    session_register ('base_uri');
 
+   if (! isset($squirrelmail_language)) 
+      $squirrelmail_language = '';
+   set_up_language($squirrelmail_language, true);
+   
    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>";
@@ -56,7 +57,7 @@
    include ('../functions/imap.php');
    include ('../functions/plugin.php');
 
-   if (!session_is_registered('user_is_logged_in') || $logged_in != 1) {
+   if (!session_is_registered('user_is_logged_in')) {
       do_hook ('login_before');
 
       $onetimepad = OneTimePadCreate(strlen($secretkey));
@@ -80,7 +81,6 @@
 
       setcookie('username', $login_username, 0, $base_uri);
       setcookie('key', $key, 0, $base_uri);
-      setcookie('logged_in', 1, 0, $base_uri);
       do_hook ('login_verified');
    }
 
index 413473f3ed21598ce69e3c37520439b308396c3f..10f9b63a883fa3fb8057d0c51bfb4db07c5d01ed 100644 (file)
@@ -35,7 +35,6 @@
    do_hook('logout');
    setcookie('username', '', 0, $base_uri);
    setcookie('key', '', 0, $base_uri);
-   setcookie('logged_in', '', 0, $base_uri);
    session_destroy();
 
    if ($signout_page) {
index e8542ce9ca4c50541a2cb32720b2444f9320ef8e..83d22e32f58e9f4909cb04f0965b520b4d71d799 100644 (file)
@@ -13,6 +13,7 @@
    define ('validate_php', true); 
 
    session_start();
+   include ('../functions/i18n.php');
    include ('../functions/auth.php');
    
    is_logged_in();