PHP Класс Pop\Auth\Auth

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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