WordPress.org

Plugin Directory

Changeset 495670


Ignore:
Timestamp:
01/26/12 16:14:12 (2 years ago)
Author:
Latz
Message:

v0.2:
Added botscout.com support

Location:
doorman
Files:
16 added
6 edited

Legend:

Unmodified
Added
Removed
  • doorman/trunk/doorman.php

    r492144 r495670  
    33Plugin Name: Doorman 
    44Plugin URI: http://www.elektroelch.net 
    5 Description: Bounces registration attempts with one time mailer addresses. 
    6 Version: 0.1 
     5Description: BBounces registration attempts of spam bots and spammers with one time mailer addresses. 
     6Version: 0.2 
    77Author: Lutz Schröer 
    88Author URI: http://elektroelch.net/blog 
     
    142142             * @return Type    Description   
    143143             */ 
    144         function add_settings_link( $links ) { 
    145                 $settings_link = '<a href="options-general.php?page=doorman.php">'. __('Settings').'</a>'; 
    146                 array_unshift( $links, $settings_link ); 
    147                 return $links; 
    148         } //add_settings_link() 
    149  
     144            function add_settings_link( $links ) { 
     145                    $settings_link = '<a href="options-general.php?page=doorman.php">'. __('Settings').'</a>'; 
     146                    array_unshift( $links, $settings_link ); 
     147                    return $links; 
     148            } //add_settings_link() 
     149     
    150150            /* -------------------------------------------------------------------------------------------------------------- */ 
    151151            /** 
     
    160160             */ 
    161161            function check_internal_list($domain) { 
    162                  
    163                  
    164162                return (sizeof(preg_grep('/'. $domain . '$/', $this->options['servers'])) > 0); 
    165163            } 
     
    186184             * Checks mail domain entered by user against whitelist 
    187185             * 
    188              * @since 0.1 
    189              * 
    190186             * @param $domain Domain name or part of it as defined in the whitelist 
    191187             * 
    192188             * @return bool TRUE, if server is in whitelist 
     189             * 
     190             * @since 0.1 
     191             *  
    193192             */ 
    194193            function check_whitelist($domain) { 
     
    198197                return false; 
    199198            } 
    200  
     199            /* -------------------------------------------------------------------------------------------------------------- */ 
     200            /** 
     201             * Check user email with botscout.com 
     202             *  
     203             * @param string $user_email User email given at login form 
     204             *  
     205             * @return boolean    TRUE if found at botscout.com, otherwise false 
     206             * 
     207             * @since 0.2 
     208             *  
     209             */ 
     210            function check_botscout($user_email) { 
     211                require_once('botscout.php'); 
     212                $bs = new DoormanBotscout; 
     213                if (isset($this->options['botscoutapikey'])) 
     214                    $bs->set_apikey($this->options['botscoutapikey']); 
     215                $bs->set_xmail($user_email); 
     216                $response = $bs->check_mail(); 
     217 
     218                // if $response is not set there has been an error 
     219                // assume mail address to be valid 
     220                if (! isset($response['response'])) 
     221                    return false; 
     222                 
     223                $data = explode('|', $response['body']); 
     224                 
     225                return ('Y' == $data[0]); 
     226 
     227            } // 
    201228            /* -------------------------------------------------------------------------------------------------------------- */ 
    202229            /** 
     
    222249                            return; 
    223250 
    224                      $found = $this->check_blacklist($domain) || $this->check_internal_list($domain); 
     251                    // do all checks, stops if a check returns true 
     252                    $found = $this->check_blacklist($domain) 
     253                                     || $this->check_internal_list($domain) 
     254                                     || $this->check_botscout($user_email); 
    225255 
    226256                    if ($found) { 
  • doorman/trunk/doorman_options.php

    r492143 r495670  
    1818    function save_options() { 
    1919 
     20 
    2021        $server_data = file(plugin_dir_path( __FILE__ ) . 'servers.dat'); 
    2122        $options = array(); 
     
    3031        if (isset($_POST['error_message'])) 
    3132            $options['error_message'] = $_POST['error_message']; 
     33        if (isset($_POST['botscoutapikey'])) 
     34            $options['botscoutapikey'] = $_POST['botscoutapikey']; 
     35             
    3236        $options['servers'] = $servers; 
    3337 
     
    115119                        $this->postbox('whitelist', __('Whitelist', 'doorman'), $content); 
    116120                 
    117                         $content = '<textarea style="height: 12em; width: 100%;"name="blacklist" id="blacklist" size="300">'; 
     121                        $content = '<textarea style="height: 12em; width: 100%;" name="blacklist" id="blacklist" size="300">'; 
    118122                        if (isset($this->options['blacklist'])) 
    119123                                foreach ($this->options['blacklist'] as $blacklisted) 
     
    122126                        $this->postbox('blacklist', __('Blacklist', 'doorman'), $content); 
    123127                         
     128 
     129                        $content = __('API key:', 'doorman'); 
     130                        $content .= '<input type="text" name="botscoutapikey" size="50"'; 
     131                        if (isset($this->options['botscoutapikey'])) 
     132                          $content .= '" value="' . $this->options['botscoutapikey'] . '"'; 
     133                        $content .= '>'; 
     134                        $content .= __("<p>Currently you can do 20 bot lookup tests per day. If you need more than that you can get an API key (it's free). ", 'doorman'); 
     135                        $content .= sprintf( __('You can get the key here: %s</p>', 'doorman'), 'http://botscout.com/getkey.htm'); 
     136                        $this->postbox('botscout', __('Botscout', 'doorman'), $content); 
     137 
     138 
    124139                        $servers = count($this->options['servers']); 
    125140                        $content = __(sprintf(__('There are %s servers in the list.', 'doorman'), $servers)); 
     
    127142                        //$content .= '<a jref="#">' . __('Display.') . '</a>'; 
    128143                        $this->postbox('server_list', __('Server list', 'doorman'), $content); 
    129  
    130144 
    131145        ?> 
  • doorman/trunk/lang/doorman-de_DE.po

    r492143 r495670  
    1010"Content-Transfer-Encoding: 8bit\n" 
    1111"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 
    12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
    13 "Language-Team: LANGUAGE <LL@li.org>\n" 
     12"Last-Translator: Lutz SChroeer <latz@elektroelch.de>\n" 
    1413 
    15 #: doorman_options.php:47 
    1614msgid "You do not have sufficient permissions to access this page." 
    1715msgstr "Du hast nicht die notwendigen Berechtigung, um diese Seite zu &ouml;ffnen." 
    1816 
    19 #: doorman_options.php:68 
    2017msgid "Click to toggle" 
    2118msgstr "&Ouml;ffnen" 
    2219 
    23 #: doorman_options.php:86 
    2420msgid "Settings saved." 
    2521msgstr "Einstellungen gespeichert." 
    2622 
    27 #: doorman_options.php:91 
    2823msgid "Doorman" 
    2924msgstr "Doorman" 
    3025 
    31 #: doorman_options.php:108 
    3226msgid "Error message" 
    3327msgstr "Fehlermeldung" 
    3428 
    35 #: doorman_options.php:115 
    3629msgid "Whitelist" 
    3730msgstr "Whitelist" 
    3831 
    39 #: doorman_options.php:122 
    4032msgid "Blacklist" 
    4133msgstr "Blacklist" 
    4234 
    43 #: doorman_options.php:128 
    4435msgid "Server list" 
    4536msgstr "Serverliste" 
    4637 
    47 #: doorman_options.php:125 
    4838msgid "There are %s servers in the list." 
    4939msgstr "Es befinden sich %s Server in der Liste." 
    5040 
    51 #: doorman_options.php:134 
    5241msgid "Save Settings" 
    5342msgstr "Einstellungen speichern" 
    5443 
    55 #: doorman.php:77 
    5644msgid "The domain %s has been blocked by the system." 
    5745msgstr "Die Domain %s wurde vom System blockiert." 
    5846 
    59 #: doorman.php:145 
    6047msgid "Settings" 
    6148msgstr "Einstellungen" 
    6249 
     50msgid "API key:" 
     51msgstr "API-Schl&uuml;ssel:" 
     52 
     53msgid "<p>Currently you can do 20 bot lookup tests per day. If you need more than that you can get an API key (it's free). " 
     54msgstr "" 
     55"<p>Momentan k&ouml;nnen Sie 20 Bot-Abfragen machen. Für mehr ben&ouml;tigen " 
     56"Sie einen API-Schl&uuml;ssel (kostenlos). " 
     57 
     58msgid "You can get the key here: %s</p>" 
     59msgstr "Sie bekommen den AP-Schl&uuml;ssel hier: %s</p>" 
  • doorman/trunk/lang/doorman.po

    r492143 r495670  
    6060msgid "Settings" 
    6161msgstr "" 
     62 
     63msgid "API key:" 
     64msgstr "" 
     65 
     66msgid "<p>Currently you can do 20 bot lookup tests per day. If you need more than that you can get an API key (it's free). " 
     67msgstr "" 
     68 
     69msgid "You can get the key here: %s</p>" 
     70msgstr "" 
  • doorman/trunk/readme.txt

    r492156 r495670  
    66Stable tag: 0.1 
    77 
    8 Bounces registration attempts with one time mailer addresses. 
     8Bounces registration attempts of spam bots and spammers with one time mailer addresses. 
    99 
    1010== Description == 
    1111Stops people from registering at your blog with a disposable mail address by matching 
    12 them with a list of over 200 known disposable mail providers. Additionally you can 
     12them with a provided list of over 200 known disposable mail providers. Additionally you can 
    1313define your own blacklist and whitelist. 
     14If the domain is not found in the provided list the mail address is checked with botscout.com. 
    1415 
    1516**Coming soon** 
    16  
    17 * Check for spammer addresses with "botscout.com" 
    1817* Create log of rejected registration attempts 
     18* Block bots and spammers from posting comments 
    1919 
    2020== Installation == 
     
    3636Same as the Blacklist except that it will allow domains instead of blocking them. 
    3737 
     38Botscout API key: 
     39By aquiring an API key you can increase you daily number of free request (20) to 
     40a much larger number. You can get your API key here: http://botscout.com/getkey.htm 
     41 
    3842= Order of testing = 
    3943The mail domains are checked in the following order: 
    40 Whitelist, Blacklist, List of known disposable mail services 
     44Whitelist, Blacklist, List of known disposable mail services, botscout.com 
    4145 
    4246== Changelog == 
    4347= 0.1 = 
    4448* Initial release 
     49 
     50= 0.2 = 
     51+ Added botscout.com support 
     52 
Note: See TracChangeset for help on using the changeset viewer.