Yii 1.1: spasswordvalidator

Model validator for passwords
6 followers

Model / Form validator.

Requirements

Yii 1.1 or above ...

It's to use for a form/model validation rule.

Features

  • ready to use out of the box (see example basic below)
  • customize parameters
    • minimum number of characters
    • minimum number of upper case characters
    • minimum number of lower case characters
    • minimum number of digits characters
    • minimum number of special characters
  • documentation included
  • code quality (coded using unit test)

Examples

Basic (default params)

public function rules()
    {
        return array(
            array('password','ext.SPasswordValidator.SPasswordValidator')
        );
    }

With custom parameters

Number of upper case chars set to 1, minimum number of characters set to 10.

public function rules()
    {
        return array(
            array('password','ext.SPasswordValidator.SPasswordValidator', 'up' => 1, 'min' => 10)
        );
    }

Installation

uncompress the archive in protected/extensions/. So path to php file will be protected/extensions/SPasswordValidator/SPasswordValidator.php.

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension