Property | Type | Description | |
---|---|---|---|
$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 |
Method | Description | |
---|---|---|
canUpgradeTo ( |
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 |
Method | Description | |
---|---|---|
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 |
public canUpgradeTo ( |
||
$strategy | the strategy to upgrade to | |
return | boolean | true if this strategy can be upgraded to the given strategy |
protected generateSalt ( ) : string | boolean | ||
return | string | boolean | the generated salt, or false if not supported by this strategy |
public getUsername ( ) : string | ||
return | string | the username |
public setUsername ( string $username ) | ||
$username | string | the username |
protected validateAttribute ( CModel $object, string $attribute ) : boolean | ||
$object | CModel | the data object being validated |
$attribute | string | the name of the attribute to be validated. |
return | boolean | true if validation succeeded |
public int $minDigits | ||
return | integer |
public int $minLowerCaseLetters | ||
return | integer |
public int $minSpecialCharacters | ||
return | integer |
public int $minUpperCaseLetters | ||
return | integer |
public array $specialCharacters | ||
return | array |