Dotclear 2.24
Loading...
Searching...
No Matches
dcFilterIP Class Reference
Inheritance diagram for dcFilterIP:
dcSpamFilter

Public Member Functions

 __construct ()
 
 getStatusMessage (string $status, ?int $comment_id)
 
 isSpam (string $type, ?string $author, ?string $email, ?string $site, ?string $ip, ?string $content, ?int $post_id, string &$status)
 
 gui (string $url)
 
 addIP (string $type, string $pattern, bool $global)
 
- Public Member Functions inherited from dcSpamFilter
 __construct ()
 
 isSpam (string $type, ?string $author, ?string $email, ?string $site, ?string $ip, ?string $content, ?int $post_id, string &$status)
 
 trainFilter (string $status, string $filter, string $type, ?string $author, ?string $email, ?string $site, ?string $ip, ?string $content, dcRecord $rs)
 
 getStatusMessage (string $status, ?int $comment_id)
 
 gui (string $url)
 
 hasGUI ()
 
 guiURL ()
 
 guiLink ()
 

Data Fields

 $name = 'IP Filter'
 
 $has_gui = true
 
 $help = 'ip-filter'
 
- Data Fields inherited from dcSpamFilter
 $name
 
 $description
 
 $active = true
 
 $order = 100
 
 $auto_delete = false
 
 $help = null
 

Protected Member Functions

 setInfo ()
 
 setInfo ()
 

Additional Inherited Members

- Protected Attributes inherited from dcSpamFilter
 $has_gui = false
 
 $gui_url = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructs a new instance.

Reimplemented from dcSpamFilter.

References dcCore\app(), and dcAntispam\SPAMRULE_TABLE_NAME.

Member Function Documentation

◆ setInfo()

setInfo ( )
protected

Sets the filter description.

Reimplemented from dcSpamFilter.

◆ getStatusMessage()

getStatusMessage ( string  $status,
?int  $comment_id 
)

Gets the status message.

Parameters
string$statusThe status
int$comment_idThe comment identifier
Returns
string The status message.

Reimplemented from dcSpamFilter.

References dcSpamFilter\guiLink().

◆ isSpam()

isSpam ( string  $type,
?string  $author,
?string  $email,
?string  $site,
?string  $ip,
?string  $content,
?int  $post_id,
string &  $status 
)

This method should return if a comment is a spam or not. If it returns true or false, execution of next filters will be stoped. If should return nothing to let next filters apply.

Parameters
string$typeThe comment type (comment / trackback)
string$authorThe comment author
string$emailThe comment author email
string$siteThe comment author site
string$ipThe comment author IP
string$contentThe comment content
int$post_idThe comment post_id
string$statusThe comment status
Returns
mixed

Reimplemented from dcSpamFilter.

◆ gui()

gui ( string  $url)

Filter settings

Parameters
string$urlThe GUI URL
Returns
string

Reimplemented from dcSpamFilter.

References addIP(), dcPage\addSuccessNotice(), dcCore\app(), and http\redirect().

◆ addIP()

addIP ( string  $type,
string  $pattern,
bool  $global 
)

Adds an IP rule.

Parameters
string$typeThe type
string$patternThe pattern
bool$globalThe global

References dcCore\app().

Referenced by gui().

Field Documentation

◆ $name

$name = 'IP Filter'

◆ $has_gui

$has_gui = true

◆ $help

$help = 'ip-filter'

The documentation for this class was generated from the following file: