IAuth
interface IAuth
Constants
NOONE |
Noone can access. |
ANYONE |
Anyone can access. |
Public Methods
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 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.
Check if user is logged in. Also check if user has one of the $authorizedRoles (if specified).
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)
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.
at line 32
void
login(array $fields)
Eladmin calls this method during authentication.
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.
at line 43
void
accountUpdate(array $fileds)
Eladmin calls this method during profile update.
at line 48
void
logout()
Logout.
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).
at line 58
string
userName()
Get user's name to show it in admin.