From a37f3771b11544a29ebd521a69599381c90e7df2 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Tue, 1 Aug 2000 10:58:39 +0000 Subject: [PATCH] - Fixed bug when one message left in message index, displayed wrong one - Added MOTD back in git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@664 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 6 +++--- config/config_default.php | 2 +- functions/mailbox_display.php | 3 +-- functions/strings.php | 4 ++++ src/login.php | 1 + src/right_main.php | 10 ++++++++++ src/webmail.php | 3 ++- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/config/conf.pl b/config/conf.pl index 1bb23ae2..df957213 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -396,9 +396,9 @@ while (($command ne "q") && ($command ne "Q")) { if ($command == 1) { command61(); } elsif ($command == 2) { command62(); } } elsif ($menu == 7) { - if ($command == 1) { $motd = command71(); } + if ($command == 1) { $motd = command71(); } } elsif ($menu == 8) { - if ($command == 1) { $motd = command81(); } + if ($command == 1) { $plugins = command81(); } } } } @@ -587,7 +587,7 @@ sub command18 { sub command71 { print "\nYou can now create the welcome message that is displayed\n"; print "every time a user logs on. You can use HTML or just plain\n"; - print "text.\n\n(Type @ on a blank line to exit)\n"; + print "text. If you do not wish to have one, just make it blank.\n\n(Type @ on a blank line to exit)\n"; $new_motd = ""; do { diff --git a/config/config_default.php b/config/config_default.php index 13e0c983..79518ad3 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -41,7 +41,7 @@ // $sendmail_path = "/usr/sbin/sendmail"; // This is displayed right after they log in - $motd = "You are using SquirrelMail's web-based email client. If you run into any bugs or have suggestions, please report them to our mailing list"; + $motd = ""; // Whether or not to use a special color for special folders. If not, special // folders will be the same color as the other folders diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index ac5ba8e4..2a854136 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -182,7 +182,6 @@ } else { $endMessage = $numMessages; } - if ($endMessage < $startMessage) { $startMessage = $startMessage - $show_num; @@ -295,7 +294,7 @@ if ($numMessages == 0) { // if there's no messages in this folder echo "

". _("THIS FOLDER IS EMPTY") ."
 
"; } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different. - $i = $startMessage - 1; + $i = $startMessage; reset($msort); do { $key = key($msort); diff --git a/functions/strings.php b/functions/strings.php index ca54ee84..9a4bb5c0 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -124,6 +124,10 @@ $line = $body_ary[$i]; $line = charset_decode($charset, $line); + if (strlen($line) - 2 >= $wrap_at) { + $line = wordWrap($line, $wrap_at); + } + $line = str_replace(" ", " ", $line); $line = str_replace("\t", "        ", $line); $line = nl2br($line); diff --git a/src/login.php b/src/login.php index 09e3d6f0..4b1e47c6 100644 --- a/src/login.php +++ b/src/login.php @@ -98,6 +98,7 @@ echo " \n"; echo " \n"; echo "\n"; + echo "\n"; echo "\n"; ?> diff --git a/src/right_main.php b/src/right_main.php index c1f96f84..636ff5b1 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -74,6 +74,16 @@ sqimap_mailbox_select($imapConnection, $mailbox); displayPageHeader($color, $mailbox); + if ($just_logged_in == 1 && strlen(trim($motd)) > 0) { + echo "

"; + echo "
"; + echo "
"; + echo "$motd"; + echo "
"; + echo "
"; + echo "

"; + } + if (isset($newsort)) { $sort = $newsort; session_register("sort"); diff --git a/src/webmail.php b/src/webmail.php index 773995d7..2831999e 100644 --- a/src/webmail.php +++ b/src/webmail.php @@ -94,7 +94,8 @@ echo ""; } else { echo ""; - echo ""; + if (!isset($just_logged_in)) $just_logged_in = 0; + echo ""; } ?> -- 2.25.1