Skip to content
Last updated

WHMCS\Authentication\CurrentUser

Class

Utility class for assessing the authentication state or identity of the current actor

Methods

isAuthenticatedUser

public function isAuthenticatedUser(): bool

Whether the current actor is authenticated as a User

Returns User\|null

isAuthenticatedAdmin

public function isAuthenticatedAdmin(): bool

Whether the current actor is authenticated as an Admin

Returns Admin\|null

isMasqueradingAdmin

public function isMasqueradingAdmin(): bool

Whether the current actor is authenticated as an Admin but is also acting on behalf of the client, having performed a "Login as Owner".

Returns bool

user

public function user(): ?User

Get the currently authenticated user.

Returns User\|null

admin

public function admin(): ?Admin

Get the currently authenticated admin.

Returns Admin\|null

client

public function client(): ?Client

Get the currently active client for management.

Returns Client\|null