Table
extends AbstractAuth
in package
Table auth class
Tags
Table of Contents
- NOT_VALID = 0
- Constant for auth result
- VALID = 1
- $password : string
- Authentication password
- $passwordField : string
- Password field
- $result : int
- Authentication result
- $table : string
- DB table name/class name
- $user : mixed
- User record
- $username : string
- Authentication username
- $usernameField : string
- Username field
- __construct() : mixed
- Constructor
- authenticate() : int
- Method to authenticate
- getPassword() : string
- 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
- Get the username
- getUsernameField() : string
- Get the username field
- isValid() : bool
- Determine if the authentication attempt was valid
- setPassword() : AbstractAuth
- Set the password
- setPasswordField() : Table
- Set the password field
- setTable() : Table
- Set the table name
- setUsername() : AbstractAuth
- Set the username
- setUsernameField() : Table
- 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
$password
= null
$passwordField
Password field
protected
string
$passwordField
= 'password'
$result
Authentication result
protected
int
$result
= 0
$table
DB table name/class name
protected
string
$table
= null
$user
User record
protected
mixed
$user
= null
$username
Authentication username
protected
string
$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'
Return values
mixed —authenticate()
Method to authenticate
public
authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
int —getPassword()
Get the password
public
getPassword() : string
Return values
string —getPasswordField()
Get the password field
public
getPasswordField() : string
Return values
string —getResult()
Get the authentication result
public
getResult() : int
Return values
int —getTable()
Get the table name
public
getTable() : string
Return values
string —getUser()
Get the user record
public
getUser() : mixed
Return values
mixed —getUsername()
Get the username
public
getUsername() : string
Return values
string —getUsernameField()
Get the username field
public
getUsernameField() : string
Return values
string —isValid()
Determine if the authentication attempt was valid
public
isValid() : bool
Return values
bool —setPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuth —setPasswordField()
Set the password field
public
setPasswordField(string $passwordField) : Table
Parameters
- $passwordField : string
Return values
Table —setTable()
Set the table name
public
setTable(string $table) : Table
Parameters
- $table : string
Return values
Table —setUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuth —setUsernameField()
Set the username field
public
setUsernameField(string $usernameField) : Table
Parameters
- $usernameField : string
Return values
Table —verify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string