Availability
Available as of blojsom 2.25.
Description
The IP address moderation plugin checks the IP address for incoming comments or trackbacks against a user-defined whitelist and/or blacklist.
The IP address of the incoming request if first checked against the IP whitelist. If the IP address is in the IP whitelist, the request is processed further. If the IP address of the incoming request is on the IP blacklist, the comment or trackback can be moderated or delete automatically.
There is also an administration plugin available so that you can edit the whitelist and blacklist settings from the web administration console.
Installation and Setup
In your /WEB-INF/classes/blojsom-plugins.xml file, add the following:
<bean id="ip-moderation" class="org.blojsom.plugin.moderation.IPAddressModerationPlugin" init-method="init" destroy-method="destroy">
<property name="eventBroadcaster">
<ref bean="eventBroadcaster"/>
</property>
</bean>
<bean id="ip-moderation-admin" class="org.blojsom.plugin.moderation.admin.IPAddressModerationAdminPlugin" init-method="init"
destroy-method="destroy">
<property name="servletConfig">
<ref bean="servletConfigFactoryBean"/>
</property>
<property name="authorizationProvider">
<ref bean="authorizationProvider"/>
</property>
<property name="resourceManager">
<ref bean="resourceManager"/>
</property>
<property name="fetcher">
<ref bean="fetcher"/>
</property>
</bean>
The following properties can be set from Weblog Settings | Properties | Set Property
| Property |
Description |
Default value |
| delete-ipspam |
Determines if the comment or trackback should be deleted automatically if it contains a blacklisted IP address. |
false |
Usage
Each line in either the IP whitelist or blacklist properties may be either a full IP address or a regular expression. For example, the following, if in the IP blacklist:
127.0.0.1
99.99.99.99
would ban the IP addresses, 127.0.0.1 and 99.99.99.99 from leaving a response on your blog. However, the following, if in the IP blacklist:
127.*
99.*
would ban the entire spectrum of IP addresses starting with 127 and 99 from leaving a response on your blog.