\App\Base\TraitsPageTrait

Pages Trait

Summary

Methods
Properties
Constants
calcTokenId()
tokenIsActive()
getCurrentUser()
checkPermission()
hasLoggedUser()
isHomePage()
No public properties found
No constants found
getTokenHeader()
getToken()
getTokenValidationData()
getTokenData()
$current_user
$current_user_model
$route_info
N/A
No private methods found
No private properties found
N/A

Properties

$current_user

$current_user : array

Type

array — current user data

$current_user_model

$current_user_model : \App\Site\Models\User

Type

User — current user model

$route_info

$route_info : \App\Site\Routing\RouteInfo

Type

RouteInfo — route info object

Methods

calcTokenId()

calcTokenId(int  $uid, string  $username) : string

calculates JWT token id

Parameters

int $uid
string $username

Returns

string —

tokenIsActive()

tokenIsActive(\Lcobucci\JWT\Token  $token) : bool

checks if token is still active

Parameters

\Lcobucci\JWT\Token $token

Throws

\DI\DependencyException
\DI\NotFoundException

Returns

bool —

getCurrentUser()

getCurrentUser(bool  $reset = false) : \App\Site\Models\User|\App\Site\Models\GuestUser|null

gets current user

Parameters

bool $reset

Throws

\DI\DependencyException
\DI\NotFoundException

Returns

\App\Site\Models\User|\App\Site\Models\GuestUser|null —

checkPermission()

checkPermission(string  $permission_name) : bool

checks if current user has specified permission

Parameters

string $permission_name

Throws

\Degami\Basics\Exceptions\BasicException

Returns

bool —

hasLoggedUser()

hasLoggedUser() : bool

checks if user is logged in

Throws

\DI\DependencyException
\DI\NotFoundException

Returns

bool —

isHomePage()

isHomePage() : bool

checks if current is homepage

Throws

\Degami\Basics\Exceptions\BasicException
\DI\DependencyException
\DI\NotFoundException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

bool —

getTokenHeader()

getTokenHeader() : string

gets Authorization token header

Returns

string —

getToken()

getToken() : \Lcobucci\JWT\Token

gets Authorization token Object

Returns

\Lcobucci\JWT\Token —

getTokenValidationData()

getTokenValidationData( $token) : \Lcobucci\JWT\ValidationData

gets token validation data

Parameters

$token

Throws

\DI\DependencyException
\DI\NotFoundException

Returns

\Lcobucci\JWT\ValidationData —

getTokenData()

getTokenData() : array|bool

gets token data

Returns

array|bool —