Browse Source

- Fixed bug when one message left in message index, displayed wrong one
- Added MOTD back in

Luke Ehresman 25 years ago
parent
commit
d1bc9ef85e
7 changed files with 22 additions and 7 deletions
  1. 3 3
      config/conf.pl
  2. 1 1
      config/config_default.php
  3. 1 2
      functions/mailbox_display.php
  4. 4 0
      functions/strings.php
  5. 1 0
      src/login.php
  6. 10 0
      src/right_main.php
  7. 2 1
      src/webmail.php

+ 3 - 3
config/conf.pl

@@ -396,9 +396,9 @@ while (($command ne "q") && ($command ne "Q")) {
          if    ($command == 1) { command61(); }
          if    ($command == 1) { command61(); }
          elsif ($command == 2) { command62(); }
          elsif ($command == 2) { command62(); }
       } elsif ($menu == 7) {
       } elsif ($menu == 7) {
-         if    ($command == 1) { $motd = command71(); }
+         if    ($command == 1) { $motd             = command71(); }
       } elsif ($menu == 8) {
       } elsif ($menu == 8) {
-         if    ($command == 1) { $motd = command81(); }
+         if    ($command == 1) { $plugins = command81(); }
       }
       }
    }   
    }   
 }
 }
@@ -587,7 +587,7 @@ sub command18 {
 sub command71 {
 sub command71 {
    print "\nYou can now create the welcome message that is displayed\n";
    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 "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 = "";
    $new_motd = "";
    do {
    do {

+ 1 - 1
config/config_default.php

@@ -41,7 +41,7 @@
 //    $sendmail_path = "/usr/sbin/sendmail";
 //    $sendmail_path = "/usr/sbin/sendmail";
 
 
 //  This is displayed right after they log in
 //  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 <A HREF=\"mailto:squirrelmail-list@sourceforge.net\">mailing list</A>";
+   $motd = "";
 
 
 //  Whether or not to use a special color for special folders.  If not, special
 //  Whether or not to use a special color for special folders.  If not, special
 //  folders will be the same color as the other folders
 //  folders will be the same color as the other folders

+ 1 - 2
functions/mailbox_display.php

@@ -182,7 +182,6 @@
       } else {
       } else {
          $endMessage = $numMessages;
          $endMessage = $numMessages;
       }
       }
-
       
       
       if ($endMessage < $startMessage) {
       if ($endMessage < $startMessage) {
          $startMessage = $startMessage - $show_num;
          $startMessage = $startMessage - $show_num;
@@ -295,7 +294,7 @@
       if ($numMessages == 0) { // if there's no messages in this folder
       if ($numMessages == 0) { // if there's no messages in this folder
          echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=5><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR>&nbsp;</CENTER></TD></TR>";
          echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=5><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR>&nbsp;</CENTER></TD></TR>";
       } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different.
       } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different.
-         $i = $startMessage - 1;
+         $i = $startMessage;
          reset($msort);
          reset($msort);
          do {
          do {
             $key = key($msort);
             $key = key($msort);

+ 4 - 0
functions/strings.php

@@ -124,6 +124,10 @@
          $line = $body_ary[$i];
          $line = $body_ary[$i];
          $line = charset_decode($charset, $line);
          $line = charset_decode($charset, $line);
          
          
+         if (strlen($line) - 2 >= $wrap_at) {
+            $line = wordWrap($line, $wrap_at);  
+         }
+         
          $line = str_replace(" ", "&nbsp;", $line);
          $line = str_replace(" ", "&nbsp;", $line);
          $line = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $line);
          $line = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $line);
          $line = nl2br($line);
          $line = nl2br($line);

+ 1 - 0
src/login.php

@@ -98,6 +98,7 @@
    echo "      </TD>\n";
    echo "      </TD>\n";
    echo "   </TR>\n";
    echo "   </TR>\n";
    echo "</TABLE>\n";
    echo "</TABLE>\n";
+   echo "<input type=hidden name=just_logged_in value=1>\n";
    echo "</FORM>\n";
    echo "</FORM>\n";
 ?>
 ?>
 </BODY>
 </BODY>

+ 10 - 0
src/right_main.php

@@ -74,6 +74,16 @@
    sqimap_mailbox_select($imapConnection, $mailbox);
    sqimap_mailbox_select($imapConnection, $mailbox);
    displayPageHeader($color, $mailbox);
    displayPageHeader($color, $mailbox);
 
 
+   if ($just_logged_in == 1 && strlen(trim($motd)) > 0) {
+      echo "<center><br>";
+      echo "<table width=70% cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=\"$color[9]\">";
+      echo "<table width=100% cellpadding=5 cellspacing=1 border=0><tr><td bgcolor=\"$color[4]\">";
+      echo "$motd";
+      echo "</td></tr></table>";
+      echo "</td></tr></table>";
+      echo "</center><br>";
+   }
+
 	if (isset($newsort)) {
 	if (isset($newsort)) {
 		$sort = $newsort;
 		$sort = $newsort;
 		session_register("sort");
 		session_register("sort");

+ 2 - 1
src/webmail.php

@@ -94,7 +94,8 @@
       echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
       echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
    } else {
    } else {
       echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
       echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
-      echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">";
+      if (!isset($just_logged_in)) $just_logged_in = 0;
+      echo "<FRAME SRC=\"right_main.php?just_logged_in=$just_logged_in\" NAME=\"right\">";
    }
    }
 
 
 ?>
 ?>