g

Current User

Helper for accessing information about the currently authenticated user. Can be accessed with $_currentUser

Method Description Returns
getId() Return the id of the currently authenticated user. Returns null if no user is authenticated. int
getGlobalId() Return the global id for the user, if the user has a global user int
getPersonId() Return the person id for the user, if the user is logged in int
isLoggedIn() Check whether a user is logged in bool
isAdmin() Check whether the logged in user is an admin for the current site. Will also return true if the user is a superadmin or developer. bool
isSuperAdmin() Check whether the logged in user is a superadmin. Superadmins are allowed full access to all sites in a client's database. Will also return true if the user is a developer. bool
isDeveloper() Check whether the logged in user is a developer. Developers are allowed full access to everything and can switch sites. bool
isFrontendUser() Check whether the logged in user is a frontend user bool
isBackendUser() Check whether the logged in user is a backend user bool
getType() Get the user type for the logged in user. Returns 'frontend' if the user is not logged in. string
getFullName() Get the current user's full name. Returns an empty string if no user is logged in. string