Fixed formatting on these files.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 28 Jan 2002 18:33:33 +0000 (18:33 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 28 Jan 2002 18:33:33 +0000 (18:33 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2264 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/folders_subscribe.php
src/options_identities.php
src/options_order.php
src/printer_friendly_bottom.php
src/retrievalerror.php
src/signout.php

index af5e2737a9f5664c50015bb664c4edb3dda82311..a887fde69bf2f4fe441b644cdcff23f004e27250 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/imap.php');
 require_once('../functions/display_messages.php');
 
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
-   $location = get_location();
-   if ($method == 'sub') {
-      for ($i=0; $i < count($mailbox); $i++) {
-         $mailbox[$i] = trim($mailbox[$i]);
-         sqimap_subscribe ($imapConnection, $mailbox[$i]);
-         header("Location: $location/folders.php?success=subscribe");
-      }
-   } else {
-      for ($i=0; $i < count($mailbox); $i++) {
-         $mailbox[$i] = trim($mailbox[$i]);
-         sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
-         header("Location: $location/folders.php?success=unsubscribe");
-      }
-   }
-   if (!isset($mailbox)) {
-         header("Location: $location/folders.php");
-   }
-   sqimap_logout($imapConnection);
+$location = get_location();
+if ($method == 'sub') {
+    for ($i=0; $i < count($mailbox); $i++) {
+        $mailbox[$i] = trim($mailbox[$i]);
+        sqimap_subscribe ($imapConnection, $mailbox[$i]);
+        header("Location: $location/folders.php?success=subscribe");
+    }
+} else {
+    for ($i=0; $i < count($mailbox); $i++) {
+        $mailbox[$i] = trim($mailbox[$i]);
+        sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
+        header("Location: $location/folders.php?success=unsubscribe");
+    }
+}
+if (!isset($mailbox)) {
+    header("Location: $location/folders.php");
+}
+sqimap_logout($imapConnection);
 
-   /*
-   displayPageHeader($color, 'None');
-   echo "<BR><BR><BR><CENTER><B>";
-   if ($method == "sub") {
-      echo _("Subscribed Successfully!");
-      echo "</B><BR><BR>";
-      echo _("You have been successfully subscribed.");
-   } else {
-      echo _("Unsubscribed Successfully!");
-      echo "</B><BR><BR>";
-      echo _("You have been successfully unsubscribed.");
-   }
-   echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
-   echo _("Click here");
-   echo "</A> ";
-   echo _("to continue.");
-   echo "</CENTER>";
-   echo "</BODY></HTML>";
-   */
+/*
+displayPageHeader($color, 'None');
+echo "<BR><BR><BR><CENTER><B>";
+if ($method == "sub") {
+    echo _("Subscribed Successfully!");
+    echo "</B><BR><BR>";
+    echo _("You have been successfully subscribed.");
+} else {
+    echo _("Unsubscribed Successfully!");
+    echo "</B><BR><BR>";
+    echo _("You have been successfully unsubscribed.");
+}
+echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
+echo _("Click here");
+echo "</A> ";
+echo _("to continue.");
+echo "</CENTER>";
+echo "</BODY></HTML>";
+*/
 ?>
index 80913f45553fb9eb70006be33ca2d1fa243088e0..53f3cc0b3b92838a1bd562c4e165968dce226d07 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/display_messages.php');
 
-   if (isset($return)) {
-      SaveUpdateFunction();
-      header('Location: options_personal.php');
-      exit();
-   }
-   
-   displayPageHeader($color, 'None');
-
-   $Info = do_hook('options_identities_process', 0);
-   if ($Info[1])
-      SaveUpdateFunction();
-
-   if (CheckAndDoDefault() || CheckAndDoPromote()) {
-      SaveUpdateFunction();
-   }
-   if (isset($update) || CheckForDelete())
-      SaveUpdateFunction();
-
-   LoadInfo($full_name, $email_address, $reply_to, '');
+    if (isset($return)) {
+       SaveUpdateFunction();
+       header('Location: options_personal.php');
+       exit();
+    }
+    
+    displayPageHeader($color, 'None');
+    $Info = do_hook('options_identities_process', 0);
+    if ($Info[1]) {
+        SaveUpdateFunction();
+    }
+    
+    if (CheckAndDoDefault() || CheckAndDoPromote()) {
+       SaveUpdateFunction();
+    }
+    if (isset($update) || CheckForDelete())
+        SaveUpdateFunction();
+    }
+    LoadInfo($full_name, $email_address, $reply_to, '');
 
 ?>
 <br>
@@ -60,38 +46,37 @@ require_once('../functions/display_messages.php');
     <table width="100%" border="0" cellpadding="1" cellspacing="1">
     <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
 
-<form name=f action="options_identities.php" method=post><br>
+<form name="f" action="options_identities.php" method="post"><br>
 
-<?PHP do_hook('options_identities_top'); ?>
+<?php do_hook('options_identities_top'); ?>
 
 <table width="80%" cellpadding=2 cellspacing=0 border=0>
-  <tr bgcolor="<?PHP echo $color[9] ?>">
-    <th colspan=2 align=center><?PHP echo _("Default Identity") ?></th>
+  <tr bgcolor="<?php echo $color[9] ?>">
+    <th colspan=2 align=center><?php echo _("Default Identity") ?></th>
   </tr>
 <?PHP
 
-   ShowTableInfo($full_name, $email_address, $reply_to, '');
+    ShowTableInfo($full_name, $email_address, $reply_to, '');
   
-   $num = 1;
-   while (LoadInfo($full_name, $email_address, $reply_to, $num))
-   {
+    $num = 1;
+    while (LoadInfo($full_name, $email_address, $reply_to, $num))
+    {
 ?>
   <tr bgcolor="<?PHP echo $color[9] ?>">
     <th colspan=2 align=center><?PHP printf (_("Alternate Identity %d"),
     $num) ?></th>
   </tr>
 <?PHP
-       ShowTableInfo($full_name, $email_address, $reply_to, $num);
-       $num ++;
-   }
+        ShowTableInfo($full_name, $email_address, $reply_to, $num);
+        $num ++;
+    }
    
 ?>
-  <tr bgcolor="<?PHP echo $color[9] ?>">
+  <tr bgcolor="<?php echo $color[9] ?>">
     <th colspan=2 align=center><?PHP echo _("Add a New Identity") ?></th>
   </tr>
-<?
-
-   ShowTableInfo('', '', '', $num);
+<?php
+    ShowTableInfo('', '', '', $num);
 ?>
 </table>
 </form>
@@ -240,28 +225,28 @@ require_once('../functions/display_messages.php');
             if (isset($$name) && $i > 1) {
                 do_hook('options_identities_renumber', $i, $i - 1);
 
-            $nameA = 'full_name' . $i;
-            $nameB = 'full_name' . ($i - 1);
-            global $$nameA, $$nameB;
-            $temp = $$nameA;
-            $$nameA = $$nameB;
-            $$nameB = $temp;
-
-            $nameA = 'email_address' . $i;
-            $nameB = 'email_address' . ($i - 1);
-            global $$nameA, $$nameB;
-            $temp = $$nameA;
-            $$nameA = $$nameB;
-            $$nameB = $temp;
-
-            $nameA = 'reply_to' . $i;
-            $nameB = 'reply_to' . ($i - 1);
-            global $$nameA, $$nameB;
-            $temp = $$nameA;
-            $$nameA = $$nameB;
-            $$nameB = $temp;
+                $nameA = 'full_name' . $i;
+                $nameB = 'full_name' . ($i - 1);
+                global $$nameA, $$nameB;
+                $temp = $$nameA;
+                $$nameA = $$nameB;
+                $$nameB = $temp;
+    
+                $nameA = 'email_address' . $i;
+                $nameB = 'email_address' . ($i - 1);
+                global $$nameA, $$nameB;
+                $temp = $$nameA;
+                $$nameA = $$nameB;
+                $$nameB = $temp;
+    
+                $nameA = 'reply_to' . $i;
+                $nameB = 'reply_to' . ($i - 1);
+                global $$nameA, $$nameB;
+                $temp = $$nameA;
+                $$nameA = $$nameB;
+                $$nameB = $temp;
 
-            return true;
+                return true;
             }
 
             $i ++;
@@ -327,4 +312,4 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $post) {
     echo '</td></tr>'.
          '<tr><td colspan="2">&nbsp;</td></tr>';
 }
-?>
+?>
\ No newline at end of file
index f0de44f78ab77f44987f674bcc7cedcfddf4fbd3..1d55b975a6d11d84f8d4032848c17463b9487ac6 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/display_messages.php');
 require_once('../functions/imap.php');
 require_once('../functions/array.php');
 require_once('../functions/plugin.php');
 
-
-   if (! isset($action)) { $action = ''; }
-   if ($action == 'delete' && isset($theid)) {
-      removePref($data_dir, $username, "highlight$theid");
-   } else if ($action == 'save') {
-   } 
-   displayPageHeader($color, 'None');
+if (! isset($action)) { $action = ''; }
+if ($action == 'delete' && isset($theid)) {
+    removePref($data_dir, $username, "highlight$theid");
+} elseif ($action == 'save') {
+} 
+displayPageHeader($color, 'None');
 ?>
    <br>
 <table width="95%" align=center border=0 cellpadding=2 cellspacing=0>
@@ -50,101 +33,101 @@ require_once('../functions/plugin.php');
     <table width="100%" border="0" cellpadding="1" cellspacing="1">
     <tr><td bgcolor="<?php echo $color[4] ?>" align="center"><br>
 <?php
-
-   $available[1] = _("Checkbox");
-   $available[2] = _("From");
-   $available[3] = _("Date");
-   $available[4] = _("Subject");
-   $available[5] = _("Flags");
-   $available[6] = _("Size");
-   
-   if (! isset($method)) { $method = ''; }
-
-   if ($method == 'up' && $num > 1) {
-      $prev = $num-1;
-      $tmp = $index_order[$prev];
-      $index_order[$prev] = $index_order[$num];
-      $index_order[$num] = $tmp;
-   } else if ($method == 'down' && $num < count($index_order)) {
-      $next = $num++;
-      $tmp = $index_order[$next];
-      $index_order[$next] = $index_order[$num];
-      $index_order[$num] = $tmp;
-   } else if ($method == 'remove' && $num) {
-      for ($i=1; $i < 8; $i++) {
-         removePref($data_dir, $username, "order$i"); 
-      }
-      for ($j=1,$i=1; $i <= count($index_order); $i++) {
-         if ($i != $num) {
-            $new_ary[$j] = $index_order[$i];
-            $j++;
-         }
-      }
-      $index_order = array();
-      $index_order = $new_ary;
-      if (count($index_order) < 1) {
-         include_once('../src/load_prefs.php');
-      }
-   } else if ($method == 'add' && $add) {
-      // User should not be able to insert PHP-code here
-      $add = str_replace ('<?', '..', $add);
-      $add = ereg_replace ('<.*script.*language.*php.*>', '..', $add);
-      $add = str_replace ('<%', '..', $add);
-      $index_order[count($index_order)+1] = $add;
-   }
-
-   if ($method) {
-      for ($i=1; $i <= count($index_order); $i++) {
-         setPref($data_dir, $username, "order$i", $index_order[$i]);
-      }
-   }
-   echo '<table cellspacing="0" cellpadding="0" border="0" width="65%"><tr><td>' . "\n";
-   echo _("The index order is the order that the columns are arranged in the message index.  You can add, remove, and move columns around to customize them to fit your needs.");
-   echo '</td></tr></table><br>';
-
-   if (count($index_order))
-   {
-      echo '<table cellspacing="0" cellpadding="0" border="0">' . "\n";
-      for ($i=1; $i <= count($index_order); $i++) {
-         $tmp = $index_order[$i];
-         echo '<tr>';
-         echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
-         echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
-         echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
-         echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
-         echo '<td>';
-         // Always show the subject
-         if ($tmp != 4)
-            echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . '</a></small>';
-         echo "</td>\n";
-         echo '<td><small>&nbsp;-&nbsp;</small></td>' . "\n";
-         echo '<td>' . $available[$tmp] . "</td>\n";
-         echo "</tr>\n";
-      }
-      echo "</table>\n";
-   }
-   
-   if (count($index_order) != count($available)) {
-      echo '<form name="f" method="post" action="options_order.php">';
-      echo '<select name="add">';
-      for ($i=1; $i <= count($available); $i++) {
-         $found = false;
-         for ($j=1; $j <= count($index_order); $j++) {
-            if ($index_order[$j] == $i) {
-               $found = true;
+    $available[1] = _("Checkbox");
+    $available[2] = _("From");
+    $available[3] = _("Date");
+    $available[4] = _("Subject");
+    $available[5] = _("Flags");
+    $available[6] = _("Size");
+    
+    if (! isset($method)) { $method = ''; }
+    if ($method == 'up' && $num > 1) {
+        $prev = $num-1;
+        $tmp = $index_order[$prev];
+        $index_order[$prev] = $index_order[$num];
+        $index_order[$num] = $tmp;
+    } else if ($method == 'down' && $num < count($index_order)) {
+        $next = $num++;
+        $tmp = $index_order[$next];
+        $index_order[$next] = $index_order[$num];
+        $index_order[$num] = $tmp;
+    } else if ($method == 'remove' && $num) {
+        for ($i=1; $i < 8; $i++) {
+            removePref($data_dir, $username, "order$i"); 
+        }
+        for ($j=1,$i=1; $i <= count($index_order); $i++) {
+           if ($i != $num) {
+               $new_ary[$j] = $index_order[$i];
+               $j++;
+           }
+        }
+        $index_order = array();
+        $index_order = $new_ary;
+        if (count($index_order) < 1) {
+           include_once('../src/load_prefs.php');
+        }
+    } else if ($method == 'add' && $add) {
+        /* User should not be able to insert PHP-code here */
+        $add = str_replace ('<?', '..', $add);
+        $add = ereg_replace ('<.*script.*language.*php.*>', '..', $add);
+        $add = str_replace ('<%', '..', $add);
+        $index_order[count($index_order)+1] = $add;
+    }
+    if ($method) {
+        for ($i=1; $i <= count($index_order); $i++) {
+           setPref($data_dir, $username, "order$i", $index_order[$i]);
+        }
+    }
+    echo '<table cellspacing="0" cellpadding="0" border="0" width="65%"><tr><td>' . "\n";
+    echo _("The index order is the order that the columns are arranged in the message index.  You can add, remove, and move columns around to customize them to fit your needs.");
+    echo '</td></tr></table><br>';
+    if (count($index_order))
+    {
+        echo '<table cellspacing="0" cellpadding="0" border="0">' . "\n";
+        for ($i=1; $i <= count($index_order); $i++) {
+            $tmp = $index_order[$i];
+            echo '<tr>';
+            echo "<td><small><a href=\"options_order.php?method=up&num=$i\">". _("up") ."</a></small></td>\n";
+            echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
+            echo "<td><small><a href=\"options_order.php?method=down&num=$i\">". _("down") . "</a></small></td>\n";
+            echo '<td><small>&nbsp;|&nbsp;</small></td>' . "\n";
+            echo '<td>';
+            /* Always show the subject */
+            if ($tmp != 4)
+               echo "<small><a href=\"options_order.php?method=remove&num=$i\">" . _("remove") . '</a></small>';
+            echo "</td>\n";
+            echo '<td><small>&nbsp;-&nbsp;</small></td>' . "\n";
+            echo '<td>' . $available[$tmp] . "</td>\n";
+            echo "</tr>\n";
+        }
+        echo "</table>\n";
+    }
+    
+    if (count($index_order) != count($available)) {
+        echo '<form name="f" method="post" action="options_order.php">';
+        echo '<select name="add">';
+        for ($i=1; $i <= count($available); $i++) {
+            $found = false;
+            for ($j=1; $j <= count($index_order); $j++) {
+                if ($index_order[$j] == $i) {
+                    $found = true;
+                }
             }
-         }
-         if (!$found) {
-            echo "<option value=\"$i\">$available[$i]</option>";
-         }
-      }
-      echo '</select>';
-      echo '<input type="hidden" value="add" name="method">';
-      echo '<input type="submit" value="'._("Add").'" name="submit">';
-      echo '</form>';
-   }
-
-   echo '<p><a href="../src/options.php">' . _("Return to options page") . '</a></p><br>';
+            if (!$found) {
+                echo "<option value=\"$i\">$available[$i]</option>";
+            }
+        }
+        echo '</select>';
+        echo '<input type="hidden" value="add" name="method">';
+        echo '<input type="submit" value="'._("Add").'" name="submit">';
+        echo '</form>';
+    }
+    echo '<p><a href="../src/options.php">' . _("Return to options page") . '</a></p><br>';
 
 ?>
     </td></tr>
@@ -152,4 +135,4 @@ require_once('../functions/plugin.php');
 
 </td></tr>
 </table>
-</body></html>
+</body></html>
\ No newline at end of file
index abc0cc52546c3552b1ca3b8a6292a70164bcf6af..b5b193107073d2020f3cd761c55df9802d71a34d 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/strings.php');
 require_once('../config/config.php');
@@ -37,109 +21,102 @@ require_once('../src/load_prefs.php');
 require_once('../functions/imap.php');
 require_once('../functions/page_header.php');
 
-    $pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
-
-    $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-    sqimap_mailbox_select($imap_stream, $mailbox);
-    $message = sqimap_get_message($imap_stream, $passed_id, $mailbox);
-
-
-// --start display setup--
-
-     // From and Date are usually fine as they are...
-    $from = decodeHeader($message->header->from);
-    $date = getLongDateString($message->header->date);
-
-     // we can clean these up if the list is too long...
-    $cc = decodeHeader(getLineOfAddrs($message->header->cc));
-    $to = decodeHeader(getLineOfAddrs($message->header->to));
-
-     // and Body and Subject could easily stream off the page...
-    $id = $message->header->id;
-    $ent_num = findDisplayEntity ($message, 0);  
-    $body_message = getEntity($message, $ent_num);
-    if (($body_message->header->type0 == 'text') ||
-        ($body_message->header->type0 == 'rfc822')) {    
-        $body = mime_fetch_body ($imap_stream, $id, $ent_num);
-        $body = decodeBody($body, $body_message->header->encoding);
-        $hookResults = do_hook("message_body", $body);
-        $body = $hookResults[1];
-        if ($body_message->header->type1 == 'html') {
-        if( $show_html_default <> 1 ) {
-            $body = strip_tags( $body );
-            translateText($body, $wrap_at, $body_message->header->charset);
-        } else {
-            $body = MagicHTML( $body, $id );
-        }
-        } else {
+$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
+
+$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+sqimap_mailbox_select($imap_stream, $mailbox);
+$message = sqimap_get_message($imap_stream, $passed_id, $mailbox);
+
+/* --start display setup-- */
+
+/* From and Date are usually fine as they are... */
+$from = decodeHeader($message->header->from);
+$date = getLongDateString($message->header->date);
+
+/* we can clean these up if the list is too long... */
+$cc = decodeHeader(getLineOfAddrs($message->header->cc));
+$to = decodeHeader(getLineOfAddrs($message->header->to));
+
+/* and Body and Subject could easily stream off the page... */
+$id = $message->header->id;
+$ent_num = findDisplayEntity ($message, 0);  
+$body_message = getEntity($message, $ent_num);
+if (($body_message->header->type0 == 'text') ||
+    ($body_message->header->type0 == 'rfc822')) {    
+    $body = mime_fetch_body ($imap_stream, $id, $ent_num);
+    $body = decodeBody($body, $body_message->header->encoding);
+    $hookResults = do_hook('message_body', $body);
+    $body = $hookResults[1];
+    if ($body_message->header->type1 == 'html') {
+    if( $show_html_default <> 1 ) {
+        $body = strip_tags( $body );
         translateText($body, $wrap_at, $body_message->header->charset);
-        }              
     } else {
-        $body = _("Message not printable");
+        $body = MagicHTML( $body, $id );
     }
+    } else {
+        translateText($body, $wrap_at, $body_message->header->charset);
+    }              
+} else {
+    $body = _("Message not printable");
+}
 
-    $subject = trim(decodeHeader($message->header->subject));
-
-     // now, if they choose to, we clean up the display a bit...
-     /*
-    if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) {
-
-        $num_leading_spaces = 9; // nine leading spaces for indentation
-
-         // sometimes I see ',,' instead of ',' seperating addresses *shrug*
-        $cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces);
-        $to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces);
+$subject = trim(decodeHeader($message->header->subject));
 
-         // the body should have no leading zeros
-        $body = pf_clean_string($body, 0);
+ /* now, if they choose to, we clean up the display a bit... */
+ /*
+if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) {
 
-         // clean up everything else...
-        $subject = pf_clean_string($subject, $num_leading_spaces);
-        $from = pf_clean_string($from, $num_leading_spaces);
-        $date = pf_clean_string($date, $num_leading_spaces);
+    $num_leading_spaces = 9; // nine leading spaces for indentation
 
-    } // end cleanup
-    */
-    // --end display setup--
+     // sometimes I see ',,' instead of ',' seperating addresses *shrug*
+    $cc = pf_clean_string(str_replace(',,', ',', $cc), $num_leading_spaces);
+    $to = pf_clean_string(str_replace(',,', ',', $to), $num_leading_spaces);
 
+     // the body should have no leading zeros
+    $body = pf_clean_string($body, 0);
 
-    // --start browser output--
-    displayHtmlHeader( _("Printer Friendly"), '', FALSE );
+     // clean up everything else...
+    $subject = pf_clean_string($subject, $num_leading_spaces);
+    $from = pf_clean_string($from, $num_leading_spaces);
+    $date = pf_clean_string($date, $num_leading_spaces);
 
-    echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
-         // headers (we use table becasue translations are not all the same width)
-         '<table>'.
-         '<tr><td>' . _("From") . ':</td><td>' . htmlentities($from) . "</td></td>\n".
-         '<tr><td>' . _("To") . ':</td><td>' . htmlentities($to) . "</td></td>\n";
-    if ( strlen($cc) > 0 ) { // only show CC: if it's there...
-         echo '<tr><td>' . _("CC") . ':</td><td>' . htmlentities($cc) . "</td></td>\n";
-    }
-    echo '<tr><td>' . _("Date") . ':</td><td>' . htmlentities($date) . "</td></td>\n".
-         '<tr><td>' . _("Subject") . ':</td><td>' . htmlentities($subject) . "</td></td>\n".
-         '</table>'.
-         "\n";
-     // body
-    echo "<hr noshade size=1>\n";
-    echo $body;
+} // end cleanup
+*/
+// --end display setup--
 
-// --end browser output--
 
+/* --start browser output-- */
+displayHtmlHeader( _("Printer Friendly"), '', FALSE );
 
-?></pre>
-  </body>
-</html>
+echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
+     /* headers (we use table becasue translations are not all the same width) */
+     '<table>'.
+     '<tr><td>' . _("From") . ':</td><td>' . htmlentities($from) . "</td></td>\n".
+     '<tr><td>' . _("To") . ':</td><td>' . htmlentities($to) . "</td></td>\n";
+if ( strlen($cc) > 0 ) { /* only show CC: if it's there... */
+     echo '<tr><td>' . _("CC") . ':</td><td>' . htmlentities($cc) . "</td></td>\n";
+}
+echo '<tr><td>' . _("Date") . ':</td><td>' . htmlentities($date) . "</td></td>\n".
+     '<tr><td>' . _("Subject") . ':</td><td>' . htmlentities($subject) . "</td></td>\n".
+     '</table>'.
+     "\n";
+/* body */
+echo "<hr noshade size=1>\n";
+echo $body;
 
-<?
+/* --end browser output-- */
 
-// --start pf-specific functions--
+echo '</pre></body></html>';
 
+/* --start pf-specific functions-- */
 
- // $string = pf_clean_string($string, 9);
+/* $string = pf_clean_string($string, 9); */
 function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
     global $data_dir, $username;
 
     $wrap_at = getPref($data_dir, $username, 'wrap_at', 86);
-    $wrap_at = $wrap_at - $num_leading_spaces; // header stuff
+    $wrap_at = $wrap_at - $num_leading_spaces; /* header stuff */
 
     $leading_spaces = '';
     while ( strlen($leading_spaces) < $num_leading_spaces )
@@ -149,7 +126,7 @@ function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
     while ( strlen($unclean_string) > $wrap_at )
     {
         $this_line = substr($unclean_string, 0, $wrap_at);
-        if ( strrpos( $this_line, "\n" ) ) // this should NEVER happen with anything but the $body
+        if ( strrpos( $this_line, "\n" ) ) /* this should NEVER happen with anything but the $body */
         {
             $clean_string .= substr( $this_line, 0, strrpos( $this_line, "\n" ));
             $clean_string .= $leading_spaces;
@@ -162,11 +139,12 @@ function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
             $unclean_string = substr($unclean_string, (1+strrpos( $this_line, ' ' )));
         }
     }
+
     $clean_string .= $unclean_string;
 
     return $clean_string;
-} // end pf_clean_string() function
+} /* end pf_clean_string() function */
 
-// --end pf-specific functions
+/* --end pf-specific functions */
 
 ?>
\ No newline at end of file
index 712fcee264fba799336e769291bd42d8ec3e3370..edce30cf9bd181d48fd40416798e815ab92fa8bc 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/imap.php");
-require_once("../functions/smtp.php");
-require_once("../functions/page_header.php");
-require_once("../src/load_prefs.php");
-
-   $destination = "retrievalerror@squirrelmail.org";
-
-   $attachments = array();
-
-
-   function ClearAttachments() {
-       global $attachments, $attachment_dir, $username;
-
-       $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-       foreach ($attachments as $info) {
-           $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-           if (file_exists($attached_file)) {
-               unlink($attached_file);
-           }
-       }
-
-       $attachments = array();
-   }
-
-   $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-   sqimap_mailbox_select($imap_stream, $mailbox);
-   $sid = sqimap_session_id();
-   fputs ($imap_stream, "$sid FETCH $passed_id BODY[]\r\n");
-   $data = sqimap_read_data ($imap_stream, $sid, true, $response, $message);
-   sqimap_logout($imap_stream);
-   $topline2 = array_shift($data);
-   $thebastard = implode('', $data);
-
-
-   $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-   $localfilename = GenerateRandomString(32, '', 7);
-   $full_localfilename = "$hashed_attachment_dir/$localfilename";
-   while (file_exists($full_localfilename)) {
-       $localfilename = GenerateRandomString(32, '', 7);
-       $full_localfilename = "$hashed_attachment_dir/$localfilename";
-   }
-
-   // Write Attachment to file
-   $fp = fopen ($full_localfilename, 'w');
-   fputs ($fp, $thebastard);
-   fclose ($fp);
-
-   $newAttachment = array();
-   $newAttachment['localfilename'] = $localfilename;
-   $newAttachment['remotefilename'] = 'message.duh';
-   $newAttachment['type'] = 'application/octet-stream';
-   $attachments[] = $newAttachment;
-
-
-   $body = "Response: $response\n" .
-           "Message: $message\n" .
-           "FETCH line: $topline\n" .
-           "Server Type: $imap_server_type\n";
-
-   $imap_stream = fsockopen ($imapServerAddress, $imapPort, &$error_number, &$error_string);
-   $server_info = fgets ($imap_stream, 1024);
-   if ($imap_stream)
-   {
-       $body .=  "  Server info:  $server_info";
-       fputs ($imap_stream, "a001 CAPABILITY\r\n");
-       $read = fgets($imap_stream, 1024);
-       $list = explode(' ', $read);
-       array_shift($list);
-       array_shift($list);
-       $read = implode(' ', $list);
-       $body .= "  Capabilities:  $read";
-       fputs ($imap_stream, "a002 LOGOUT\r\n");
-       fclose($imap_stream);
-   }
-
-   $body .= "\nFETCH line for gathering the whole message: $topline2\n";
-
-
-   sendMessage($destination, "", "", "submitted message", $body, 0);
-
-
-
-
-   displayPageHeader($color, $mailbox);
-
-   $par = "mailbox=".urlencode($mailbox)."&passed_id=$passed_id";
-   if (isset($where) && isset($what)) {
-       $par .= "&where=".urlencode($where)."&what=".urlencode($what);
-   } else {
-       $par .= "&startMessage=$startMessage&show_more=0";
-   }
-
-   echo '<BR>The message has been submitted to the developers knowledgebase!<BR>' .
-        'Thank you very much<BR>' .
-        'Please submit every message only once<BR>' .
-        "<A HREF=\"../src/read_body.php?$par\">View the message</A><BR>";
-
-?>
+require_once('../functions/imap.php');
+require_once('../functions/smtp.php');
+require_once('../functions/page_header.php');
+require_once('../src/load_prefs.php');
+
+$destination = 'retrievalerror@squirrelmail.org';
+
+$attachments = array();
+
+function ClearAttachments() {
+    global $attachments, $attachment_dir, $username;
+
+    $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
+    foreach ($attachments as $info) {
+        $attached_file = "$hashed_attachment_dir/$info[localfilename]";
+        if (file_exists($attached_file)) {
+            unlink($attached_file);
+        }
+    }
+
+    $attachments = array();
+}
+
+$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+sqimap_mailbox_select($imap_stream, $mailbox);
+$sid = sqimap_session_id();
+fputs ($imap_stream, "$sid FETCH $passed_id BODY[]\r\n");
+$data = sqimap_read_data ($imap_stream, $sid, true, $response, $message);
+sqimap_logout($imap_stream);
+$topline2 = array_shift($data);
+$thebastard = implode('', $data);
+
+$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
+$localfilename = GenerateRandomString(32, '', 7);
+$full_localfilename = "$hashed_attachment_dir/$localfilename";
+while (file_exists($full_localfilename)) {
+    $localfilename = GenerateRandomString(32, '', 7);
+    $full_localfilename = "$hashed_attachment_dir/$localfilename";
+}
+
+/* Write Attachment to file */
+$fp = fopen ($full_localfilename, 'w');
+fputs ($fp, $thebastard);
+fclose ($fp);
+
+$newAttachment = array();
+$newAttachment['localfilename'] = $localfilename;
+$newAttachment['remotefilename'] = 'message.duh';
+$newAttachment['type'] = 'application/octet-stream';
+$attachments[] = $newAttachment;
+
+$body = "Response: $response\n" .
+        "Message: $message\n" .
+        "FETCH line: $topline\n" .
+        "Server Type: $imap_server_type\n";
+
+$imap_stream = fsockopen ($imapServerAddress, $imapPort, &$error_number, &$error_string);
+$server_info = fgets ($imap_stream, 1024);
+if ($imap_stream) {
+    $body .=  "  Server info:  $server_info";
+    fputs ($imap_stream, "a001 CAPABILITY\r\n");
+    $read = fgets($imap_stream, 1024);
+    $list = explode(' ', $read);
+    array_shift($list);
+    array_shift($list);
+    $read = implode(' ', $list);
+    $body .= "  Capabilities:  $read";
+    fputs ($imap_stream, "a002 LOGOUT\r\n");
+    fclose($imap_stream);
+}
+
+$body .= "\nFETCH line for gathering the whole message: $topline2\n";
+
+sendMessage($destination, '', '', 'submitted message', $body, 0);
+
+displayPageHeader($color, $mailbox);
+
+$par = 'mailbox='.urlencode($mailbox)."&passed_id=$passed_id";
+if (isset($where) && isset($what)) {
+    $par .= '&where='.urlencode($where).'&what='.urlencode($what);
+} else {
+    $par .= "&startMessage=$startMessage&show_more=0";
+}
+
+echo '<BR>The message has been submitted to the developers knowledgebase!<BR>' .
+     'Thank you very much<BR>' .
+     'Please submit every message only once<BR>' .
+     "<A HREF=\"../src/read_body.php?$par\">View the message</A><BR>";
+
+?>
\ No newline at end of file
index c8f07cd57029595e658af62f22f894cf02d17429..fae6ce9c7dce8de3c5deacf6edb7785c460b13f0 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/prefs.php');
 require_once('../functions/plugin.php');
 require_once('../functions/strings.php');
 
-   // Erase any lingering attachments
-   if (! isset($attachments)) {
-       $attachments = array();
-   }
-   $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-   foreach ($attachments as $info) {
-       $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-       if (file_exists($attached_file)) {
-           unlink($attached_file);
-       }
-   }
+/* Erase any lingering attachments */
+if (! isset($attachments)) {
+    $attachments = array();
+}
+$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
+foreach ($attachments as $info) {
+    $attached_file = "$hashed_attachment_dir/$info[localfilename]";
+    if (file_exists($attached_file)) {
+        unlink($attached_file);
+    }
+}
 
-   if (!isset($frame_top)) {
-        $frame_top = '_top';
-   }
+if (!isset($frame_top)) {
+     $frame_top = '_top';
+}
 
-   // If a user hits reload on the last page, $base_uri isn't set
-   // because it was deleted with the session.
-   if (! isset($base_uri)) {
-       ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
-       $base_uri = $regs[1];
-   }
+/* If a user hits reload on the last page, $base_uri isn't set
+ * because it was deleted with the session. */
+if (! isset($base_uri)) {
+    ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
+    $base_uri = $regs[1];
+}
 
-   do_hook('logout');
-   setcookie('username', '', 0, $base_uri);
-   setcookie('key', '', 0, $base_uri);
-   session_destroy();
+do_hook('logout');
+setcookie('username', '', 0, $base_uri);
+setcookie('key', '', 0, $base_uri);
+session_destroy();
 
-   if ($signout_page) {
-       header("Status: 303 See Other");
-       header("Location: $signout_page");
-       exit; /* we send no content if we're redirecting. */
-   }
+if ($signout_page) {
+    header('Status: 303 See Other');
+    header("Location: $signout_page");
+    exit; /* we send no content if we're redirecting. */
+}
 ?>
 <HTML>
    <HEAD>
 <?php
-   if ($theme_css != '') {
+    if ($theme_css != '') {
 ?>
 <LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
 <?php
-   }
+    }
 ?>
 <TITLE><?php echo $org_title ?> - Signout</TITLE>
 </HEAD>
@@ -104,4 +88,4 @@ CELLPADDING="2" ALIGN="CENTER">
   </TR>
 </TABLE>
 </BODY>
-</HTML>
+</HTML>
\ No newline at end of file