pclib
3.0.0
Lightweight PHP framework
|
Provides access to user account, user roles and permissions. More...
Public Member Functions | |
isLogged () | |
Check if user is logged in. More... | |
isValid () | |
Check if user exists and he is active. More... | |
asObject ($className) | |
Create new instance of $className and copy user data into. More... | |
hasRight ($name, $objectId=0) | |
Check if user has permission $name. More... | |
hasRole ($role) | |
Check if user has role $role. More... | |
hasDefaultPassword () | |
Check if user uses default password. More... | |
getValues () | |
Return user values. More... | |
getCredentials () | |
Return array [userName, password, defaultPassword]. More... | |
__get ($name) | |
PHP magic method. More... | |
passwordVerify ($password) | |
Verify user password. More... | |
changePassword ($password) | |
Change user password. More... | |
Public Member Functions inherited from BaseObject | |
loadDefaults ($className=null) | |
Load default parameters of class $className into object instance. | |
setProperties (array $defaults) | |
Set public properties of object from the array. More... | |
toArray () | |
Convert object to array. More... | |
Data Fields | |
$values | |
array User account values | |
$auth | |
var Auth | |
Data Fields inherited from BaseObject | |
$serviceLocator | |
var function() Return service object when requested with service(). | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseObject | |
static | defaults () |
Set or retireve default parameters of the object. More... | |
Protected Member Functions inherited from BaseObject | |
service ($service, $default=null) | |
Try acquire $service and load it into property $this->$service. More... | |
Provides access to user account, user roles and permissions.
When Auth->login() is successfull, Auth stores user object as Auth->loggedUser. You can get user object for any $userName with Auth->getUser($userName).
__get | ( | $name | ) |
PHP magic method.
Implements following features:
Reimplemented from BaseObject.
asObject | ( | $className | ) |
Create new instance of $className and copy user data into.
changePassword | ( | $password | ) |
Change user password.
string | $password |
getCredentials | ( | ) |
Return array [userName, password, defaultPassword].
getValues | ( | ) |
Return user values.
hasDefaultPassword | ( | ) |
Check if user uses default password.
hasRight | ( | $name, | |
$objectId = 0 |
|||
) |
Check if user has permission $name.
string | $name | Permission |
int | $objectId | Resource object id |
hasRole | ( | $role | ) |
Check if user has role $role.
string | $role | Role |
isLogged | ( | ) |
Check if user is logged in.
isValid | ( | ) |
Check if user exists and he is active.
passwordVerify | ( | $password | ) |
Verify user password.
string | $password |