moved out identity stuff and removed redirect to view_header
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 30 Jul 2002 10:02:34 +0000 (10:02 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 30 Jul 2002 10:02:34 +0000 (10:02 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3174 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/read_body.php

index 98119416b38c5e9993617cb927bffc42e261da30..1842480792fc67d4aa7b3abc23581fbaeda9148c 100644 (file)
@@ -19,7 +19,6 @@ require_once('../functions/date.php');
 require_once('../functions/url_parser.php');
 require_once('../functions/smtp.php');
 require_once('../functions/html.php');
 require_once('../functions/url_parser.php');
 require_once('../functions/smtp.php');
 require_once('../functions/html.php');
-require_once('../src/view_header.php');
 
 /**
  * Given an IMAP message id number, this will look it up in the cached
 
 /**
  * Given an IMAP message id number, this will look it up in the cached
@@ -380,34 +379,11 @@ function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message,
 
 function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response) {
    global $base_uri, $sent_folder, $draft_folder, $where, $what, $color, $sort,
 
 function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response) {
    global $base_uri, $sent_folder, $draft_folder, $where, $what, $color, $sort,
-          $startMessage, $data_dir, $username, $compose_new_win, $PHP_SELF;
+          $startMessage, $compose_new_win, $PHP_SELF, $save_as_draft;
 
    $topbar_delimiter = '&nbsp;|&nbsp;';
    $urlMailbox = encodeHeader($mailbox);
 
 
    $topbar_delimiter = '&nbsp;|&nbsp;';
    $urlMailbox = encodeHeader($mailbox);
 
-   $identity = '';
-   $idents = getPref($data_dir, $username, 'identities');
-   $from_o = $message->header->from;
-   if (is_object($from_o)) {
-       $from_name = $from_o->getAddress();
-   } else {
-       $from_name = '';
-   }    
-   if (!empty($idents) && $idents > 1) {
-      for ($i = 1; $i < $idents; $i++) {
-          $enc_from_name = '"'. 
-              encodeHeader(getPref($data_dir, 
-                                   $username, 
-                                   'full_name' . $i)) .
-              '" <' . getPref($data_dir, $username, 
-                              'email_address' . $i) . '>';
-          if (htmlspecialchars($enc_from_name) == $from_name) {
-              $identity = $i;
-              break;
-          }
-      }
-   }
-
    $s = '<table width="100%" cellpadding="3" cellspacing="0" align="center"'.
          ' border="0" bgcolor="'.$color[9].'"><tr><td align="left" width="33%"><small>';
 
    $s = '<table width="100%" cellpadding="3" cellspacing="0" align="center"'.
          ' border="0" bgcolor="'.$color[9].'"><tr><td align="left" width="33%"><small>';
 
@@ -439,9 +415,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
    $comp_uri = $base_uri . 'src/compose.php'.
                          '?passed_id='.$passed_id.
                         '&amp;mailbox='.$urlMailbox.
    $comp_uri = $base_uri . 'src/compose.php'.
                          '?passed_id='.$passed_id.
                         '&amp;mailbox='.$urlMailbox.
-                        (isset($passed_ent_id)?'&amp;passed_ent_id='.$passed_ent_id:'').
-                         '&amp;identity='.$identity;
-
+                        (isset($passed_ent_id)?'&amp;passed_ent_id='.$passed_ent_id:'');
 
    if (($mailbox == $draft_folder) && ($save_as_draft)) {
       $comp_alt_uri = $comp_uri . '&amp;action=draft';
 
    if (($mailbox == $draft_folder) && ($save_as_draft)) {
       $comp_alt_uri = $comp_uri . '&amp;action=draft';
@@ -454,7 +428,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
       $s .= $topbar_delimiter;   
       if ($compose_new_win == '1') {
          $s .= '<a href="javascript:void(0)" '. 
       $s .= $topbar_delimiter;   
       if ($compose_new_win == '1') {
          $s .= '<a href="javascript:void(0)" '. 
-                'onclick="comp_in_new("'.$comp_alt_uri.'")">'.$comp_alt_string.'</a>';
+                'onclick="comp_in_new(\''.$comp_alt_uri.'\')">'.$comp_alt_string.'</a>';
       } else {
          $s .= '<a href="'.$comp_alt_uri.'">'.$comp_alt_string.'</a>';
       }
       } else {
          $s .= '<a href="'.$comp_alt_uri.'">'.$comp_alt_string.'</a>';
       }
@@ -527,15 +501,14 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
 }
 
 function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
 }
 
 function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
-   global $PHP_SELF;
+   global $QUERY_STRING, $base_uri;
    
    $urlMailbox = encodeHeader($mailbox);
    $s = '<table width="100%" cellpadding="3" cellspacing="0" align="center"'.
          ' border="0" bgcolor="'.$color[9].'">'. "\n".
         '<tr align="right"><td valign="top" align="right"><small>';
    
    $urlMailbox = encodeHeader($mailbox);
    $s = '<table width="100%" cellpadding="3" cellspacing="0" align="center"'.
          ' border="0" bgcolor="'.$color[9].'">'. "\n".
         '<tr align="right"><td valign="top" align="right"><small>';
-
-   $viewheader_url = $PHP_SELF .  '&amp;view_hdr=1';
-   $s .= '<a href="'.$viewheader_url.'">'.("View Full Header").'</a>';
+   $url = $base_uri.'src/view_header.php?'.$QUERY_STRING;
+   $s .= '<a href="'.$url.'">'.("View Full Header").'</a>';
   /* Output the printer friendly link if we are in subtle mode. */
    $s .= '&nbsp;|&nbsp;'. 
          printer_friendly_link($mailbox, $passed_id, $passed_ent_id, $color);
   /* Output the printer friendly link if we are in subtle mode. */
    $s .= '&nbsp;|&nbsp;'. 
          printer_friendly_link($mailbox, $passed_id, $passed_ent_id, $color);
@@ -609,18 +582,6 @@ $header = $message->header;
  * =============================================================================
  */
 
  * =============================================================================
  */
 
-
-/*
- * The following code shows the header of the message and then exit
- */
-if (isset($view_hdr)) {
-   $template_vars = array();
-   $template_vars['full_header'] = parse_viewheader($imapConnection,$passed_id, $passed_ent_id);
-   $template_vars['return_address'] = set_url_var($PHP_SELF, 'view_hdr');
-   view_header($template_vars, '', '</body></html>');
-   exit;
-}
-
 if (isset($sendreceipt)) {
    if ( !$message->is_mdnsent ) {
       if (isset($identity) ) {
 if (isset($sendreceipt)) {
    if ( !$message->is_mdnsent ) {
       if (isset($identity) ) {