PHP 클래스 YiiPassword\Strategy

상속: extends CValidator
파일 보기 프로젝트 열기: phpnode/yiipassword

공개 프로퍼티들

프로퍼티 타입 설명
$daysValid integer | boolean Defaults to false, meaning passwords do not expire
$maxLength integer | boolean There is no good reason to set this value unless you're using it for legacy authentication Defaults to false meaning no maximum password length.
$minDigits integer Defaults to 0 meaning no minimum.
$minLength integer The minimum password length
$minLowerCaseLetters integer Defaults to 0 meaning no minimum.
$minSpecialCharacters integer Defaults to 0 meaning no minimum.
$minUpperCaseLetters integer Defaults to 0 meaning no minimum.
$name string The name of this password strategy
$specialCharacters array The special characters that should appear in passwords if $minSpecialCharacters is set

공개 메소드들

메소드 설명
canUpgradeTo ( Strategy $strategy ) : boolean Checks whether this strategy can be upgraded to another given strategy.
compare ( string $password, string $encoded ) : boolean Compare a plain text password to the given encoded password
encode ( string $password ) : string Encode a plain text password.
getSalt ( boolean $forceRefresh = false ) : string Gets the salt to use with this strategy, if supported.
getUsername ( ) : string Gets the username to use with this strategt
setSalt ( string $salt ) Sets the salt to use with this strategy, if supported
setUsername ( string $username ) Sets the username to use with this strategy

보호된 메소드들

메소드 설명
generateSalt ( ) : string | boolean Generates a random salt.
validateAttribute ( CModel $object, string $attribute ) : boolean Validates a new password to ensure that it meets the minimum complexity requirements

메소드 상세

canUpgradeTo() 공개 메소드

If this strategy's complexity requirements are equal or greater than that of the given strategy, then it can be upgraded. Otherwise the user must be prompted to enter a new password that meets the complexity requirements.
public canUpgradeTo ( Strategy $strategy ) : boolean
$strategy Strategy the strategy to upgrade to
리턴 boolean true if this strategy can be upgraded to the given strategy

compare() 공개 메소드

Compare a plain text password to the given encoded password
public compare ( string $password, string $encoded ) : boolean
$password string the plain text password to compare
$encoded string the encoded password to compare to
리턴 boolean true if the passwords are equal, otherwise false

encode() 추상적인 공개 메소드

Child classes should implement this method and do their encoding here
abstract public encode ( string $password ) : string
$password string the plain text password to encode
리턴 string the encoded password

generateSalt() 보호된 메소드

Generates a random salt.
protected generateSalt ( ) : string | boolean
리턴 string | boolean the generated salt, or false if not supported by this strategy

getSalt() 공개 메소드

Gets the salt to use with this strategy, if supported.
public getSalt ( boolean $forceRefresh = false ) : string
$forceRefresh boolean whether to force generate a new salt
리턴 string the generated salt

getUsername() 공개 메소드

Gets the username to use with this strategt
public getUsername ( ) : string
리턴 string the username

setSalt() 공개 메소드

Sets the salt to use with this strategy, if supported
public setSalt ( string $salt )
$salt string the salt

setUsername() 공개 메소드

Sets the username to use with this strategy
public setUsername ( string $username )
$username string the username

validateAttribute() 보호된 메소드

Validates a new password to ensure that it meets the minimum complexity requirements
protected validateAttribute ( CModel $object, string $attribute ) : boolean
$object CModel the data object being validated
$attribute string the name of the attribute to be validated.
리턴 boolean true if validation succeeded

프로퍼티 상세

$daysValid 공개적으로 프로퍼티

Defaults to false, meaning passwords do not expire
public int|bool $daysValid
리턴 integer | boolean

$maxLength 공개적으로 프로퍼티

There is no good reason to set this value unless you're using it for legacy authentication Defaults to false meaning no maximum password length.
public int|bool $maxLength
리턴 integer | boolean

$minDigits 공개적으로 프로퍼티

Defaults to 0 meaning no minimum.
public int $minDigits
리턴 integer

$minLength 공개적으로 프로퍼티

The minimum password length
public int $minLength
리턴 integer

$minLowerCaseLetters 공개적으로 프로퍼티

Defaults to 0 meaning no minimum.
public int $minLowerCaseLetters
리턴 integer

$minSpecialCharacters 공개적으로 프로퍼티

Defaults to 0 meaning no minimum.
public int $minSpecialCharacters
리턴 integer

$minUpperCaseLetters 공개적으로 프로퍼티

Defaults to 0 meaning no minimum.
public int $minUpperCaseLetters
리턴 integer

$name 공개적으로 프로퍼티

The name of this password strategy
public string $name
리턴 string

$specialCharacters 공개적으로 프로퍼티

The special characters that should appear in passwords if $minSpecialCharacters is set
public array $specialCharacters
리턴 array