Changeset 5747


Ignore:
Timestamp:
03/19/12 10:08:11 (12 years ago)
Author:
airton
Message:

Ticket #1782 - Especificar DFD0060 - Correcao da verificacao do array de regras

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/filters/interceptors/FilterMapping.php

    r5728 r5747  
    8484                foreach( $rules as $name => $data ) 
    8585                { 
    86                         /* Usado na opção Bloquear usuário do ExpressoMail */ 
    87                         if($data['block']) { 
    88                                 ($i >0) ? $script_match = 'elsif anyof' : $script_match = 'if anyof'; 
    89                                 $script_match = $script_match . "(address :is \"from\" [\"" .$data['name'] . "\"]) {\r\n";   
    90                                 $script_match .= "fileinto \"INBOX/Spam\"; \r\n}\r\n"; 
    91                                 $script_rules .= $script_match; 
    92                                 $script_match = ""; 
    93                                 $script_criteria = ""; 
    94                                 $require_fileinto = true; 
    95                                 $i++; 
    96                                 continue; 
     86                         
     87                        if(array_key_exists("block", $data)) { 
     88                                /* Usado na opção Bloquear usuário do ExpressoMail */ 
     89                                if($data['block']) { 
     90                                        ($i >0) ? $script_match = 'elsif anyof' : $script_match = 'if anyof'; 
     91                                        $script_match = $script_match . "(address :is \"from\" [\"" .$data['name'] . "\"]) {\r\n";   
     92                                        $script_match .= "fileinto \"INBOX/Spam\"; \r\n}\r\n"; 
     93                                        $script_rules .= $script_match; 
     94                                        $script_match = ""; 
     95                                        $script_criteria = ""; 
     96                                        $require_fileinto = true; 
     97                                        $i++; 
     98                                        continue; 
     99                                } 
    97100                        } 
    98                          
    99                         if( $data['enabled'] == 'false' ) 
    100                                 continue; 
     101                        //if( $data['enabled'] == 'false' ) 
     102                                //continue; 
    101103 
    102104                        $vacation = false; 
     
    194196                        $script_action = " {\r\n "; 
    195197                         
    196                         if( is_array($actions) ) 
     198                        if( is_array($action) ) 
    197199                        foreach ($action as $k=> $value); 
    198200                        { 
     
    257259                $content = $script_begin . $script_header . $script_rules . "\r\n\r\n#PseudoScript#" . "\r\n#" . $json_data; 
    258260                //$content = "";  
     261 
    259262                return( $content ); 
    260263        } 
     
    415418        public function applySieveFilter( &$uri , &$result , &$criteria , $original  ) 
    416419        { 
     420                /* 
    417421                $result['id'] = $uri['id']; 
    418422                $rule_apply = array();  
     
    436440                $proc = array(); 
    437441                $proc['keep'] = false; 
    438                        
    439                  
    440                 $imap = Controller::service( 'Imap' ); 
     442                */       
     443                 
     444                //$imap = Controller::service( 'Imap' ); 
    441445                //$imap->apliSieveFilter($original['properties']['applyMessages'] , $proc );  
    442                 $imap->apliSieveFilter($messages , $actions );  
    443                 return $result; 
     446                //$imap->apliSieveFilter($messages , $actions );  
     447                //return $result; 
    444448        } 
    445449 
     
    564568 
    565569                foreach( $script as $i => $rule ) 
     570                        if(is_array ($rule['name']) && is_array($original['id'])) 
    566571                        if( $rule['name'] === $original['id'] ) 
    567572                                return( $params = $rule ); 
Note: See TracChangeset for help on using the changeset viewer.