right_main_bottom src/right_main.php
login_top src/login.php
login_bottom src/login.php
+ html_top src/read_body.php
read_body_top src/read_body.php
read_body_bottom src/read_body.php
+ html_bottom src/read_body.php
search_before_form src/search.php
search_after_form src/search.php
search_bottom src/search.php
$Args[1]['your_plugin_name']['href'] = 'URL to link to';
$Args[1]['your_plugin_name']['text'] = 'What to display';
-
\ No newline at end of file
+
}
}
+
+ global $use_gettext;
+
+ // Detect whether gettext is installed.
+ // If it is, set the flag so we can use it.
+ if (! function_exists("_") ||
+ ! function_exists("bindtextdomain") ||
+ ! function_exists("textdomain"))
+ $use_gettext = false;
+ else
+ $use_gettext = true;
+
+
+ // Avoid warnings/errors
+ if (! function_exists("_")) {
+ function _($str) { return $str; };
+ }
+ if (! function_exists("bindtextdomain")) {
+ function bindtextdomain() { return; }
+ }
+ if (! function_exists("textdomain")) {
+ function textdomain() { return; }
+ }
+
+
+ // Set up the language to be output
+ // if $do_search is true, then scan the browser information
+ // for a possible language that we know
+ function set_up_language($sm_language, $do_search = false)
+ {
+ static $SetupAlready = 0;
+ global $HTTP_ACCEPT_LANGUAGE;
+
+ if ($SetupAlready)
+ return;
+ $SetupAlready = 1;
+
+ if ($do_search && ! $sm_language && isset($HTTP_ACCEPT_LANGUAGE)) {
+ $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
+ }
+
+ if (isset($sm_language) && $use_gettext &&
+ $sm_language != "en" && $squirrelmail_language != "" &&
+ $languages[$sm_language]["CHARSET"]) {
+ putenv("LC_ALL=".$sm_language);
+ bindtextdomain("squirrelmail", "../locale/");
+ textdomain("squirrelmail");
+ header ("Content-Type: text/html; charset=".$languages[$sm_language]["CHARSET"]);
+ }
+ }
?>
** the errors will be sent back through $response and $message
******************************************************************************/
function sqimap_read_data ($imap_stream, $pre, $handle_errors, $response, $message) {
- global $color;
+ global $color, $squirrelmail_language;
//$imap_general_debug = true;
$imap_general_debug = false;
$read = fgets ($imap_stream, 1024);
if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
$counter = 0;
- while ((substr($read, 0, strlen("$pre OK")) != "$pre OK") &&
- (substr($read, 0, strlen("$pre BAD")) != "$pre BAD") &&
- (substr($read, 0, strlen("$pre NO")) != "$pre NO")) {
+ while (! ereg("^$pre (OK|BAD|NO)(.*)$", $read, $regs)) {
$data[$counter] = $read;
$read = fgets ($imap_stream, 1024);
if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
$counter++;
}
if ($imap_general_debug) echo "--<br>";
- if (substr($read, 0, strlen("$pre OK")) == "$pre OK") {
- $response = "OK";
- $message = trim(substr($read, strlen("$pre OK"), strlen($read)));
- }
- else if (substr($read, 0, strlen("$pre BAD")) == "$pre BAD") {
- $response = "BAD";
- $message = trim(substr($read, strlen("$pre BAD"), strlen($read)));
- }
- else {
- $response = "NO";
- $message = trim(substr($read, strlen("$pre NO"), strlen($read)));
- }
if ($handle_errors == true) {
- if ($response == "NO") {
+ if ($regs[1] == "NO") {
+ set_up_language($squirrelmail_language);
echo "<br><b><font color=$color[2]>\n";
echo _("ERROR : Could not complete request.");
echo "</b><br>\n";
echo _("Reason Given: ");
- echo "$message</font><br>\n";
+ echo trim($regs[2]) . "</font><br>\n";
exit;
- } else if ($response == "BAD") {
+ } else if ($regs[1] == "BAD") {
+ set_up_language($squirrelmail_language);
echo "<br><b><font color=$color[2]>\n";
echo _("ERROR : Bad or malformed request.");
echo "</b><br>\n";
echo _("Server responded: ");
- echo "$message</font><br>\n";
+ echo trim($regs[2]) . "</font><br>\n";
exit;
}
}
// Decrypt the password
$password = OneTimePadDecrypt($password, $onetimepad);
- // This function can sometimes be called before the check for
- // gettext is done.
- if (!function_exists("_")) {
- function _($string) {
- return $string;
- }
- }
-
/** Do some error correction **/
if (!$imap_stream) {
if (!$hide) {
+ set_up_language($squirrelmail_language, true);
printf (_("Error connecting to IMAP server: %s.")."<br>\r\n", $imap_server_address);
echo "$error_number : $error_string<br>\r\n";
}
if (substr($read, 0, 7) != "a001 OK") {
if (!$hide) {
if (substr($read, 0, 8) == "a001 BAD") {
+ set_up_language($squirrelmail_language, true);
printf (_("Bad request: %s")."<br>\r\n", $read);
exit;
} else if (substr($read, 0, 7) == "a001 NO") {
// $squirrelmail_language is set by a cookie when
// the user selects language and logs out
- // Use HTTP content language negotiation if cookie
- // not set
- if (!isset($squirrelmail_language) && isset($HTTP_ACCEPT_LANGUAGE)) {
- $squirrelmail_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
- }
-
- if (isset($squirrelmail_language) && function_exists("bindtextdomain")) {
- if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
- putenv("LC_ALL=".$squirrelmail_language);
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
- }
- }
+ set_up_language($squirrelmail_language, true);
?>
<html>
session_destroy();
exit;
} else {
+ set_up_language($squirrelmail_language, true);
printf (_("Unknown error: %s")."<br>", $read);
exit;
}
** Returns the delimeter between mailboxes: INBOX/Test, or INBOX.Test...
******************************************************************************/
function sqimap_get_delimiter ($imap_stream) {
- fputs ($imap_stream, ". LIST \"INBOX\" \"\"\r\n");
- $read = sqimap_read_data($imap_stream, ".", true, $a, $b);
- $quote_position = strpos ($read[0], "\"");
- $delim = substr ($read[0], $quote_position+1, 1);
-
- return $delim;
+ fputs ($imap_stream, "a001 NAMESPACE\r\n");
+ $read = sqimap_read_data($imap_stream, "a001", true, $a, $b);
+ eregi("\"\" \"(.)\"", $read[0], $regs);
+ return $regs[1];
}
fputs ($imap_stream, "a001 EXAMINE \"$mailbox\"\r\n");
$read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message);
for ($i = 0; $i < count($read_ary); $i++) {
- if (substr(trim($read_ary[$i]), -6) == EXISTS) {
- $array = explode (" ", $read_ary[$i]);
- $num = $array[1];
+ if (ereg("[^ ]+ +([^ ]+) +EXISTS", $read_ary[$i], $regs)) {
+ return $regs[1];
}
}
- return $num;
+ return "BUG! Couldn't get number of messages in $mailbox!";
}
** lehresma@css.tayloru.edu
**/
- if (strpos($string, "<") && strpos($string, ">")) {
- $string = substr($string, strpos($string, "<")+1);
- $string = substr($string, 0, strpos($string, ">"));
+ if (ereg("<([^>]+)>", $string, $regs)) {
+ $string = $regs[1];
}
return trim($string);
}
** becomes: lkehresman@yahoo.com
******************************************************************************/
function sqimap_find_displayable_name ($string) {
- $string = " ".trim($string);
- $orig_string = $string;
- if (strpos($string, "<") && strpos($string, ">")) {
- if (strpos($string, "<") == 1) {
- $string = sqimap_find_email($string);
- } else {
- $string = trim($string);
- $string = substr($string, 0, strpos($string, "<"));
- $string = ereg_replace ("\"", "", $string);
- }
-
- if (trim($string) == "") {
- $string = sqimap_find_email($orig_string);
- }
- }
- return $string;
+ ereg("^\"?([^\"<]*)[\" <]*([^>]+)>?$", trim($string), $regs);
+ if ($regs[1] == '')
+ return $regs[2];
+ return $regs[1];
}
//fputs ($imap_stream, "a001 SEARCH UNSEEN NOT DELETED\r\n");
fputs ($imap_stream, "a001 STATUS \"$mailbox\" (UNSEEN)\r\n");
$read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message);
- $unseen = false;
-
- $read_ary[0] = trim($read_ary[0]);
- return substr($read_ary[0], strrpos($read_ary[0], " ")+1, (strlen($read_ary[0]) - strrpos($read_ary[0], " ") - 2));
+ ereg("UNSEEN ([0-9]+)", $read_ary[0], $regs);
+ return $regs[1];
}
$g = 0;
for ($i = 0; $i < count($read); $i++) {
- if (eregi ("^to:", $read[$i])) {
+ if (eregi ("^to:(.*)$", $read[$i], $regs)) {
//$to = sqimap_find_displayable_name(substr($read[$i], 3));
- $to = substr($read[$i], 3);
- } else if (eregi ("^from:", $read[$i])) {
+ $to = $regs[1];
+ } else if (eregi ("^from:(.*)$", $read[$i], $regs)) {
//$from = sqimap_find_displayable_name(substr($read[$i], 5));
- $from = substr($read[$i], 5);
- } else if (eregi ("^x-priority:", $read[$i])) {
- $priority = trim(substr($read[$i], 11));
- } else if (eregi ("^message-id:", $read[$i])) {
- $messageid = trim(substr($read[$i], 11));
- } else if (eregi ("^cc:", $read[$i])) {
- $cc = substr($read[$i], 3);
- } else if (eregi ("^date:", $read[$i])) {
- $date = substr($read[$i], 5);
- } else if (eregi ("^subject:", $read[$i])) {
- $subject = htmlspecialchars(eregi_replace ("^subject: ", "", $read[$i]));
- if (trim($subject) == "")
+ $from = $regs[1];
+ } else if (eregi ("^x-priority:(.*)$", $read[$i], $regs)) {
+ $priority = trim($regs[1]);
+ } else if (eregi ("^message-id:(.*)$", $read[$i], $regs)) {
+ $messageid = trim($regs[1]);
+ } else if (eregi ("^cc:(.*)$", $read[$i], $regs)) {
+ $cc = $regs[1];
+ } else if (eregi ("^date:(.*)$", $read[$i], $regs)) {
+ $date = $regs[1];
+ } else if (eregi ("^subject:(.*)$", $read[$i], $regs)) {
+ $subject = htmlspecialchars(trim($regs[1]));
+ if ($subject == "")
$subject = _("(no subject)");
- } else if (eregi ("^content-type:", $read[$i])) {
- $type = substr($read[$i], 14);
- $type = strtolower(trim($type));
+ } else if (eregi ("^content-type:(.*)$", $read[$i], $regs)) {
+ $type = strtolower(trim($regs[1]));
if ($pos = strpos($type, ";"))
$type = substr($type, 0, $pos);
$type = explode("/", $type);
$header = new small_header;
if ($sent == true)
- $header->from = $to;
+ $header->from = (trim($to) != '')? $to : _('(only Cc/Bcc)');
else
$header->from = $from;
function sqimap_get_flags ($imap_stream, $i) {
fputs ($imap_stream, "a001 FETCH $i:$i FLAGS\r\n");
$read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
- if (strpos($read[0], "FLAGS")) {
- $tmp = ereg_replace("\(", "", $read[0]);
- $tmp = ereg_replace("\)", "", $tmp);
- $tmp = str_replace("\\", "", $tmp);
- $tmp = substr($tmp, strpos($tmp, "FLAGS")+6, strlen($tmp));
- $tmp = trim($tmp);
- $flags = explode(" ", $tmp);
- } else {
- $flags[0] = "None";
- }
- return $flags;
+ if (ereg("FLAGS(.*)", $read[0], $regs))
+ return explode(" ", trim(ereg_replace('[\(\)\\]', '', $regs[1])));
+ return Array('None');
}
/******************************************************************************
$messages[$j]["TYPE0"] = $type[$j];
# fix SUBJECT-SORT to remove Re:
- if (substr($messages[$j]["SUBJECT-SORT"], 0, 3) == "re:" ||
- substr($messages[$j]["SUBJECT-SORT"], 0, 3) == "aw:")
- $messages[$j]["SUBJECT-SORT"] = trim(substr($messages[$j]["SUBJECT-SORT"], 3));
+ $re_abbr = # Add more here!
+ "vedr|sv|" . # Danish
+ "re|aw"; # English
+ if (eregi("^($re_abbr):[ ]*(.*)$",
+ $messages[$j]['SUBJECT-SORT'], $regs))
+ $messages[$j]['SUBJECT-SORT'] = $regs[2];
$num = 0;
while ($num < count($flags[$j])) {
fputs ($imap_stream, "a001 FETCH $id BODY[$ent_id]\r\n");
$topline = fgets ($imap_stream, 1024);
- $size = substr ($topline, strpos($topline, "{")+1);
- $size = substr ($size, 0, strpos($size, "}"));
- $read = fread ($imap_stream, $size);
- return $read;
+ if (ereg('\{([^\}]*)\}', $topline, $regs)) {
+ return fread ($imap_stream, $regs[1]);
+ }
+ else if (ereg('"([^"]*)"', $topline, $regs)) {
+ return $regs[1];
+ }
+ return "Body retrival error, please report this bug!\n\nTop line is \"$topline\"\n";
}
/* -[ END MIME DECODING ]----------------------------------------------------------- */
include ("../functions/plugin.php");
// Check to see if gettext is installed
- if (function_exists("_")) {
- // Setting the language to use for gettext if it is not English
- // (the default language) or empty.
- $squirrelmail_language = getPref ($data_dir, $username, "language");
- if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
- putenv("LC_ALL=$squirrelmail_language");
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- $default_charset = $languages[$squirrelmail_language]["CHARSET"];
- }
- } else {
- function _($string) {
- return $string;
- }
- }
+ set_up_language(getPref($data_dir, $username, "language"));
// This is done to ensure that the character set is correct.
if ($default_charset != "")
// We need to do it twice to catch times where there
// are an odd number of spaces
+ if (ereg("^ (.*)$", $line, $regs))
+ $line = " " . $regs[1];
$line = str_replace(' ', ' ', $line);
$line = str_replace(' ', ' ', $line);
$line = nl2br($line);
session_start();
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
if (!isset($config_php))
include("../config/config.php");
if (!isset($page_header_php))
include("../functions/addressbook.php");
is_logged_in();
+
+ include("../src/load_prefs.php");
+
+ set_up_language(getPref($data_dir, $username, "language"));
+
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
/* ================= End of functions ================= */
session_start();
+
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
if(!isset($logged_in)) {
+ set_up_language($squirrelmail_language, true);
echo _("You must login first.");
exit;
}
if(!isset($username) || !isset($key)) {
+ set_up_language($squirrelmail_language, true);
echo _("You need a valid user and password to access this page!");
exit;
}
// Insert hidden data
function addr_insert_hidden() {
global $body, $subject, $send_to, $send_to_cc, $send_to_bcc;
- printf("<input type=hidden value=\"%s\" name=body>\n",
- htmlspecialchars($body));
- printf("<input type=hidden value=\"%s\" name=subject>\n",
- htmlspecialchars($subject));
- printf("<input type=hidden value=\"%s\" name=send_to>\n",
- htmlspecialchars($send_to));
- printf("<input type=hidden value=\"%s\" name=send_to_cc>\n",
- htmlspecialchars($send_to_cc));
- printf("<input type=hidden value=\"%s\" name=send_to_bcc>\n",
- htmlspecialchars($send_to_bcc));
- printf("<input type=hidden value=\"true\" name=from_htmladdr_search>\n");
+
+ echo "<input type=hidden value=\"";
+ if (substr($body, 0, 1) == "\r")
+ echo "\n";
+ echo htmlspecialchars($body) . "\" name=body>\n";
+ echo "<input type=hidden value=\"" . htmlspecialchars($subject)
+ . "\" name=subject>\n";
+ echo "<input type=hidden value=\"" . htmlspecialchars($send_to)
+ . "\" name=send_to>\n";
+ echo "<input type=hidden value=\"" . htmlspecialchars($send_to_cc)
+ . "\" name=send_to_cc>\n";
+ echo "<input type=hidden value=\"" . htmlspecialchars($send_to_bcc)
+ . "\" name=send_to_bcc>\n";
+ echo "<input type=hidden value=\"true\" name=from_htmladdr_search>\n";
}
sqUnWordWrap($body);
$body_ary = explode("\n", $body);
+ while (ereg("^[>\s]*$", $body_ary[count($body_ary) - 1])) {
+ unset($body_ary[count($body_ary) - 1]);
+ }
$body = "";
for ($i=0; $i < count($body_ary); $i++) {
if (! $forward_id)
{
- if (preg_match('/^[\s>]+/', $body_ary[$i]))
+ if (ereg('^[\s>]+', $body_ary[$i]))
{
$body_ary[$i] = '>' . $body_ary[$i];
}
$bodyTop .= "\n";
$body = $bodyTop . $body;
}
+
+ $body = ereg_replace('\\\\', '\\\\', $body);
sqimap_mailbox_close($imapConnection);
return;
global $send_to, $send_to_cc, $reply_subj, $forward_subj, $body,
$passed_body, $color, $use_signature, $signature, $editor_size,
$attachments, $subject, $newmail, $use_javascript_addr_book,
- $send_to_bcc, $reply_id, $mailbox, $from_htmladdr_search;
+ $send_to_bcc, $reply_id, $mailbox, $from_htmladdr_search,
+ $location_of_buttons;
$subject = sqStripSlashes(decodeHeader($subject));
$reply_subj = decodeHeader($reply_subj);
}
printf("<INPUT TYPE=hidden NAME=mailbox VALUE=\"%s\">\n", htmlspecialchars($mailbox));
echo "<TABLE WIDTH=\"100%\" ALIGN=center CELLSPACING=0 BORDER=0>\n";
+
+ if ($location_of_buttons == 'top') showComposeButtonRow();
+
echo " <TR>\n";
echo " <TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
echo _("To:");
}
echo "</td></tr>\n\n";
- echo " <TR><td>\n </td><td>\n";
- if ($use_javascript_addr_book) {
- echo " <SCRIPT LANGUAGE=JavaScript><!--\n document.write(\"";
- echo " <input type=button value=\\\""._("Addresses")."\\\" onclick='javascript:open_abook();'>\");";
- echo " // --></SCRIPT><NOSCRIPT>\n";
- echo " <input type=submit name=\"html_addr_search\" value=\""._("Addresses")."\">";
- echo " </NOSCRIPT>\n";
- } else {
- echo " <input type=submit name=\"html_addr_search\" value=\""._("Addresses")."\">";
- }
- echo "\n <INPUT TYPE=SUBMIT NAME=send VALUE=\"". _("Send") . "\">\n";
-
- do_hook("compose_button_row");
-
- echo " </TD>\n";
- echo " </TR>\n\n";
-
+ if ($location_of_buttons == 'between') showComposeButtonRow();
echo " <TR>\n";
echo " <TD BGCOLOR=\"$color[4]\" COLSPAN=2>\n";
echo " <TEXTAREA NAME=body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>";
+ echo htmlspecialchars($body);
if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
- echo (htmlspecialchars($body)) . "\n\n-- \n" . htmlspecialchars($signature);
- } else {
- echo (htmlspecialchars($body));
+ echo "\n\n-- \n" . htmlspecialchars($signature);
}
echo "</TEXTAREA><BR>\n";
echo " </TD>\n";
echo " </TR>\n";
- echo " <TR><TD> </TD><TD ALIGN=LEFT><INPUT TYPE=SUBMIT NAME=send VALUE=\""._("Send")."\"></TD></TR>\n";
+
+ if ($location_of_buttons == 'bottom')
+ showComposeButtonRow();
+ else {
+ echo " <TR><TD> </TD><TD ALIGN=LEFT><INPUT TYPE=SUBMIT NAME=send VALUE=\""._("Send")."\"></TD></TR>\n";
+ }
// This code is for attachments
echo " <tr>\n";
echo "</FORM>";
do_hook("compose_bottom");
}
+
+ function showComposeButtonRow() {
+ echo " <TR><td>\n </td><td>\n";
+ if ($use_javascript_addr_book) {
+ echo " <SCRIPT LANGUAGE=JavaScript><!--\n document.write(\"";
+ echo " <input type=button value=\\\""._("Addresses")."\\\" onclick='javascript:open_abook();'>\");";
+ echo " // --></SCRIPT><NOSCRIPT>\n";
+ echo " <input type=submit name=\"html_addr_search\" value=\""._("Addresses")."\">";
+ echo " </NOSCRIPT>\n";
+ } else {
+ echo " <input type=submit name=\"html_addr_search\" value=\""._("Addresses")."\">";
+ }
+ echo "\n <INPUT TYPE=SUBMIT NAME=send VALUE=\"". _("Send") . "\">\n";
+
+ do_hook("compose_button_row");
+
+ echo " </TD>\n";
+ echo " </TR>\n\n";
+ }
function showSentForm () {
echo "<BR><BR><BR><CENTER><B>Message Sent!</B><BR><BR>";
include("../functions/mime.php");
if (!isset($date_php))
include("../functions/date.php");
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
include("../src/load_prefs.php");
$body = decodeBody($body, $header->encoding);
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-type: application/octet-stream; name=\"$filename\"");
+ set_up_language(getPref($data_dir, $username, "language"));
if ($type1 == "plain") {
echo _("Subject") . ": " . decodeHeader(sqStripSlashes($top_header->subject)) . "\n";
echo " " . _("From") . ": " . decodeHeader(sqStripSlashes($top_header->from)) . "\n";
session_start();
if(!isset($username)) {
+ set_up_language($squirrelmail_language, true);
echo "You need a valid user and password to access this page!";
exit;
}
$location_of_bar = getPref($data_dir, $username, 'location_of_bar');
if ($location_of_bar == '')
$location_of_bar = 'left';
+
+ $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
+ if ($location_of_buttons == '')
+ $location_of_buttons = 'between';
do_hook("loading_prefs");
if (!isset($plugin_php))
include("../functions/plugin.php");
- // let's check to see if they compiled with gettext support
- if (!function_exists("_")) {
- function _($string) {
- return $string;
- }
- } else {
- // $squirrelmail_language is set by a cookie when the user selects
- // language and logs out
-
- // Use HTTP content language negotiation if cookie not set
- if (!isset($squirrelmail_language) && isset($HTTP_ACCEPT_LANGUAGE)) {
- $squirrelmail_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
- }
-
- if (isset($squirrelmail_language)) {
- if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
- putenv("LC_ALL=".$squirrelmail_language);
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
- }
- }
- }
+ // $squirrelmail_language is set by a cookie when the user selects
+ // language and logs out
+ set_up_language($squirrelmail_language, true);
// Need the base URI to set the cookies. (Same code as in webmail.php)
ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
setPref($data_dir, $username, "left_refresh", $leftrefresh);
setPref($data_dir, $username, "language", $language);
setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
+ setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
setPref($data_dir, $username, "left_size", $leftsize);
setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
</td>
</tr>
<tr>
- <td align=right nowrap><?php echo _("Language"); ?>:
+ <td valign=top align=right nowrap><?php echo _("Language"); ?>:
</td><td>
<?php
echo " <tt><select name=language>\n";
- reset ($languages);
- while (list($code, $name)=each($languages)) {
+ foreach ($languages as $code => $name) {
if ($code==$chosen_language)
echo " <OPTION SELECTED VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
else
echo " <OPTION VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
-
- }
+ }
echo " </select></tt>";
+ if (! $use_gettext)
+ echo "<br><small>This system doesn't support multiple languages</small>";
+
?>
</td>
<tr>
<td align=right nowrap>
- </td><td>
- <?php echo _("Use Javascript or HTML addressbook?") . "<br>";
+ <?php echo _("Use Javascript or HTML addressbook?") . "</td><td>";
if ($use_javascript_addr_book == true) {
echo " <input type=radio name=javascript_abook value=1 checked> " . _("JavaScript") . " ";
echo " <input type=radio name=javascript_abook value=0> " . _("HTML");
</select>
</td>
</tr>
+ <tr>
+ <td align=right nowrap><?PHP echo _('Location of buttons when composing') ?>:</td>
+ <td><select name="button_new_location">
+ <option value="top"<?PHP
+ if ($location_of_buttons == 'top') echo ' SELECTED';
+ ?>><?PHP echo _('Before headers'); ?></option>
+ <option value="between"<?PHP
+ if ($location_of_buttons == 'between') echo ' SELECTED';
+ ?>><?PHP echo _('Between headers and message body'); ?></option>
+ <option value="bottom"<?PHP
+ if ($location_of_buttons == 'bottom') echo ' SELECTED';
+ ?>><?PHP echo _('After message body'); ?></option>
+ </select>
+ </td>
+ </tr>
<tr>
<td align=right nowrap><?php echo _("Width of folder list"); ?>:
</td><td>
include("../src/load_prefs.php");
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imapConnection, $mailbox);
+ do_hook("html_top");
displayPageHeader($color, $mailbox);
if ($view_hdr) {
$body = formatBody($imapConnection, $message, $color, $wrap_at);
- echo "$body";
-
+ echo $body;
+
echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
echo " <TR><TD BGCOLOR=\"$color[9]\"> </TD></TR>";
echo "</TABLE>\n";
do_hook("read_body_bottom");
+ do_hook("html_bottom");
sqimap_logout($imapConnection);
?>
**
**/
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
session_start();
if(!isset($logged_in)) {
+ set_up_language($squirrelmail_language, true);
echo _("You must login first.");
exit;
}
if(!isset($username) || !isset($key)) {
+ set_up_language($squirrelmail_language, true);
echo _("You need a valid user and password to access this page!");
exit;
}
session_start();
if(!isset($logged_in)) {
+ set_up_language($squirrelmail_language, true);
echo _("You must login first.");
exit;
}
if(!isset($username) || !isset($key)) {
+ set_up_language($squirrelmail_language, true);
echo _("You need a valid user and password to access this page!");
exit;
}
if (!isset($plugin_php))
include ("../functions/plugin.php");
- // Quick Fix for Gettext in LogOut Screen
- if (!function_exists("_")) {
- function _($string) {
- return $string;
- }
- }
-
- $squirrelmail_language = getPref ($data_dir, $username, "language");
- if (isset($squirrelmail_language)) {
- if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
- putenv("LC_ALL=".$squirrelmail_language);
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
-
- // Setting cookie to use on the login screen the next time the
- // same user logs in.
- setcookie("squirrelmail_language", $squirrelmail_language,
- time()+2592000);
-
- }
- }
+ set_up_language(getPref($data_dir, $username, "language"));
do_hook("logout");
setcookie("username", "", 0, $base_uri);
session_register ("base_uri");
+ if (!isset($i18n_php))
+ include ("../functions/i18n.php");
+
if(!isset($username)) {
+ set_up_language($squirrelmail_language);
echo _("You need a valid user and password to access this page!");
exit;
}
include ("../src/load_prefs.php");
+ // We'll need this to later have a noframes version
+ set_up_language(getPref($data_dir, $username, "language"));
+
echo "<html><head>\n";
echo "<TITLE>";
echo "$org_title";