Dotclear

Changeset 2366


Ignore:
Timestamp:
06/15/10 07:35:37 (13 years ago)
Author:
franck
Message:

DC 2.2 compliance : new settings system

Location:
plugins/antiflood
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/antiflood

    • Property svn:ignore set to
      _disabled
  • plugins/antiflood/_define.php

    r217 r2366  
    1515     /* Description*/         "Anti flood spam filter", 
    1616     /* Author */             "dcTeam", 
    17      /* Version */            '0.5.1', 
     17     /* Version */            '0.5.2', 
    1818     /* Permissions */        'usage,contentadmin', 
    1919     /* Priority */           200 
  • plugins/antiflood/class.dc.filter.antiflood.php

    r217 r2366  
    2020     private $table; 
    2121      
    22      public function __construct(&$core) 
     22     public function __construct($core) 
    2323     { 
    2424          parent::__construct($core); 
     
    2626          $this->table = $core->prefix.'spamrule'; 
    2727          $blog =& $this->core->blog; 
    28           $this->delay = $blog->settings->flood_delay; 
    29           $this->send_error = $blog->settings->send_error; 
     28          $this->delay = $blog->settings->antiflood->flood_delay; 
     29          $this->send_error = $blog->settings->antiflood->send_error; 
    3030 
    3131          if ($this->delay == null ) { 
    32                $blog->settings->setNameSpace('antiflood'); 
    33                $blog->settings->put('flood_delay',60,'integer','Delay in seconds beetween two comments from the same IP'); 
     32               $blog->settings->addNameSpace('antiflood'); 
     33               $blog->settings->antiflood->put('flood_delay',60,'integer','Delay in seconds beetween two comments from the same IP'); 
    3434               $this->delay = 60; 
    3535          } 
    3636          if ($this->send_error == null ) { 
    37                $blog->settings->setNameSpace('antiflood'); 
    38                $blog->settings->put('send_error',false,'boolean','Whether the filter should reply with a 503 error code'); 
     37               $blog->settings->addNameSpace('antiflood'); 
     38               $blog->settings->antiflood->put('send_error',false,'boolean','Whether the filter should reply with a 503 error code'); 
    3939               $this->send_error = false; 
    4040          } 
     
    155155          $blog =& $this->core->blog; 
    156156           
    157           $flood_delay = $blog->settings->flood_delay; 
    158           $send_error = $blog->settings->send_error; 
     157          $flood_delay = $blog->settings->antiflood->flood_delay; 
     158          $send_error = $blog->settings->antiflood->send_error; 
    159159           
    160160          if (isset($_POST['flood_delay'])) 
     
    165165                    $send_error = isset($_POST['send_error']); 
    166166                     
    167                     $blog->settings->setNameSpace('antiflood'); 
    168                     $blog->settings->put('flood_delay',$flood_delay,'string'); 
    169                     $blog->settings->put('send_error',$send_error,'boolean'); 
     167                    $blog->settings->addNameSpace('antiflood'); 
     168                    $blog->settings->antiflood->put('flood_delay',$flood_delay,'string'); 
     169                    $blog->settings->antiflood->put('send_error',$send_error,'boolean'); 
    170170                     
    171171                    http::redirect($url.'&up=1'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map