Plugin Directory

Changeset 719657


Ignore:
Timestamp:
05/29/2013 12:46:51 AM (13 years ago)
Author:
convissor
Message:

Squash for release 0.39.0.

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

Legend:

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

    r718961 r719657  
    352352"utilize WordPress' built in password reset functionality."
    353353msgstr ""
    354 "Cocher cette case obligera tous les utilisateurs exepté vous, à utiliser le "
    355 "processus de changement de mot de passe de WordPress."
     354"Cocher cette case obligera tous les utilisateurs excepté vous-même, à "
     355"utiliser le processus de changement de mot de passe de WordPress."
    356356
    357357#: admin.php:733
  • login-security-solution/trunk/login-security-solution.php

    r718961 r719657  
    77 *
    88 * Plugin URI: http://wordpress.org/extend/plugins/login-security-solution/
    9  * Version: 0.38.0
     9 * Version: 0.39.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.38.0';
     45    const VERSION = '0.39.0';
    4646
    4747    /**
     
    5959    const E_NUMBER = 'pw-number';
    6060    const E_PUNCT = 'pw-punct';
     61    const E_REUSED = 'pw-reused';
    6162    const E_SEQ_CHAR = 'pw-seqchar';
    6263    const E_SEQ_KEY = 'pw-seqkey';
     
    737738        }
    738739
     740        if ($this->is_pw_reused($user_pass, $user->ID)) {
     741            ###$this->log(__FUNCTION__, "password reused");
     742            $this->redirect_to_login(self::E_REUSED, false, 'rp');
     743            return -2;
     744        }
     745
    739746        $this->save_verified_ip($user->ID, $this->get_ip());
    740747        $this->process_pw_metadata($user->ID, $user_pass);
     
    810817            }
    811818            if ($this->is_pw_reused($user->user_pass, $user->ID)) {
    812                 $this->load_plugin_textdomain();
    813819                $errors->add(self::ID,
    814                     $this->err(__("Passwords can not be reused.", self::ID)),
     820                    $this->err($this->msg(self::E_REUSED)),
    815821                    array('form-field' => 'pass1')
    816822                );
     
    18771883     */
    18781884    protected function msg($code) {
     1885        $this->load_plugin_textdomain();
    18791886        switch ($code) {
    18801887            case self::E_ASCII:
     
    18921899            case self::E_PUNCT:
    18931900                return sprintf(__("Passwords must either contain punctuation marks / symbols or be %d characters long.", self::ID), $this->options['pw_complexity_exemption_length']);
     1901            case self::E_REUSED:
     1902                return __("Passwords can not be reused.", self::ID);
    18941903            case self::E_SEQ_CHAR:
    18951904                return __("Passwords can't have that many sequential characters.", self::ID);
     
    26482657     */
    26492658    public function validate_pw($user, &$errors = null) {
    2650         $this->load_plugin_textdomain();
    2651 
    26522659        if (is_object($user)) {
    26532660            $all_tests = true;
  • login-security-solution/trunk/readme.txt

    r718961 r719657  
    445445
    446446== Changelog ==
     447
     448= 0.39.0 (2013-05-29) =
     449* Enforce password history during password reset process.
    447450
    448451= 0.38.0 (2013-05-27) =
  • login-security-solution/trunk/tests/PasswordChangeTest.php

    r696855 r719657  
    203203        $this->assertGreaterThan(0, $actual, 'Changed time should be > 0.');
    204204
    205         $actual = self::$lss->is_pw_reused(self::$pass_1, $this->user->ID);
    206         $this->assertTrue($actual, 'Password should show up as reused');
    207 
    208205        $this->ensure_grace_and_force_are_empty();
    209 
    210         $wpdb->query('ROLLBACK TO empty');
     206    }
     207
     208    /**
     209     * @depends test_password_reset__normal
     210     */
     211    public function test_password_reset__reused_pw() {
     212        global $wpdb;
     213
     214        $_GET['key'] = 'jk';
     215        $_GET['login'] = 'ab';
     216
     217        $expected_error = 'Cannot modify header information';
     218        $this->expected_errors($expected_error);
     219        self::$location_expected = get_option('siteurl')
     220                . '/wp-login.php?action=rp&key=jk&login=ab&'
     221                . self::$lss->key_login_msg
     222                . '=pw-reused';
     223
     224        $actual = self::$lss->password_reset($this->user, self::$pass_1);
     225        $this->assertEquals(-2, $actual, 'password_reset() return.');
     226
     227        $wpdb->query('ROLLBACK TO empty');
     228
     229        $this->assertTrue($this->were_expected_errors_found(),
     230                "Expected error not found: '$expected_error'");
     231        $this->assertEquals(self::$location_expected, self::$location_actual,
     232                'wp_redirect() produced unexpected location header.');
    211233    }
    212234
Note: See TracChangeset for help on using the changeset viewer.