Plugin Directory

Changeset 755702


Ignore:
Timestamp:
08/13/2013 05:10:08 PM (13 years ago)
Author:
bobbravo2
Message:

added user configurable blacklisted usernames

Location:
wordpress-by-circle-tree/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wordpress-by-circle-tree/trunk/includes/class.wp_login_lockdown.php

    r743380 r755702  
    4848            'root'
    4949    );
     50    private function get_blacklisted_usernames ()
     51    {
     52        $defaults = $this->admin_usernames;
     53        $usernames_string = $this->get_setting('blacklisted_admin_usernames');
     54        $usernames_array = array();
     55        if ($usernames_string != '') {
     56            $usernames_array = explode(',', $usernames_string);
     57        }
     58        return array_merge($usernames_array, $defaults);
     59    }
    5060    /**
    5161     * Registered Settings
     
    252262                        'label'   =>    'Blacklist IPs using the Admin User Account',
    253263                        'tooltip' =>    'Automatically block IP addresses that attempt to login ' . //Make sure you concat long strings!
    254                         'using ('.rtrim(implode(', ', $this->admin_usernames), ', ').') usernames',
     264                        'using ('.rtrim(implode(', ', $this->get_blacklisted_usernames()), ', ').') usernames',
    255265                        'default' =>     true
     266                ),
     267                array(
     268                        'name'    =>     'blacklisted_admin_usernames',
     269                        'type'    =>    'text',
     270                        'size'    =>    80,
     271                        'label'   =>    'Additional Blacklisted Usernames',
     272                        'tooltip' =>    'CSV Usernames to automatically blacklist',
    256273                ),
    257274                array(
     
    397414    public function login_failed ($username) {
    398415        if ( $this->get_setting('blacklist_admin') ) {
    399             if (in_array(trim(strtolower($username)), $this->admin_usernames)) {
     416            if (in_array(trim(strtolower($username)), $this->get_blacklisted_usernames())) {
    400417                $this->block_ip(self::$remote_ip);
    401418                $this->log('Blacklisted Username', $username, self::$remote_ip);
  • wordpress-by-circle-tree/trunk/wordpress-by-circletree.php

    r743399 r755702  
    55Description: Secure Login Screen for Circle Tree powered websites
    66Author: Circle Tree, LLC
    7 Version: 3.0.2
     7Version: 3.0.3
    88Author URI: http://mycircletree.com/
    99*/
Note: See TracChangeset for help on using the changeset viewer.