RegisterModel::isValidPasswordNoRepeat PHP Метод

isValidPasswordNoRepeat() публичный Метод

public isValidPasswordNoRepeat ( $pwd )
    public function isValidPasswordNoRepeat($pwd)
    {
        $res = true;
        if (!preg_match('/^[a-zA-Z0-9]+$/', $pwd)) {
            $this->_error = L('密码只能包含字母和数字');
            $res = false;
            return $res;
        }
        $length = strlen($pwd);
        if ($length < 6) {
            $this->_error = L('PUBLIC_PASSWORD_TIPS');
            // 密码太短了,最少6位
            $res = false;
        } elseif ($length > 15) {
            $this->_error = '密码太长了,最多15位';
            $res = false;
        }
        return $res;
    }