Dotclear


Ignore:
Timestamp:
05/08/11 21:44:10 (14 years ago)
Author:
annso <as.tranchet@…>
Branch:
default
Children:
224:23ec5a339bcf, 225:411ee50a8664, 249:d0a17b7ca6e0
Message:

Ajout de label et title dans les formulaires du plugin antispam

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/filters/class.dc.filter.iplookup.php

    r0 r223  
    1616     public $name = 'IP Lookup'; 
    1717     public $has_gui = true; 
    18       
     18 
    1919     private $default_bls = 'sbl-xbl.spamhaus.org , bsb.spamlookup.net'; 
    20       
     20 
    2121     public function __construct($core) 
    2222     { 
    2323          parent::__construct($core); 
    24            
     24 
    2525          if (defined('DC_DNSBL_SUPER') && DC_DNSBL_SUPER && !$core->auth->isSuperAdmin()) { 
    2626               $this->has_gui = false; 
    2727          } 
    2828     } 
    29       
     29 
    3030     protected function setInfo() 
    3131     { 
    3232          $this->description = __('Checks sender IP address against DNSBL servers'); 
    3333     } 
    34       
     34 
    3535     public function getStatusMessage($status,$comment_id) 
    3636     { 
    3737          return sprintf(__('Filtered by %1$s with server %2$s.'),$this->guiLink(),$status); 
    3838     } 
    39       
     39 
    4040     public function isSpam($type,$author,$email,$site,$ip,$content,$post_id,&$status) 
    4141     { 
     
    4343               return; 
    4444          } 
    45            
     45 
    4646          $match = array(); 
    47            
     47 
    4848          $bls = $this->getServers(); 
    4949          $bls = preg_split('/\s*,\s*/',$bls); 
    50            
     50 
    5151          foreach ($bls as $bl) 
    5252          { 
     
    5555               } 
    5656          } 
    57            
     57 
    5858          if (!empty($match)) { 
    5959               $status = substr(implode(', ',$match),0,128); 
     
    6161          } 
    6262     } 
    63       
     63 
    6464     public function gui($url) 
    6565     { 
    6666          $bls = $this->getServers(); 
    67            
     67 
    6868          if (isset($_POST['bls'])) 
    6969          { 
     
    7676               } 
    7777          } 
    78            
     78 
    7979          /* DISPLAY 
    8080          ---------------------------------------------- */ 
    8181          $res = ''; 
    82            
     82 
    8383          $res .= 
    8484          '<form action="'.html::escapeURL($url).'" method="post">'. 
    8585          '<fieldset><legend>' . __('IP Lookup servers') . '</legend>'. 
    86           '<p>'.__('Add here a coma separated list of servers.').'</p>'. 
    87           '<p>'.form::textarea('bls',40,3,html::escapeHTML($bls),'maximal').'</p>'. 
     86          '<p>'.'<label for="bls">'.__('Add here a coma separated list of servers.').'</label>'. 
     87          form::textarea('bls',40,3,html::escapeHTML($bls),'maximal').'</p>'. 
    8888          '<p><input type="submit" value="'.__('Save').'" />'. 
    8989          $this->core->formNonce().'</p>'. 
    9090          '</fieldset>'. 
    9191          '</form>'; 
    92            
     92 
    9393          return $res; 
    9494     } 
    95       
     95 
    9696     private function getServers() 
    9797     { 
     
    102102               return $this->default_bls; 
    103103          } 
    104            
     104 
    105105          return $bls; 
    106106     } 
    107       
     107 
    108108     private function dnsblLookup($ip,$bl) 
    109109     { 
    110110          $revIp = implode('.',array_reverse(explode('.',$ip))); 
    111            
     111 
    112112          $host = $revIp.'.'.$bl.'.'; 
    113113          if (gethostbyname($host) != $host) { 
    114114               return true; 
    115115          } 
    116            
     116 
    117117          return false; 
    118118     } 
    119119} 
    120120?> 
     121 
Note: See TracChangeset for help on using the changeset viewer.

Sites map