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>";
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(){
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;
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);
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
**/
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>";
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));
setcookie('username', $login_username, 0, $base_uri);
setcookie('key', $key, 0, $base_uri);
- setcookie('logged_in', 1, 0, $base_uri);
do_hook ('login_verified');
}
do_hook('logout');
setcookie('username', '', 0, $base_uri);
setcookie('key', '', 0, $base_uri);
- setcookie('logged_in', '', 0, $base_uri);
session_destroy();
if ($signout_page) {
define ('validate_php', true);
session_start();
+ include ('../functions/i18n.php');
include ('../functions/auth.php');
is_logged_in();