\Nano4\UtilsSimpleAuth

SimpleAuth: An object to handle authentication via simple user-hashes.

An extremely basic user authentication system using a simple hash-based approach. It has no specifications as to the user model, other than it needs to store the hash provided by the generate_hash method.

It has an optional paranoid mode, which forces the use of the hash in the is_user() check to ensure the user is valid.

The default storage model is to store the SimpleAuth object in the session. We use the Nano4 Session helper to achieve this. You can disable the autostoring, and store it yourself, or you can create a subclass and override the store(), load() and update() methods.

Summary

Methods
Properties
Constants
preLoad()
__construct()
store()
getInstance()
generate_hash()
is_user()
login()
logout()
$log
No constants found
update()
$hashType
$userid
$authhash
N/A
No private methods found
No private properties found
N/A

Properties

$log

$log : 

Type

$hashType

$hashType : 

Type

$userid

$userid : 

Type

$authhash

$authhash : 

Type

Methods

preLoad()

preLoad() 

__construct()

__construct(  $opts = array()) 

Parameters

$opts

store()

store() 

getInstance()

getInstance(  $opts = array()) 

Parameters

$opts

generate_hash()

generate_hash(  $token,   $pass) 

Parameters

$token
$pass

is_user()

is_user(  $userhash = Null,   $authtoken = Null) 

Parameters

$userhash
$authtoken

login()

login(  $userid,   $pass,   $userhash,   $usertoken = Null,   $paranoid = False) 

Parameters

$userid
$pass
$userhash
$usertoken
$paranoid

logout()

logout(  $destroy_session = False,   $restart_session = False) 

Parameters

$destroy_session
$restart_session

update()

update()