Changeset 1590 in subversion


Ignore:
Timestamp:
Jul 15, 2008 12:48:20 PM (5 years ago)
Author:
thomasb
Message:

Check PERMANENTFLAGS before saving MDNSent flag (#1484963, #1485163)

Location:
trunk/roundcubemail
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1589 r1590  
    55---------- 
    66- Re-enable autocomplete attribute for login form (#1485211) 
     7- Check PERMANENTFLAGS before saving $MDNSent flag (#1484963, #1485163) 
    78 
    892008/06/30 (alec) 
  • trunk/roundcubemail/program/include/html.php

    r1589 r1590  
    249249    protected $tagname = 'input'; 
    250250    protected $type = 'text'; 
    251     protected $allowed = array('type','name','value','size','tabindex','autocomplete','checked'); 
     251    protected $allowed = array('type','name','value','size','tabindex','autocomplete','checked','onchange'); 
    252252 
    253253    public function __construct($attrib = array()) 
     
    417417{ 
    418418    protected $tagname = 'textarea'; 
    419     protected $allowed = array('name','rows','cols','wrap','tabindex'); 
     419    protected $allowed = array('name','rows','cols','wrap','tabindex','onchange'); 
    420420 
    421421    /** 
     
    474474    protected $tagname = 'select'; 
    475475    protected $options = array(); 
     476    protected $allowed = array('name','size','tabindex','autocomplete','multiple','onchange'); 
    476477     
    477478    /** 
     
    514515                'value' => $option['value'], 
    515516                'selected' => (in_array($option['value'], $select, true) || 
    516             in_array($option['text'], $select, true)) ? 1 : null); 
     517                  in_array($option['text'], $select, true)) ? 1 : null); 
    517518 
    518519            $this->content .= self::tag('option', $attr, Q($option['text'])); 
  • trunk/roundcubemail/program/include/rcube_imap.php

    r1580 r1590  
    343343    $cap = strtoupper($cap); 
    344344    return $this->capabilities[$cap]; 
     345    } 
     346 
     347 
     348  /** 
     349   * Checks the PERMANENTFLAGS capability of the current mailbox 
     350   * and returns true if the given flag is supported by the IMAP server 
     351   * 
     352   * @param   string  Permanentflag name 
     353   * @return  mixed   True if this flag is supported 
     354   * @access  public 
     355   */ 
     356  function check_permflag($flag) 
     357    { 
     358    $flagsmap = $GLOBALS['IMAP_FLAGS']; 
     359    return (($imap_flag = $flagsmap[strtoupper($flag)]) && in_array_nocase($imap_flag, $this->conn->permanentflags)); 
    345360    } 
    346361 
  • trunk/roundcubemail/program/lib/imap.inc

    r1580 r1590  
    9191$GLOBALS['IMAP_SERVER_TZ'] = date('Z'); 
    9292 
     93$GLOBALS['IMAP_FLAGS'] = array( 
     94    'SEEN'     => '\\Seen', 
     95    'DELETED'  => '\\Deleted', 
     96    'RECENT'   => '\\Recent', 
     97    'ANSWERED' => '\\Answered', 
     98    'DRAFT'    => '\\Draft', 
     99    'FLAGGED'  => '\\Flagged', 
     100    'FORWARDED' => '$Forwarded', 
     101    'MDNSENT'  => '$MDNSent'); 
     102 
    93103$iil_error; 
    94104$iil_errornum; 
     
    114124        var $delimiter; 
    115125        var $capability = array(); 
     126        var $permanentflags = array(); 
    116127} 
    117128 
     
    143154        var $mdn_to; 
    144155        var $mdn_sent = false; 
    145         var $is_reply = false; 
     156        var $is_draft = false; 
    146157        var $seen = false; 
    147158        var $deleted = false; 
     
    717728        } 
    718729        if (strcmp($conn->selected, $mailbox) == 0) { 
    719                 return true; 
     730                return true; 
    720731        } 
    721732     
     
    730741                                        $conn->exists = (int) $a[1]; 
    731742                                } 
    732                                 if (strcasecmp($a[2], 'RECENT') == 0) { 
    733                                         $conn->recent = (int) $a[1]; 
    734                                 } 
     743                                if (strcasecmp($a[2], 'RECENT') == 0) { 
     744                                        $conn->recent = (int) $a[1]; 
     745                                } 
     746                        } 
     747                        else if (preg_match('/\[?PERMANENTFLAGS\s+\(([^\)]+)\)\]/U', $line, $match)) { 
     748                                $conn->permanentflags = explode(' ', $match[1]); 
    735749                        } 
    736750                } while (!iil_StartsWith($line, 'sel1')); 
     
    17581772                                                        } else if (strcasecmp($val, '$Forwarded') == 0) { 
    17591773                                                            $result[$id]->forwarded = true; 
     1774                                                        } else if (strcasecmp($val, 'Draft') == 0) { 
     1775                                                            $result[$id]->is_draft = true; 
    17601776                                                        } else if (strcasecmp($val, '$MDNSent') == 0) { 
    17611777                                                            $result[$id]->mdn_sent = true; 
     
    19101926     
    19111927        $fp    = $conn->fp; 
    1912         $flags = array( 
    1913         'SEEN'     => '\\Seen', 
    1914         'DELETED'  => '\\Deleted', 
    1915         'RECENT'   => '\\Recent', 
    1916         'ANSWERED' => '\\Answered', 
    1917         'DRAFT'    => '\\Draft', 
    1918         'FLAGGED'  => '\\Flagged', 
    1919         'FORWARDED' => '$Forwarded', 
    1920         'MDNSENT'  => '$MDNSent'); 
     1928        $flags = $GLOBALS['IMAP_FLAGS']; 
    19211929         
    19221930        $flag = strtoupper($flag); 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r1580 r1590  
    10701070  $message = new rcube_message($uid); 
    10711071   
    1072   if ($message->headers->mdn_to && !$message->headers->mdn_sent) 
     1072  if ($message->headers->mdn_to && !$message->headers->mdn_sent && $IMAP->check_permflag('MDNSENT')) 
    10731073  { 
    10741074    $identity = $RCMAIL->user->get_identity(); 
  • trunk/roundcubemail/program/steps/mail/show.inc

    r1539 r1590  
    8383   
    8484  // check for unset disposition notification 
    85   if ($MESSAGE->headers->mdn_to && !$MESSAGE->headers->mdn_sent && 
    86       $mbox_name != $CONFIG['drafts_mbox'] && $mbox_name != $CONFIG['sent_mbox']) 
     85  if ($MESSAGE->headers->mdn_to && 
     86      !$MESSAGE->headers->mdn_sent && 
     87      $IMAP->check_permflag('MDNSENT') && 
     88      $mbox_name != $CONFIG['drafts_mbox'] && 
     89      $mbox_name != $CONFIG['sent_mbox']) 
    8790  { 
    8891    if (intval($CONFIG['mdn_requests']) === 1) 
Note: See TracChangeset for help on using the changeset viewer.