interface IAuth

Constants

NOONE

Noone can access.

ANYONE

Anyone can access.

Public Methods

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.

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(array $fileds)

Eladmin calls this method during profile update.

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.

Protected Methods

Private Methods

Details

at line 21
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 27
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 32
void login(array $fields)

Eladmin calls this method during authentication.

Parameters

array $fields

Return Value

void

at line 38
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 43
void accountUpdate(array $fileds)

Eladmin calls this method during profile update.

Parameters

array $fileds

Return Value

void

at line 48
void logout()

Logout.

Return Value

void

at line 53
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 58
string userName()

Get user's name to show it in admin.

Return Value

string