Table
extends AbstractAuth
in package
Uses
AdapterUserTrait
Table auth class
Tags
Table of Contents
Constants
Properties
- $password : string|null
- Authentication password
- $passwordField : string
- Password field
- $result : int
- Authentication result
- $table : string|null
- DB table name/class name
- $user : mixed
- User data
- $username : string|null
- Authentication username
- $usernameField : string
- Username field
Methods
- __construct() : mixed
- Constructor
- authenticate() : int
- Method to authenticate
- getPassword() : string|null
- Get the password
- getPasswordField() : string
- Get the password field
- getResult() : int
- Get the authentication result
- getTable() : string
- Get the table name
- getUser() : mixed
- Get the user record
- getUsername() : string|null
- Get the username
- getUsernameField() : string
- Get the username field
- isAuthenticated() : bool
- Determine if the authentication attempt was successful
- setPassword() : AbstractAuth
- Set the password
- setPasswordField() : static
- Set the password field
- setTable() : Table
- Set the table name
- setUsername() : AbstractAuth
- Set the username
- setUsernameField() : static
- Set the username field
- verify() : bool
- Method to verify a password against a hash
Constants
NOT_VALID
Constant for auth result
public
int
NOT_VALID
= 0
VALID
public
mixed
VALID
= 1
Properties
$password
Authentication password
protected
string|null
$password
= null
$passwordField
Password field
protected
string
$passwordField
= 'password'
$result
Authentication result
protected
int
$result
= 0
$table
DB table name/class name
protected
string|null
$table
= null
$user
User data
protected
mixed
$user
= null
$username
Authentication username
protected
string|null
$username
= null
$usernameField
Username field
protected
string
$usernameField
= 'username'
Methods
__construct()
Constructor
public
__construct(string $table[, string $usernameField = 'username' ][, string $passwordField = 'password' ]) : mixed
Instantiate the File auth adapter object
Parameters
- $table : string
- $usernameField : string = 'username'
- $passwordField : string = 'password'
authenticate()
Method to authenticate
public
authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
intgetPassword()
Get the password
public
getPassword() : string|null
Return values
string|nullgetPasswordField()
Get the password field
public
getPasswordField() : string
Return values
stringgetResult()
Get the authentication result
public
getResult() : int
Return values
intgetTable()
Get the table name
public
getTable() : string
Return values
stringgetUser()
Get the user record
public
getUser() : mixed
getUsername()
Get the username
public
getUsername() : string|null
Return values
string|nullgetUsernameField()
Get the username field
public
getUsernameField() : string
Return values
stringisAuthenticated()
Determine if the authentication attempt was successful
public
isAuthenticated() : bool
Return values
boolsetPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuthsetPasswordField()
Set the password field
public
setPasswordField(string $passwordField) : static
Parameters
- $passwordField : string
Return values
staticsetTable()
Set the table name
public
setTable(string $table) : Table
Parameters
- $table : string
Return values
TablesetUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuthsetUsernameField()
Set the username field
public
setUsernameField(string $usernameField) : static
Parameters
- $usernameField : string
Return values
staticverify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string