PHP 클래스 Pop\Auth\Auth

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$adapter mixed Auth adapter object
$attempts integer Current number of login attempts
$encryption integer Encryption method to use
$encryptionOptions array 'salt' // Custom Salt 'secret' // Secret pepper 'cost' // Bcrypt cost 'prefix' // Bcrypt prefix 'rounds' // Sha rounds 'cipher' // Mcrypt cipher 'mode' // Mcrypt cipher 'source' // Mcrypt source
$ip string Current IP address
$isValid boolean User validation result from authentication
$result integer Authentication result
$subnet array Current subnet
$validators array Array of validator objects

공개 메소드들

메소드 설명
__construct ( Pop\Auth\Adapter\AdapterInterface $adapter, integer $encryption, array $options = [] ) : Auth Constructor
authenticate ( string $username, string $password ) : integer Method to authenticate a user
factory ( Pop\Auth\Adapter\AdapterInterface $adapter, integer $encryption ) : Auth Static method to instantiate the auth object and return itself to facilitate chaining methods together.
getAttempts ( ) : integer Method to get the current number of login attempts
getEncryption ( ) : integer Method to get the encryption
getEncryptionOptions ( ) : array Method to get the encryption options
getResult ( ) : integer Method to get the authentication result
getResultMessage ( ) : string Method to get the authentication result message
getUser ( ) : array Method to get the user data array from the adapter
getValidator ( string $name ) : mixed Method to get a validator
isValid ( ) : boolean Method to determine if the user is valid
setAllowedIps ( string | array $ips = null ) : Auth Method to set the allowed IP addresses
setAllowedSubnets ( string | array $subnets = null ) : Auth Method to set the allowed subnets
setAttemptLimit ( integer $attempts ) : Auth Method to set the number of attempts allowed
setAttempts ( integer $attempts ) : Auth Method to set the number of attempts allowed
setBlockedIps ( string | array $ips = null ) : Auth Method to set the block IP addresses
setBlockedSubnets ( string | array $subnets = null ) : Auth Method to set the block subnets
setEncryption ( integer $encryption ) : Auth Method to set the encryption
setEncryptionOptions ( array $options = [] ) : Auth Method to set the encryption options

보호된 메소드들

메소드 설명
filterIps ( string | array $ips ) : array Method to filter the ip addresses to confirm their validity
filterSubnets ( string | array $subnets ) : array Method to filter the subnets to confirm their validity
processValidators ( ) : void Method to process the validators

메소드 상세

__construct() 공개 메소드

Instantiate the auth object
public __construct ( Pop\Auth\Adapter\AdapterInterface $adapter, integer $encryption, array $options = [] ) : Auth
$adapter Pop\Auth\Adapter\AdapterInterface
$encryption integer
$options array
리턴 Auth

authenticate() 공개 메소드

Method to authenticate a user
public authenticate ( string $username, string $password ) : integer
$username string
$password string
리턴 integer

factory() 공개 정적인 메소드

Static method to instantiate the auth object and return itself to facilitate chaining methods together.
public static factory ( Pop\Auth\Adapter\AdapterInterface $adapter, integer $encryption ) : Auth
$adapter Pop\Auth\Adapter\AdapterInterface
$encryption integer
리턴 Auth

filterIps() 보호된 메소드

Method to filter the ip addresses to confirm their validity
protected filterIps ( string | array $ips ) : array
$ips string | array
리턴 array

filterSubnets() 보호된 메소드

Method to filter the subnets to confirm their validity
protected filterSubnets ( string | array $subnets ) : array
$subnets string | array
리턴 array

getAttempts() 공개 메소드

Method to get the current number of login attempts
public getAttempts ( ) : integer
리턴 integer

getEncryption() 공개 메소드

Method to get the encryption
public getEncryption ( ) : integer
리턴 integer

getEncryptionOptions() 공개 메소드

Method to get the encryption options
public getEncryptionOptions ( ) : array
리턴 array

getResult() 공개 메소드

Method to get the authentication result
public getResult ( ) : integer
리턴 integer

getResultMessage() 공개 메소드

Method to get the authentication result message
public getResultMessage ( ) : string
리턴 string

getUser() 공개 메소드

Method to get the user data array from the adapter
public getUser ( ) : array
리턴 array

getValidator() 공개 메소드

Method to get a validator
public getValidator ( string $name ) : mixed
$name string
리턴 mixed

isValid() 공개 메소드

Method to determine if the user is valid
public isValid ( ) : boolean
리턴 boolean

processValidators() 보호된 메소드

Method to process the validators
protected processValidators ( ) : void
리턴 void

setAllowedIps() 공개 메소드

Method to set the allowed IP addresses
public setAllowedIps ( string | array $ips = null ) : Auth
$ips string | array
리턴 Auth

setAllowedSubnets() 공개 메소드

Method to set the allowed subnets
public setAllowedSubnets ( string | array $subnets = null ) : Auth
$subnets string | array
리턴 Auth

setAttemptLimit() 공개 메소드

Method to set the number of attempts allowed
public setAttemptLimit ( integer $attempts ) : Auth
$attempts integer
리턴 Auth

setAttempts() 공개 메소드

Method to set the number of attempts allowed
public setAttempts ( integer $attempts ) : Auth
$attempts integer
리턴 Auth

setBlockedIps() 공개 메소드

Method to set the block IP addresses
public setBlockedIps ( string | array $ips = null ) : Auth
$ips string | array
리턴 Auth

setBlockedSubnets() 공개 메소드

Method to set the block subnets
public setBlockedSubnets ( string | array $subnets = null ) : Auth
$subnets string | array
리턴 Auth

setEncryption() 공개 메소드

Method to set the encryption
public setEncryption ( integer $encryption ) : Auth
$encryption integer
리턴 Auth

setEncryptionOptions() 공개 메소드

Method to set the encryption options
public setEncryptionOptions ( array $options = [] ) : Auth
$options array
리턴 Auth

프로퍼티 상세

$adapter 보호되어 있는 프로퍼티

Auth adapter object
protected mixed $adapter
리턴 mixed

$attempts 보호되어 있는 프로퍼티

Current number of login attempts
protected int $attempts
리턴 integer

$encryption 보호되어 있는 프로퍼티

Encryption method to use
protected int $encryption
리턴 integer

$encryptionOptions 보호되어 있는 프로퍼티

'salt' // Custom Salt 'secret' // Secret pepper 'cost' // Bcrypt cost 'prefix' // Bcrypt prefix 'rounds' // Sha rounds 'cipher' // Mcrypt cipher 'mode' // Mcrypt cipher 'source' // Mcrypt source
protected array $encryptionOptions
리턴 array

$ip 보호되어 있는 프로퍼티

Current IP address
protected string $ip
리턴 string

$isValid 보호되어 있는 프로퍼티

User validation result from authentication
protected bool $isValid
리턴 boolean

$result 보호되어 있는 프로퍼티

Authentication result
protected int $result
리턴 integer

$subnet 보호되어 있는 프로퍼티

Current subnet
protected array $subnet
리턴 array

$validators 보호되어 있는 프로퍼티

Array of validator objects
protected array $validators
리턴 array