USER Methods
User status
login(), logout(), admin(), groups(), status()Creating and deleting users
create(), update(), delete()User information
index(), details(), directory()User registration
evaluate(), register(), hash(), activate(), password()
admin()
Check current user's admin rights. If the user is not logged into the system this method will produce NULL.
bool admin([ int level = 4 ])
Return
Returns TRUE if user has the requested rights
Parameter
Description
level
5 = SUPERADMIN
4 = ADMIN
3 = CUSTOMER
2 = EMPLOYEE
1 = GUEST
Check if user has backend admin rights (default level = 4)
$USER->admin()
RETURN: 0
Check if user is logged in and has preview rights
$USER->admin(1)
RETURN: 1
User is not logged into the system
$USER->admin()
RETURN: NULL