Documentation

Table extends AbstractAuth
in package
Uses AdapterUserTrait

Table auth class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.0.0

Table of Contents

Constants

NOT_VALID  = 0
Constant for auth result
VALID  = 1

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

Properties

$password

Authentication password

protected string|null $password = null

$passwordField

Password field

protected string $passwordField = 'password'

$table

DB table name/class name

protected string|null $table = 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
int

getPassword()

Get the password

public getPassword() : string|null
Return values
string|null

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

getUsername()

Get the username

public getUsername() : string|null
Return values
string|null

getUsernameField()

Get the username field

public getUsernameField() : string
Return values
string

isAuthenticated()

Determine if the authentication attempt was successful

public isAuthenticated() : bool
Return values
bool

setPasswordField()

Set the password field

public setPasswordField(string $passwordField) : static
Parameters
$passwordField : string
Return values
static

setTable()

Set the table name

public setTable(string $table) : Table
Parameters
$table : string
Return values
Table

setUsernameField()

Set the username field

public setUsernameField(string $usernameField) : static
Parameters
$usernameField : string
Return values
static

verify()

Method to verify a password against a hash

public verify(string $password, string $hash) : bool
Parameters
$password : string
$hash : string
Return values
bool

        
On this page

Search results