class Password implements IAuth

Simple username/password authorization.

Single user, no roles, password hash saved to file.

Properties

protected $username
protected $password
protected $passwordFile
protected $passwordHash
protected $isPasswordFileWriteable

Public Methods

__construct()

No description

array|null
loginFields()

Return an array of login fields in the form of field_name=>[label=>input label, type=>input_type] Retrurn null if Eladmin login dialog should be disabled (and you want to do authentication on your own)

void
unauthorized()

This method is called when user is not autorized and loginFileds returns null.

void
login(array $fields)

Eladmin calls this method during authentication.

void
logout()

Logout.

bool
authorize(array $authorizedRoles = self::ANYONE)

Check if user is logged in. Also check if user has one of the $authorizedRoles (if specified).

string
userName()

Get user's name to show it in admin.

array|null
accountFields()

Return an array of profile fields in the form of field_name=>[label=>input label, type=>input_type] Retrurn null if Eladmin edit profile dialog should be disabled.

void
accountUpdate($fields)

Eladmin calls this method during profile update.

Protected Methods

Private Methods

Details

at line 23
__construct()

at line 33
array|null loginFields()

Return an array of login fields in the form of field_name=>[label=>input label, type=>input_type] Retrurn null if Eladmin login dialog should be disabled (and you want to do authentication on your own)

Return Value

array|null

at line 40
void unauthorized()

This method is called when user is not autorized and loginFileds returns null.

You can redirect to your own login page. Or leave it empty to show HTTP 401.

Return Value

void

at line 42
void login(array $fields)

Eladmin calls this method during authentication.

Parameters

array $fields

Return Value

void

at line 52
void logout()

Logout.

Return Value

void

at line 56
bool authorize(array $authorizedRoles = self::ANYONE)

Check if user is logged in. Also check if user has one of the $authorizedRoles (if specified).

Parameters

array $authorizedRoles

Return Value

bool

at line 60
string userName()

Get user's name to show it in admin.

Return Value

string

at line 64
array|null accountFields()

Return an array of profile fields in the form of field_name=>[label=>input label, type=>input_type] Retrurn null if Eladmin edit profile dialog should be disabled.

Return Value

array|null

at line 74
void accountUpdate($fields)

Eladmin calls this method during profile update.

Parameters

$fields

Return Value

void