User

User information

Arguments

$user
Id or username.
Default: Current user

Example

Show user full name:

$name = $this->get('user')->getName();

Get user information

Show username:

$name = $this->get('user')->getName();

Get user Profile :

$Profile = $this->get('user')->getProfile();

Get the Page defined in profile Variable:

$Employee = $this->get('user')->getProfilePage('employee');

Do something for only certain users:

if ( $this->get('user')->isId(1001,1002,1003) ){
    // This will be executed only for those three users!!
}

Full method list

Method return Description
getId() int Technical identification number.
getUsername() string Username.
getName() string Full name.
getFirstname() string Lastname.
getLastname() string Firstname.
getPhone() string Phone number.
getEmail() string Email address.
isProfile() bool Return TRUE if user is attached to a profile.
isProfile([$id,$name]) bool Return TRUE if user is attached to one of given profiles.
getProfileId() string Id of the profile user is attached to.
getProfile() eProfile Profile the user is attached to.
getProfileVariable([name]) int Get id of the page profile variable is linked to. Return the first variable, if name not given.
getProfilePage([name]) int Get page the profile variable is linked to. Return the first, if name not given.
getValidUntil() eDate User is valid from.
getValidFrom() eDate User is valid untill.
isValid([date]) bool User is valid on given date.
isAdmin() bool Is admin -user (can modify tables schema etc.)
isPrivilege(name) bool Is privilege to given content. (see table below)
getModifiedAt() eDate Edit time.
getCreatedAt() eDate Create time.

isId(val[,val,..]) | bool | Return TRUE, if user ID is one of given values.

isPrivilege(name)

Name Description
root Can create Accounts
admin Can modify current account
php Can modify PHP files in browser
remove Can remove pages data
profiles Can modify profiles
users Can modify users
reports Can modify all reports and privileges
kayttoliittyma Show header, sidemenu etc.
favourite Show Favourite
search Show Favourite
tablelist Show tables list in menu/frontpage
tag Show tags
note Show Notes
todo Show Todos
changelog Sohw page changelogs
sms Allow to send sms messages
sms_messages Show sms message history
email_messages Show email message history