class TwoFactor

Two factor authentication wrapper class

Properties

string $user
array $config
protected boolean $_writable
protected TwoFactorPlugin $_backend
protected array $_available

Methods

__construct(string $user)

Creates new TwoFactor object

array
readConfig()

Reads the configuration

bool
isWritable()

No description

getBackend()

No description

array
getAvailable()

No description

bool
showSubmit()

No description

array
getAvailableBackends()

Returns list of available backends

array
getMissingDeps()

Returns list of missing dependencies

string
getBackendClass(string $name)

Returns class name for given name

getBackendForCurrentUser()

Returns backend for current user

boolean
check(boolean $skip_session = false)

Checks authentication, returns true on success

string
render()

Renders user interface to enter two-factor authentication

string
setup()

Renders user interface to configure two-factor authentication

true|Message
save()

Saves current configuration.

boolean
configure(string $name)

Changes two-factor authentication settings

array
getAllBackends()

Returns array with all available backends

Details

at line 62
__construct(string $user)

Creates new TwoFactor object

Parameters

string $user User name

at line 77
array readConfig()

Reads the configuration

Return Value

array

at line 97
bool isWritable()

Return Value

bool

at line 105
TwoFactorPlugin getBackend()

Return Value

TwoFactorPlugin

at line 113
array getAvailable()

Return Value

array

at line 121
bool showSubmit()

Return Value

bool

at line 132
array getAvailableBackends()

Returns list of available backends

Return Value

array

at line 152
array getMissingDeps()

Returns list of missing dependencies

Return Value

array

at line 183
string getBackendClass(string $name)

Returns class name for given name

Parameters

string $name Backend name

Return Value

string

at line 199
TwoFactorPlugin getBackendForCurrentUser()

Returns backend for current user

Return Value

TwoFactorPlugin

at line 212
boolean check(boolean $skip_session = false)

Checks authentication, returns true on success

Parameters

boolean $skip_session Skip session cache

Return Value

boolean

at line 228
string render()

Renders user interface to enter two-factor authentication

Return Value

string HTML code

at line 238
string setup()

Renders user interface to configure two-factor authentication

Return Value

string HTML code

at line 248
true|Message save()

Saves current configuration.

Return Value

true|Message

at line 263
boolean configure(string $name)

Changes two-factor authentication settings

The object might stay in partialy changed setup if configuration fails.

Parameters

string $name Backend name

Return Value

boolean

at line 295
array getAllBackends()

Returns array with all available backends

Return Value

array