Changeset 5542 in subversion


Ignore:
Timestamp:
Dec 5, 2011 2:15:31 AM (18 months ago)
Author:
alec
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/attachments.inc

    r5226 r5542  
    2626 
    2727$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC); 
    28 $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; 
     28$COMPOSE    = null; 
    2929 
    30 if (!$_SESSION['compose']) { 
     30if ($COMPOSE_ID && $_SESSION['compose_data_'.$COMPOSE_ID]) 
     31  $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 
     32 
     33if (!$COMPOSE) { 
    3134  die("Invalid session var!"); 
    3235} 
     
    3942  if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs)) 
    4043    $id = $regs[1]; 
    41   if ($attachment = $_SESSION['compose']['attachments'][$id]) 
     44  if ($attachment = $COMPOSE['attachments'][$id]) 
    4245    $attachment = $RCMAIL->plugins->exec_hook('attachment_delete', $attachment); 
    4346  if ($attachment['status']) { 
    44     if (is_array($_SESSION['compose']['attachments'][$id])) { 
    45       unset($_SESSION['compose']['attachments'][$id]); 
     47    if (is_array($COMPOSE['attachments'][$id])) { 
     48      unset($COMPOSE['attachments'][$id]); 
    4649      $OUTPUT->command('remove_from_attachment_list', "rcmfile$id"); 
    4750    } 
    4851  } 
    49    
     52 
    5053  $OUTPUT->send(); 
    5154  exit; 
     
    5760  if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs)) 
    5861    $id = $regs[1]; 
    59   if ($attachment = $_SESSION['compose']['attachments'][$id]) 
     62  if ($attachment = $COMPOSE['attachments'][$id]) 
    6063    $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment); 
    61      
     64 
    6265  if ($attachment['status']) { 
    6366    if (empty($attachment['size'])) 
     
    6669    header('Content-Type: ' . $attachment['mimetype']); 
    6770    header('Content-Length: ' . $attachment['size']); 
    68      
     71 
    6972    if ($attachment['data']) 
    7073      echo $attachment['data']; 
     
    7780// attachment upload action 
    7881 
    79 if (!is_array($_SESSION['compose']['attachments'])) { 
    80   $_SESSION['compose']['attachments'] = array(); 
     82if (!is_array($COMPOSE['attachments'])) { 
     83  $COMPOSE['attachments'] = array(); 
    8184} 
    8285 
     
    108111      // store new attachment in session 
    109112      unset($attachment['status'], $attachment['abort']); 
    110       $_SESSION['compose']['attachments'][$id] = $attachment; 
     113      $COMPOSE['attachments'][$id] = $attachment; 
    111114 
    112       if (($icon = $_SESSION['compose']['deleteicon']) && is_file($icon)) { 
     115      if (($icon = $COMPOSE['deleteicon']) && is_file($icon)) { 
    113116        $button = html::img(array( 
    114117          'src' => $icon, 
Note: See TracChangeset for help on using the changeset viewer.