Password
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
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)
Check if user is logged in. Also check if user has one of the $authorizedRoles (if specified).
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.
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)
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.
at line 42
void
login(array $fields)
Eladmin calls this method during authentication.
at line 52
void
logout()
Logout.
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).
at line 60
string
userName()
Get user's name to show it in admin.
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.
at line 74
void
accountUpdate($fields)
Eladmin calls this method during profile update.