TwoFa
extends LoggedUserFormPage
in package
"2Fa" Page
Table of Contents
Properties
- $translators : array<string|int, mixed>
- $container : ContainerInterface
- $current_user : array<string|int, mixed>|object|null
- $current_user_model : AccountModel|null
- $page_title : string
- $regions : array<string|int, mixed>
- $request : Request|null
- $response : Response
- $rewrite : Rewrite|null
- $route_info : RouteInfo|null
- $template : Template|null
Methods
- __call() : mixed
- {@inheritdoc}
- __construct() : mixed
- BasePage constructor.
- __toString() : string
- toString magic method
- addErrorFlashMessage() : self
- adds a error flash message
- addFlashMessage() : self
- adds a flash message for next response
- addInfoFlashMessage() : self
- adds an info flash message
- addSuccessFlashMessage() : self
- adds a success flash message
- addTag() : self|bool
- adds a tag to page region
- addWarningFlashMessage() : self
- adds a warning flash message
- calcTokenId() : string
- calculates JWT token id
- canBeFPC() : bool
- specifies if this controller is eligible for full page cache
- checkPermission() : bool
- checks if current user has specified permission
- containerCall() : mixed
- call method through container
- containerMake() : mixed
- create object through container
- dropFlashMessages() : self
- removes all currently stored flash messages
- formSubmitted() : mixed
- {@inheritdoc}
- formValidate() : bool|string
- {@inheritdoc}
- getAccessPermission() : string
- gets access permission name
- getApp() : App
- gets app object
- getAppRouteInfo() : RouteInfo|null
- gets route info
- getAppWebsite() : Website|null
- gets current website
- getAssets() : Manager
- gets assets manager
- getBaseTemplateData() : array<string|int, mixed>
- prepares basic template data
- getCache() : Manager
- get cache manager
- getCacheKey() : string
- gets cache key
- getContainer() : ContainerInterface
- gets container object
- getControllerUrl() : string
- gets current controller url
- getCrudRouter() : Crud
- gets crud service
- getCurrentLocale() : string
- {@inheritdoc}
- getCurrentUser() : AccountModel|null
- gets current user
- getCurrentWebsite() : Website|null
- gets current website model
- getCurrentWebsiteId() : int|null
- gets current website id
- getDb() : Database
- gets db object
- getDebugbar() : StandardDebugBar
- gets debugbar object
- getDestParam() : string
- gets the destination param
- getEnv() : mixed
- gets env variable
- getEventManager() : SharedEventEmitter
- gets events manager service
- getFlashMessages() : array<string|int, mixed>|null
- gets currently stored flash messages
- getForm() : Form|null
- get form object
- getFormDefinition() : Form
- {@inheritdoc}
- getFpcCacheKey() : string
- gets fpc cache key
- getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
- gets google authenticator service
- getGuzzle() : Client
- gets guzzle service
- getHtmlRenderer() : HtmlPartsRenderer
- gets html renderer service
- getIcons() : Icons
- gets icons service
- getImagine() : Imagine
- gets imagine service
- getInfo() : array<string|int, mixed>
- gets info about current page
- getLog() : Logger
- gets log object
- getMailer() : Mailer
- gets mailer service
- getObject() : BaseModel|null
- gets object to show
- getPageRouteName() : string
- gets controller route name
- getPageTitle() : string
- gets page title
- getPdo() : PDO
- gets PDO object
- getRedis() : Manager
- gets redis service
- getRequest() : Request
- get request object
- getRewrite() : Rewrite|null
- gets Rewrite object for current page
- getRewriteObject() : Rewrite|null
- gets rewrite object
- getRouteGroup() : string|null
- gets route group
- getRouteInfo() : RouteInfo|null
- get route_info
- getRouteName() : string
- gets current route name
- getRoutePath() : string
- return route path
- getRouters() : array<string|int, mixed>
- gets routers
- getRouteVerbs() : array<string|int, mixed>
- returns valid route HTTP verbs
- getSchema() : Schema
- gets schema object
- getSearch() : Manager
- gets search service
- getSesMailer() : SesClient
- gets SES mailer service
- getSiteData() : SiteData
- gets site data service
- getSmtpMailer() : Swift_Mailer
- gets SMTP mailer service
- getTemplate() : Template|null
- get current template
- getTemplateData() : array<string|int, mixed>
- gets current page template data
- getTemplateName() : string
- gets current page template name
- getTemplates() : Engine
- gets plates engine object
- getTranslations() : array<string|int, mixed>
- {@inheritdoc}
- getTranslator() : Translator
- gets translator
- getUrl() : string
- gets url by route_name and params
- getUtils() : Globals
- gets global utils service
- getWebhooksRouter() : Webhooks
- gets webhooks service
- getWebRouter() : Web
- gets routing service
- getZip() : Zip
- gets zip service
- hasLoggedUser() : bool
- checks if user is logged in
- isEnabled() : bool
- determines if route is available for router
- isHomePage() : bool
- checks if current is homepage
- process() : Response
- controller action
- renderPage() : BasePage|Response
- controller entrypoint
- requestUrl() : string|bool
- executes an http request
- setRouteInfo() : BasePage
- set route info
- showBlocks() : bool
- show blocks flag.
- showMenu() : bool
- show menu flag.
- tokenIsActive() : bool
- checks if token is still active
- addSubmitButton() : Form
- adds submit button to form
- alterTemplateName() : string
- eventually alters template name
- beforeRender() : Response|self
- {@intheritdocs}
- check2FA() : bool
- checkCredentials() : bool
- checks user credentials
- doRedirect() : RedirectResponse
- returns a redirect object
- fillConfirmationForm() : Form
- gets a form for confirmation
- getFormId() : string
- gets form id
- getRegionTags() : bool|string
- get page region tags html
- getResponse() : Response
- get response object
- getRouteData() : mixed
- gets route data
- getSecret() : string
- getService() : mixed
- gets registered service
- getTokenData() : mixed
- gets token data
- isSubmitted() : bool
- check if form is submitted
- normalizeCacheKey() : string
- prepareTemplate() : Template
- prepare template object
- processFormSubmit() : void
- process form submission
- refreshPage() : RedirectResponse
- returns a redirect object to same page
- setObject() : self
- sets object to show
Properties
$translators
public
static array<string|int, mixed>
$translators
= []
translators
$container
protected
ContainerInterface
$container
$current_user
protected
array<string|int, mixed>|object|null
$current_user
= null
current user data
$current_user_model
protected
AccountModel|null
$current_user_model
= null
current user model
$page_title
protected
string
$page_title
page title
$regions
protected
array<string|int, mixed>
$regions
= []
page regions
$request
protected
Request|null
$request
= null
$response
protected
Response
$response
response object
$rewrite
protected
Rewrite|null
$rewrite
= null
rewrite
$route_info
protected
RouteInfo|null
$route_info
= null
$template
protected
Template|null
$template
= null
template object
Methods
__call()
{@inheritdoc}
public
__call(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__construct()
BasePage constructor.
public
__construct(ContainerInterface $container[, Request|null $request = null ][, RouteInfo $route_info = null ]) : mixed
Parameters
- $container : ContainerInterface
- $request : Request|null = null
- $route_info : RouteInfo = null
Tags
__toString()
toString magic method
public
__toString() : string
Return values
string —the form html
addErrorFlashMessage()
adds a error flash message
public
addErrorFlashMessage(string $message[, bool $direct = false ]) : self
Parameters
- $message : string
- $direct : bool = false
-
store message in session
Tags
Return values
selfaddFlashMessage()
adds a flash message for next response
public
addFlashMessage(string $type, string $message[, bool $direct = false ]) : self
Parameters
- $type : string
- $message : string
- $direct : bool = false
-
store message in session
Tags
Return values
selfaddInfoFlashMessage()
adds an info flash message
public
addInfoFlashMessage(string $message[, bool $direct = false ]) : self
Parameters
- $message : string
- $direct : bool = false
-
store message in session
Tags
Return values
selfaddSuccessFlashMessage()
adds a success flash message
public
addSuccessFlashMessage(string $message[, bool $direct = false ]) : self
Parameters
- $message : string
- $direct : bool = false
-
store message in session
Tags
Return values
selfaddTag()
adds a tag to page region
public
addTag(string $region, TagElement|array<string|int, mixed> $tag) : self|bool
Parameters
- $region : string
- $tag : TagElement|array<string|int, mixed>
Return values
self|booladdWarningFlashMessage()
adds a warning flash message
public
addWarningFlashMessage(string $message[, bool $direct = false ]) : self
Parameters
- $message : string
- $direct : bool = false
-
store message in session
Tags
Return values
selfcalcTokenId()
calculates JWT token id
public
calcTokenId(int $uid, string $username) : string
Parameters
- $uid : int
- $username : string
Return values
stringcanBeFPC()
specifies if this controller is eligible for full page cache
public
canBeFPC() : bool
Return values
boolcheckPermission()
checks if current user has specified permission
public
checkPermission(string $permission_name) : bool
Parameters
- $permission_name : string
Tags
Return values
boolcontainerCall()
call method through container
public
containerCall(callable $callable[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $callable : callable
- $arguments : array<string|int, mixed> = []
containerMake()
create object through container
public
containerMake(string $className[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $className : string
- $arguments : array<string|int, mixed> = []
dropFlashMessages()
removes all currently stored flash messages
public
dropFlashMessages() : self
Return values
selfformSubmitted()
{@inheritdoc}
public
formSubmitted(Form $form, array<string|int, mixed> &$form_state) : mixed
Parameters
- $form : Form
- $form_state : array<string|int, mixed>
Tags
formValidate()
{@inheritdoc}
public
formValidate(Form $form, array<string|int, mixed> &$form_state) : bool|string
Parameters
- $form : Form
- $form_state : array<string|int, mixed>
Return values
bool|stringgetAccessPermission()
gets access permission name
public
static getAccessPermission() : string
Return values
stringgetApp()
gets app object
public
getApp() : App
Tags
Return values
AppgetAppRouteInfo()
gets route info
public
getAppRouteInfo() : RouteInfo|null
Return values
RouteInfo|nullgetAppWebsite()
gets current website
public
getAppWebsite() : Website|null
Return values
Website|nullgetAssets()
gets assets manager
public
getAssets() : Manager
Tags
Return values
ManagergetBaseTemplateData()
prepares basic template data
public
getBaseTemplateData() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getCache()
get cache manager
public
getCache() : Manager
Tags
Return values
ManagergetCacheKey()
gets cache key
public
getCacheKey() : string
Return values
stringgetContainer()
gets container object
public
getContainer() : ContainerInterface
Return values
ContainerInterfacegetControllerUrl()
gets current controller url
public
getControllerUrl() : string
Tags
Return values
stringgetCrudRouter()
gets crud service
public
getCrudRouter() : Crud
Tags
Return values
CrudgetCurrentLocale()
{@inheritdoc}
public
getCurrentLocale() : string
Tags
Return values
stringgetCurrentUser()
gets current user
public
getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
- $reset : bool = false
Tags
Return values
AccountModel|nullgetCurrentWebsite()
gets current website model
public
getCurrentWebsite() : Website|null
Tags
Return values
Website|nullgetCurrentWebsiteId()
gets current website id
public
getCurrentWebsiteId() : int|null
Tags
Return values
int|nullgetDb()
gets db object
public
getDb() : Database
Tags
Return values
DatabasegetDebugbar()
gets debugbar object
public
getDebugbar() : StandardDebugBar
Tags
Return values
StandardDebugBargetDestParam()
gets the destination param
public
getDestParam([null $destination_url = null ]) : string
Parameters
- $destination_url : null = null
Tags
Return values
stringgetEnv()
gets env variable
public
getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
- $variable : string
- $default : mixed = null
Tags
getEventManager()
gets events manager service
public
getEventManager() : SharedEventEmitter
Tags
Return values
SharedEventEmittergetFlashMessages()
gets currently stored flash messages
public
getFlashMessages([bool $direct = false ]) : array<string|int, mixed>|null
Parameters
- $direct : bool = false
-
session stored flash messages
Return values
array<string|int, mixed>|nullgetForm()
get form object
public
getForm() : Form|null
Return values
Form|nullgetFormDefinition()
{@inheritdoc}
public
getFormDefinition(Form $form, array<string|int, mixed> &$form_state) : Form
Parameters
- $form : Form
- $form_state : array<string|int, mixed>
Tags
Return values
FormgetFpcCacheKey()
gets fpc cache key
public
getFpcCacheKey() : string
Return values
stringgetGoogleAuthenticator()
gets google authenticator service
public
getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
Return values
PHPGangsta_GoogleAuthenticatorgetGuzzle()
gets guzzle service
public
getGuzzle() : Client
Tags
Return values
ClientgetHtmlRenderer()
gets html renderer service
public
getHtmlRenderer() : HtmlPartsRenderer
Tags
Return values
HtmlPartsRenderergetIcons()
gets icons service
public
getIcons() : Icons
Tags
Return values
IconsgetImagine()
gets imagine service
public
getImagine() : Imagine
Tags
Return values
ImaginegetInfo()
gets info about current page
public
getInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getLog()
gets log object
public
getLog() : Logger
Tags
Return values
LoggergetMailer()
gets mailer service
public
getMailer() : Mailer
Tags
Return values
MailergetObject()
gets object to show
public
getObject() : BaseModel|null
Return values
BaseModel|nullgetPageRouteName()
gets controller route name
public
static getPageRouteName() : string
Return values
stringgetPageTitle()
gets page title
public
getPageTitle() : string
Return values
stringgetPdo()
gets PDO object
public
getPdo() : PDO
Tags
Return values
PDOgetRedis()
gets redis service
public
getRedis() : Manager
Tags
Return values
ManagergetRequest()
get request object
public
getRequest() : Request
Return values
RequestgetRewrite()
gets Rewrite object for current page
public
getRewrite([bool $reset = false ]) : Rewrite|null
Parameters
- $reset : bool = false
Return values
Rewrite|nullgetRewriteObject()
gets rewrite object
public
getRewriteObject() : Rewrite|null
Return values
Rewrite|nullgetRouteGroup()
gets route group
public
static getRouteGroup() : string|null
Return values
string|nullgetRouteInfo()
get route_info
public
getRouteInfo() : RouteInfo|null
Return values
RouteInfo|nullgetRouteName()
gets current route name
public
getRouteName() : string
Return values
stringgetRoutePath()
return route path
public
static getRoutePath() : string
Return values
stringgetRouters()
gets routers
public
getRouters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getRouteVerbs()
returns valid route HTTP verbs
public
static getRouteVerbs() : array<string|int, mixed>
Return values
array<string|int, mixed>getSchema()
gets schema object
public
getSchema() : Schema
Tags
Return values
SchemagetSearch()
gets search service
public
getSearch() : Manager
Tags
Return values
ManagergetSesMailer()
gets SES mailer service
public
getSesMailer() : SesClient
Tags
Return values
SesClientgetSiteData()
gets site data service
public
getSiteData() : SiteData
Tags
Return values
SiteDatagetSmtpMailer()
gets SMTP mailer service
public
getSmtpMailer() : Swift_Mailer
Tags
Return values
Swift_MailergetTemplate()
get current template
public
getTemplate() : Template|null
Return values
Template|nullgetTemplateData()
gets current page template data
public
getTemplateData() : array<string|int, mixed>
Return values
array<string|int, mixed>getTemplateName()
gets current page template name
public
getTemplateName() : string
Return values
stringgetTemplates()
gets plates engine object
public
getTemplates() : Engine
Tags
Return values
EnginegetTranslations()
{@inheritdoc}
public
getTranslations() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getTranslator()
gets translator
public
getTranslator([string|null $locale_code = null ]) : Translator
Parameters
- $locale_code : string|null = null
Tags
Return values
TranslatorgetUrl()
gets url by route_name and params
public
getUrl(string $route_name[, array<string|int, mixed> $route_params = [] ]) : string
Parameters
- $route_name : string
- $route_params : array<string|int, mixed> = []
Tags
Return values
stringgetUtils()
gets global utils service
public
getUtils() : Globals
Tags
Return values
GlobalsgetWebhooksRouter()
gets webhooks service
public
getWebhooksRouter() : Webhooks
Tags
Return values
WebhooksgetWebRouter()
gets routing service
public
getWebRouter() : Web
Tags
Return values
WebgetZip()
gets zip service
public
getZip() : Zip
Tags
Return values
ZiphasLoggedUser()
checks if user is logged in
public
hasLoggedUser() : bool
Tags
Return values
boolisEnabled()
determines if route is available for router
public
static isEnabled() : bool
Return values
boolisHomePage()
checks if current is homepage
public
isHomePage() : bool
Tags
Return values
boolprocess()
controller action
public
process([RouteInfo|null $route_info = null ][, array<string|int, mixed> $route_data = [] ]) : Response
Parameters
- $route_info : RouteInfo|null = null
- $route_data : array<string|int, mixed> = []
Tags
Return values
ResponserenderPage()
controller entrypoint
public
renderPage([RouteInfo|null $route_info = null ][, array<string|int, mixed> $route_data = [] ]) : BasePage|Response
Parameters
- $route_info : RouteInfo|null = null
- $route_data : array<string|int, mixed> = []
Tags
Return values
BasePage|ResponserequestUrl()
executes an http request
public
requestUrl(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : string|bool
Parameters
- $url : string
- $method : string = 'GET'
- $options : array<string|int, mixed> = []
Tags
Return values
string|boolsetRouteInfo()
set route info
public
setRouteInfo(RouteInfo $routeInfo) : BasePage
Parameters
- $routeInfo : RouteInfo
Return values
BasePageshowBlocks()
show blocks flag.
public
showBlocks() : bool
utility function, subclasses can override this method to disable blocks load
Return values
boolshowMenu()
show menu flag.
public
showMenu() : bool
utility function, subclasses can override this method to disable menu load
Return values
booltokenIsActive()
checks if token is still active
public
tokenIsActive(Token $token) : bool
Parameters
- $token : Token
Return values
booladdSubmitButton()
adds submit button to form
protected
addSubmitButton(Form $form[, bool $inline_button = false ][, mixed $isConfirmation = false ]) : Form
Parameters
- $form : Form
- $inline_button : bool = false
- $isConfirmation : mixed = false
Tags
Return values
FormalterTemplateName()
eventually alters template name
protected
alterTemplateName(string $templateName) : string
Parameters
- $templateName : string
Tags
Return values
stringbeforeRender()
{@intheritdocs}
protected
beforeRender() : Response|self
Tags
Return values
Response|selfcheck2FA()
protected
check2FA() : bool
Return values
boolcheckCredentials()
checks user credentials
protected
checkCredentials() : bool
Tags
Return values
booldoRedirect()
returns a redirect object
protected
doRedirect(mixed $url[, array<string|int, mixed> $additional_headers = [] ]) : RedirectResponse
Parameters
- $url : mixed
- $additional_headers : array<string|int, mixed> = []
Return values
RedirectResponsefillConfirmationForm()
gets a form for confirmation
protected
fillConfirmationForm(string $confirm_message, Form $form[, null $cancel_url = null ]) : Form
Parameters
- $confirm_message : string
- $form : Form
- $cancel_url : null = null
Tags
Return values
FormgetFormId()
gets form id
protected
getFormId() : string
Return values
stringgetRegionTags()
get page region tags html
protected
getRegionTags(string $region) : bool|string
Parameters
- $region : string
Return values
bool|stringgetResponse()
get response object
protected
getResponse() : Response
Return values
ResponsegetRouteData()
gets route data
protected
getRouteData([null $var_name = null ]) : mixed
Parameters
- $var_name : null = null
getSecret()
protected
getSecret(User $user) : string
Parameters
- $user : User
Return values
stringgetService()
gets registered service
protected
getService(string $service_key) : mixed
Parameters
- $service_key : string
Tags
getTokenData()
gets token data
protected
getTokenData() : mixed
isSubmitted()
check if form is submitted
protected
isSubmitted() : bool
Return values
boolnormalizeCacheKey()
protected
normalizeCacheKey(mixed $key) : string
Parameters
- $key : mixed
Return values
stringprepareTemplate()
prepare template object
protected
prepareTemplate() : Template
Tags
Return values
TemplateprocessFormSubmit()
process form submission
protected
processFormSubmit() : void
Tags
refreshPage()
returns a redirect object to same page
protected
refreshPage() : RedirectResponse
Return values
RedirectResponsesetObject()
sets object to show
protected
setObject(BaseModel $object) : self
Parameters
- $object : BaseModel