<?php
	include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
	include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
    include_once( PLOG_CLASS_PATH."plugins/dnsantispam/class/security/dnsantispamfilter.class.php" );

	class PluginDNSAntiSpam extends PluginBase
	{
		var $pluginEnabled;
		
		function PluginDNSAntiSpam()
		{
			$this->PluginBase();

			$this->id      = "dnsantispam";
			$this->author  = 'Original build by <a href="http://weblog.sinteur.com/">John Sinteur</a> for WordPress, Ported to pLog by Mark Wu';
			$this->desc    = "Check if a comment poster is on an open proxy list, and check if the content contains known spammer domains.";

			$this->locales = Array( "en_UK" , "zh_TW" );

			$this->init();
		}

		function init()
		{
            $this->registerFilter( "DNSAntiSpamFilter" );

            $this->registerAdminAction( "dnsantispam", "PluginDNSAntiSpamConfigAction" );
			$this->registerAdminAction( "updateDNSAntiSpamConfig", "PluginDNSAntiSpamUpdateConfigAction" );
			
			$menu =& Menu::getMenu();
			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))						
				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "", true, false );			
            $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "DNSAntiSpam", "?op=dnsantispam", "" );            
		}

		function register()
		{
		    $blogSettings = $this->blogInfo->getSettings();
			$this->pluginEnabled = $blogSettings->getValue( "plugin_dnsantispam_enabled" );
		}

	    function isEnabled()
	    {
	        return $this->pluginEnabled;
	    }
	}
?>