some cleanup
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jan 2002 11:53:18 +0000 (11:53 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jan 2002 11:53:18 +0000 (11:53 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2159 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/auth.php
src/download.php
src/image.php
src/read_body.php
src/validate.php

index bb4dfb590073f4427cd378b7ca50f0e4562ef5a7..170f3280da385cc175e4c34ec38dbab50d3a107e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,9 @@
 *** Squirrelmail Stable Series 1.2 ***
 **************************************
 
-Version 1.2.3 -- ??
--------------------
-  - Fixed focus system on pages that contains forms.
+Version 1.2.3 -- cvs
+--------------------
+  - Fixed focus system on pages that contain forms.
   - Fixed IMAP code to send different command identifiers as per 
     section 2.2.1 of RFC 2060.
   - Fixed 'sticky priority' so that replies are set to the same
@@ -20,7 +20,6 @@ Version 1.2.3 -- ??
     make it bigger or smaller depending on their screen size. Sysops may add
     or remove these system-defined css located in themes/css/
   
-
 Version 1.2.2 -- 1 January 2002
 -------------------------------
 
index 8d71465d2fbec025976161b483d75aed69dc2e1d..287be6ce7013143de410f98aefd0d5d3b7a9cadd 100644 (file)
@@ -32,4 +32,4 @@ function is_logged_in () {
     exit;
 }
 
-?>
+?>
\ No newline at end of file
index 6ba0939e9582b890ec5d59247809f3e041683353..abbadcbd3ec72d5cdf00a518ed4922586c4cd7be 100644 (file)
@@ -104,11 +104,17 @@ require_once('../functions/date.php');
    }
 
    if (strlen($filename) < 1) {
-      if ($type1 == "plain" && $type0 == "text")                  $suffix = "txt";
-      else if ($type1 == "richtext" && $type0 == "text")          $suffix = "rtf";
-      else if ($type1 == "postscript" && $type0 == "application") $suffix = "ps";
-      else if ($type1 == "message" && $type0 == "rfc822")         $suffix = "msg";
-      else $suffix = $type1;
+      if ($type1 == 'plain' && $type0 == 'text') {
+          $suffix = 'txt';
+      } else if ($type1 == 'richtext' && $type0 == 'text') {
+          $suffix = 'rtf';
+      } else if ($type1 == 'postscript' && $type0 == 'application') {
+          $suffix = 'ps';
+      } else if ($type1 == 'message' && $type0 == 'rfc822') {
+          $suffix = 'msg';
+      } else {
+          $suffix = $type1;
+      }
 
       $filename = "untitled$passed_ent_id.$suffix";
    }
index 0e6763c2dcc49562ab6c80a23f919a997a1bc6c1..4cad2b0037f5119c1f9f5b119b37fd01ac59e504 100644 (file)
  * $Id$
  */
 
-/*****************************************************************/
-/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!!           ***/
-/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION.             ***/
-/***    + Base level indent should begin at left margin, as    ***/
-/***      the require_once below looks.                        ***/
-/***    + All identation should consist of four space blocks   ***/
-/***    + Tab characters are evil.                             ***/
-/***    + all comments should use "slash-star ... star-slash"  ***/
-/***      style -- no pound characters, no slash-slash style   ***/
-/***    + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD      ***/
-/***      ALWAYS USE { AND } CHARACTERS!!!                     ***/
-/***    + Please use ' instead of ", when possible. Note "     ***/
-/***      should always be used in _( ) function calls.        ***/
-/*** Thank you for your help making the SM code more readable. ***/
-/*****************************************************************/
-
 require_once('../src/validate.php');
 require_once('../functions/date.php');
 require_once('../functions/page_header.php');
 require_once('../src/load_prefs.php');
 
-   displayPageHeader($color, 'None');
-
-   echo '<BR>' . 
-        '<TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>' .
-        "\n" .
-        '<TR><TD BGCOLOR="' . $color[0] . '">' .
-        '<B><CENTER>' .
-        _("Viewing an image attachment") . " - ";
-   if (isset($where) && isset($what)) {
-      // from a search
-      echo '<a href="../src/read_body.php?mailbox=' . urlencode($mailbox) .
-            '&passed_id=' . $passed_id . '&where=' . urlencode($where) . 
-            '&what=' . urlencode($what). '">' . _("View message") . '</a>';
-   } else {   
-      echo '<a href="../src/read_body.php?mailbox=' . urlencode($mailbox) .
-           '&passed_id=' . $passed_id . '&startMessage=' . $startMessage .
-           '&show_more=0">' . _("View message") . '</a>';
-   }   
-
-   $DownloadLink = '../src/download.php?passed_id=' . $passed_id .
-                   '&mailbox=' . urlencode($mailbox) . 
-                   '&passed_ent_id=' . $passed_ent_id . '&absolute_dl=true';
-
-   echo '</b></td></tr>' . "\n" .
-        '<tr><td align=center><A HREF="' . $DownloadLink . '">' .
-        _("Download this as a file") .
-        '</A></B><BR>&nbsp;' . "\n" .
-        '</TD></TR></TABLE>' . "\n" .
-
-        '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>' . "\n" .
-        '<TR><TD BGCOLOR="' . $color[4] . '">' .
-        '<img src="' . $DownloadLink . '">' .
-
-        '</TD></TR></TABLE>' . "\n";
-        '</body></html>' . "\n";
+displayPageHeader($color, 'None');
+
+echo '<BR>' . 
+    '<TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>' .
+    "\n" .
+    '<TR><TD BGCOLOR="' . $color[0] . '">' .
+    '<B><CENTER>' .
+    _("Viewing an image attachment") . " - ";
+if (isset($where) && isset($what)) {
+  // from a search
+  echo '<a href="../src/read_body.php?mailbox=' . urlencode($mailbox) .
+        '&passed_id=' . $passed_id . '&where=' . urlencode($where) . 
+        '&what=' . urlencode($what). '">' . _("View message") . '</a>';
+} else {   
+  echo '<a href="../src/read_body.php?mailbox=' . urlencode($mailbox) .
+       '&passed_id=' . $passed_id . '&startMessage=' . $startMessage .
+       '&show_more=0">' . _("View message") . '</a>';
+}   
+
+$DownloadLink = '../src/download.php?passed_id=' . $passed_id .
+               '&mailbox=' . urlencode($mailbox) . 
+               '&passed_ent_id=' . $passed_ent_id . '&absolute_dl=true';
+
+echo '</b></td></tr>' . "\n" .
+    '<tr><td align=center><A HREF="' . $DownloadLink . '">' .
+    _("Download this as a file") .
+    '</A></B><BR>&nbsp;' . "\n" .
+    '</TD></TR></TABLE>' . "\n" .
+
+    '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>' . "\n" .
+    '<TR><TD BGCOLOR="' . $color[4] . '">' .
+    '<img src="' . $DownloadLink . '">' .
+
+    '</TD></TR></TABLE>' . "\n";
+    '</body></html>' . "\n";
 
 ?>
index 8d647a54879d6c17595d509cc1b6798329b712c4..1199968779df14df6e78f78338897bd75a079f26 100644 (file)
@@ -17,7 +17,7 @@ require_once('../functions/imap.php');
 require_once('../functions/mime.php');
 require_once('../functions/date.php');
 require_once('../functions/url_parser.php');
-   
+
 /**
 * Given an IMAP message id number, this will look it up in the cached
 * and sorted msgs array and return the index. Used for finding the next
@@ -420,23 +420,23 @@ if ($default_use_priority) {
     switch($priority_level) {
         /* check for a higher then normal priority. */
         case '1':
-        case '2': 
-            $priority_string = _("High"); 
+        case '2':
+            $priority_string = _("High");
             break;
 
         /* check for a lower then normal priority. */
         case '4':
-        case '5': 
-            $priority_string = _("Low"); 
+        case '5':
+            $priority_string = _("Low");
             break;
-            
+
         /* check for a normal priority. */
-        case '3': 
+        case '3':
         default:
             $priority_level = '3';
-            $priority_string = _("Normal"); 
+            $priority_string = _("Normal");
             break;
-            
+
     }
 }
 
@@ -638,11 +638,12 @@ if (!$pf_subtle_link) {
     echo printer_friendly_link(true);
 }
 
-do_hook("read_body_header");
+do_hook('read_body_header');
 echo '</TABLE>' .
     '   </TD></TR>' .
     '</TABLE>';
 flush();
+
 echo "<TABLE CELLSPACING=0 WIDTH=\"97%\" BORDER=0 ALIGN=CENTER CELLPADDING=0>\n" .
     "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=\"100%\">\n" .
     '<BR>'.
@@ -653,23 +654,29 @@ echo "<TABLE CELLSPACING=0 WIDTH=\"97%\" BORDER=0 ALIGN=CENTER CELLPADDING=0>\n"
     '</TABLE>' . "\n";
 
 /* show attached images inline -- if pref'fed so */
-if (($attachment_common_show_images) and
+if (($attachment_common_show_images) &&
     is_array($attachment_common_show_images_list)) {
+
     foreach ($attachment_common_show_images_list as $img) {
+        $imgurl = '../src/download.php' .
+                "?startMessage=$startMessage".
+                '&passed_id='     . urlencode($img['passed_id']) .
+                '&mailbox='       . urlencode($img['mailbox']) .
+                '&passed_ent_id=' . urlencode($img['ent_id']) .
+                '&absolute_dl=true';
+
         echo "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>\n" .
             "  <TR>\n" .
             "    <TD>\n" .
-            '      <img src="../src/download.php' .
-                '?passed_id='     . urlencode($img['passed_id']) .
-                '&mailbox='       . urlencode($img['mailbox']) .
-                '&passed_ent_id=' . urlencode($img['ent_id']) .
-                '&absolute_dl=true">' . "\n" .
+            "      <img src=\"$imgurl\">\n" .
             "    </TD>\n" .
             "  </TR>\n" .
             "</TABLE>\n";
+
     }
 }
 
+
 do_hook('read_body_bottom');
 do_hook('html_bottom');
 sqimap_logout($imapConnection);
index 655e70cc976311e79afe6b93d7b6805dd98c58ba..2d6fc3d511ab2ef9168412e0842905326a71a2fb 100644 (file)
@@ -21,10 +21,10 @@ is_logged_in();
 if (get_magic_quotes_gpc()) {
     global $REQUEST_METHOD;
 
-    if ($REQUEST_METHOD == "POST") {
+    if ($REQUEST_METHOD == 'POST') {
         global $HTTP_POST_VARS;
         RemoveSlashes($HTTP_POST_VARS);
-    } else if ($REQUEST_METHOD == "GET") {
+    } else if ($REQUEST_METHOD == 'GET') {
         global $HTTP_GET_VARS;
         RemoveSlashes($HTTP_GET_VARS);
     }
@@ -43,7 +43,7 @@ global $send, $PHP_SELF;
 if (isset($send)
     && (substr($send, 0, 1) == "\n")
     && (substr($PHP_SELF, -12) == '/compose.php')) {
-    if ($REQUEST_METHOD == "POST") {
+    if ($REQUEST_METHOD == 'POST') {
         global $HTTP_POST_VARS;
         TrimArray($HTTP_POST_VARS);
     } else {
@@ -69,4 +69,5 @@ require_once('../functions/prefs.php');
 /* Set up the language (i18n.php was included by auth.php). */
 global $username, $data_dir;
 set_up_language(getPref($data_dir, $username, 'language'));
-?>
+
+?>
\ No newline at end of file