Method | Description | |
---|---|---|
checkPasswordPolicy ( string $password, array $policy ) | Checks whether a password matches some expected policy. | |
checkPasswordSimilarity ( string $password, array $dict, float $max = 80 ) | Checks whether a password is too similar to a dictionary of strings. | |
factory ( string $driver, array $params = null ) : Horde_Auth_Base | Attempts to return a concrete Horde_Auth_Base instance based on $driver. | |
genRandomPassword ( ) : string | Generates a random, hopefully pronounceable, password. This can be used when resetting automatically a user's password. | |
getCryptedPassword ( string $plaintext, string $salt = '', string $encryption = 'md5-hex', boolean $show_encrypt = false ) : string | Formats a password using the current encryption. | |
getSalt ( string $encryption = 'md5-hex', string $seed = '', string $plaintext = '' ) : string | Returns a salt for the appropriate kind of password encryption. |
Method | Description | |
---|---|---|
_toAPRMD5 ( string $value, integer $count ) : string | Converts to allowed 64 characters for APRMD5 passwords. |
public static checkPasswordPolicy ( string $password, array $policy ) | ||
$password | string | A password. |
$policy | array | A configuration with policy rules. Supported rules: - minLength: Minimum length of the password - maxLength: Maximum length of the password - maxSpace: Maximum number of white space characters The following are the types of characters required in a password. Either specific characters, character classes, or both can be required. Specific types are: - minUpper: Minimum number of uppercase characters - minLower: Minimum number of lowercase characters - minNumeric: Minimum number of numeric characters (0-9) - minAlphaNum: Minimum number of alphanumeric characters - minAlpha: Minimum number of alphabetic characters - minSymbol: Minimum number of punctuation / symbol characters - minNonAlpha: Minimum number of non-alphabetic characters Alternatively (or in addition to), the minimum number of character classes can be configured by setting the following. The valid range is 0 through 4 character classes may be required for a password. The classes are: 'upper', 'lower', 'number', and 'symbol'. For example: A password of 'p@ssw0rd' satisfies three classes ('number', 'lower', and 'symbol'), while 'passw0rd' only satisfies two classes ('lower' and 'number'). - minClasses: Minimum number (0 through 4) of character classes. |
public static factory ( string $driver, array $params = null ) : Horde_Auth_Base | ||
$driver | string | Either a driver name, or the full class name to use (class must extend Horde_Auth_Base). |
$params | array | A hash containing any additional configuration or parameters a subclass might need. |
return | Horde_Auth_Base | The newly created concrete instance. |
public static genRandomPassword ( ) : string | ||
return | string | A random password |
public static getCryptedPassword ( string $plaintext, string $salt = '', string $encryption = 'md5-hex', boolean $show_encrypt = false ) : string | ||
$plaintext | string | The plaintext password to encrypt. |
$salt | string | The salt to use to encrypt the password. If not present, a new salt will be generated. |
$encryption | string | The kind of pasword encryption to use. Defaults to md5-hex. |
$show_encrypt | boolean | Some password systems prepend the kind of encryption to the crypted password ({SHA}, etc). Defaults to false. |
return | string | The encrypted password. |
public static getSalt ( string $encryption = 'md5-hex', string $seed = '', string $plaintext = '' ) : string | ||
$encryption | string | The kind of pasword encryption to use. Defaults to md5-hex. |
$seed | string | The seed to get the salt from (probably a previously generated password). Defaults to generating a new seed. |
$plaintext | string | The plaintext password that we're generating a salt for. Defaults to none. |
return | string | The generated or extracted salt. |