Plugin Directory

Changeset 615063


Ignore:
Timestamp:
10/20/2012 10:55:11 PM (13 years ago)
Author:
convissor
Message:

Squash for release 0.34.0.

Location:
login-security-solution/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • login-security-solution/trunk/languages/login-security-solution.pot

    r613877 r615063  
    467467#: login-security-solution.php:1863
    468468msgid ""
    469 "WARNING: The '%s' setting you chose means this person has NOT been logged "
    470 "out and will NOT be required to confirm their identity."
     469"The user has been logged out and will be required to confirm their identity "
     470"via the password reset functionality."
    471471msgstr ""
    472472
  • login-security-solution/trunk/login-security-solution.php

    r613877 r615063  
    77 *
    88 * Plugin URI: http://wordpress.org/extend/plugins/login-security-solution/
    9  * Version: 0.33.0
     9 * Version: 0.34.0
    1010 *         (Remember to change the VERSION constant, below, as well!)
    1111 * Author: Daniel Convissor
     
    4343     * This plugin's version
    4444     */
    45     const VERSION = '0.33.0';
     45    const VERSION = '0.34.0';
    4646
    4747    /**
     
    502502     */
    503503    public function login_errors($out = '') {
    504         global $errors, $user_name;
     504        global $errors, $wp_error, $user_name;
    505505
    506506        if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'register') {
     
    510510        }
    511511
    512         $error_codes = $errors->get_error_codes();
     512        if (is_wp_error($errors)) {
     513            $error_codes = $errors->get_error_codes();
     514        } elseif (is_wp_error($wp_error)) {
     515            $error_codes = $wp_error->get_error_codes();
     516        } else {
     517            return $out;
     518        }
    513519
    514520        $codes_to_cloak = array('incorrect_password', 'invalid_username');
     
    12331239
    12341240    /**
     1241     * Determines if PHP's exec() function is usable
     1242     * @return bool
     1243     */
     1244    protected function is_exec_available() {
     1245        static $available;
     1246
     1247        if (!isset($available)) {
     1248            $available = true;
     1249            if (ini_get('safe_mode')) {
     1250                $available = false;
     1251            } else {
     1252                $d = ini_get('disable_functions');
     1253                $s = ini_get('suhosin.executor.func.blacklist');
     1254                if ("$d$s") {
     1255                    $array = preg_split('/,\s*/', "$d,$s");
     1256                    if (in_array('exec', $array)) {
     1257                        $available = false;
     1258                    }
     1259                }
     1260            }
     1261        }
     1262
     1263        return $available;
     1264    }
     1265
     1266    /**
    12351267     * Examines how long ago the current user last interacted with the
    12361268     * site and takes appropriate action
     
    13071339        }
    13081340
     1341        if (!$this->is_exec_available()) {
     1342            $this->available_dict = false;
     1343            return null;
     1344        }
     1345
    13091346        $term = escapeshellarg($pw);
    13101347        exec("dict -m -s exact $term 2>&1", $output, $result);
     
    13771414    protected function is_pw_dictionary__grep($pw) {
    13781415        if ($this->available_grep === false) {
     1416            return null;
     1417        }
     1418
     1419        if (!$this->is_exec_available()) {
     1420            $this->available_grep = false;
    13791421            return null;
    13801422        }
  • login-security-solution/trunk/readme.txt

    r613877 r615063  
    412412
    413413== Changelog ==
     414
     415= 0.34.0 (2012-10-21) =
     416* Have `login_errors` filter check `$wp_error` also, not just `$errors.`
     417* Skip `exec()` calls if `safe_mode` is on.
    414418
    415419= 0.33.0 (2012-10-18) =
  • login-security-solution/trunk/tests/LoginFailTest.php

    r613877 r615063  
    215215
    216216    /**
    217      * @depends test_process_login_fail__pre_threshold
    218      */
    219     public function test_process_login_fail__post_threshold_not_modulus() {
    220         global $wpdb;
    221 
    222         $wpdb->query('SAVEPOINT pre_not_modulus');
    223 
    224         try {
    225             // Do THE deed.
    226             $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__);
    227             // Count is now 5.
    228         } catch (Exception $e) {
    229             $this->fail($e->getMessage());
    230         }
    231         $this->assertGreaterThan(0, $sleep, 'Sleep was not set.');
    232     }
    233 
    234     /**
    235      * @depends test_process_login_fail__post_threshold_not_modulus
    236      */
    237     public function test_process_login_fail__post_threshold_multiple_on() {
    238         global $wpdb;
    239 
    240         $wpdb->query('SAVEPOINT pre_multiple');
    241 
    242         self::$mail_file_basename = __METHOD__;
    243 
    244         $options = self::$lss->options;
    245         $options['login_fail_notify'] = 2;
    246         $options['login_fail_notify_multiple'] = 1;
    247         self::$lss->options = $options;
    248 
    249         try {
    250             // Do THE deed.
    251             $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__);
    252             // Count is now 6.
    253         } catch (Exception $e) {
    254             $this->fail($e->getMessage());
    255         }
    256 
    257         $this->check_mail_file();
    258         $this->assertGreaterThan(0, $sleep, 'Sleep was not set.');
    259 
    260         $wpdb->query('ROLLBACK TO pre_multiple');
    261         // Count is now 5.
    262     }
    263 
    264     /**
    265      * @depends test_process_login_fail__post_threshold_multiple_on
    266      */
    267     public function test_process_login_fail__post_threshold_multiple_off() {
    268         global $wpdb;
    269 
    270         $options = self::$lss->options;
    271         $options['login_fail_notify'] = 2;
    272         self::$lss->options = $options;
    273 
    274         try {
    275             // Do THE deed.
    276             $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__);
    277             // Count is now 6.
    278         } catch (Exception $e) {
    279             $this->fail($e->getMessage());
    280         }
    281         $this->assertGreaterThan(0, $sleep, 'Sleep was not set.');
    282 
    283         $wpdb->query('ROLLBACK TO pre_not_modulus');
    284     }
    285 
    286     /**
    287      * @depends test_process_login_fail__post_threshold_multiple_off
     217     * @depends test_process_login_fail__post_threshold
    288218     */
    289219    public function test_process_login_fail__post_threshold_force_change_off() {
  • login-security-solution/trunk/tests/VerifiedIpTest.php

    r607720 r615063  
    7979
    8080        $wpdb->query('ROLLBACK TO empty');
    81         wp_cache_flush();
     81        wp_cache_init();
    8282
    8383        $actual = self::$lss->get_verified_ips($this->user->ID);
     
    108108
    109109        $wpdb->query('ROLLBACK TO empty');
    110         wp_cache_flush();
     110        wp_cache_init();
    111111    }
    112112
     
    128128
    129129        $wpdb->query('ROLLBACK TO empty');
    130         wp_cache_flush();
     130        wp_cache_init();
    131131    }
    132132
Note: See TracChangeset for help on using the changeset viewer.