Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AuthControllerConfig Class Reference

Ubiquity\controllers\auth$AuthControllerConfig This class is part of Ubiquity. More...

+ Inheritance diagram for AuthControllerConfig:

Public Member Functions

 initialize ()
 {{Method called before each action Can be override in derived class.}
See also
\Ubiquity\controllers\ControllerBaseinitialize()
}
 
 _init ()
 
 _getUserSessionKey ()
 To override for defining user session key, default : "activeUser".
 
 attemptsTimeout ()
 
 _displayInfoAsString ()
 Override to define if user info is displayed as string.
 
 _getLoginInputName ()
 
 loginLabel ()
 
 _getPasswordInputName ()
 
 _getBodySelector ()
 
- Public Member Functions inherited from AuthController
 __construct ($instance=null)
 
 index ()
 Default action.
 
 isValid ($action)
 {Returns True if access to the controller is allowed To be override in sub classes.
Parameters
string$action
Returns
boolean
}
 
 noAccess ($urlParts)
 Action called when the user does not have access rights to a requested resource.
 
 connect ()
 Override to implement the complete connection procedure.
 
 badLogin ()
 Default Action for invalid creditentials.
 
 terminate ()
 Logout action Terminate the session and display a logout message.
 
 _disConnected ()
 
 info ($force=null)
 Action displaying the logged user information if _displayInfoAsString returns true, use _infoUser var in views to display user info.
 
 checkConnection ()
 
 _setNoAccessMsg ($content, $title=NULL, $type=NULL, $icon=null)
 Sets the default noAccess message Default : "You are not authorized to access the page <b>{url}</b> !".
 
 _setLoginCaption ($_loginCaption)
 
 _autoConnect ()
 Auto connect the user.
 
 forgetConnection ()
 Deletes the cookie for auto connection and returns to index.
 
 finalize ()
 {Method called after each action Can be override in derived class.}
 
 _forward ($url, $initialize=null, $finalize=null)
 
 _addAjaxBehavior (JsUtils $jquery=null, $ajaxParameters=['hasLoader'=> '$(this).children(".button")', 'historize'=>false, 'listenerOn'=> 'body'])
 
 _addFrmAjaxBehavior ($id)
 
- Public Member Functions inherited from Controller
 __construct ()
 Constructor initialize $view variable.
 
 loadView (string $viewName, $pData=null, bool $asString=false)
 Loads the view $viewName possibly passing the variables $pdata.
 
 loadDefaultView ($pData=null, bool $asString=false)
 Loads the default view (controllerName/actionName) possibly passing the variables $pdata.
 
 getDefaultViewName ()
 Returns the default view name for this controller/action i.e ControllerName/actionName.html for the action actionName in ControllerName If there is an activeTheme @activeTheme/ControllerName/actionName.html
 
 onInvalidControl ()
 Called if isValid () returns false To be override in sub classes.
 
 forward (string $controller, string $action='index', $params=[], bool $initialize=false, bool $finalize=false)
 Loads the controller $controller and calls its $action method by passing the parameters $params.
 
 redirectToRoute (string $routeName, $parameters=[], bool $initialize=false, bool $finalize=false)
 Redirect to a route by its name.
 
 getView ()
 Returns the associated view instance.
 
- Public Member Functions inherited from AuthControllerCoreTrait
 loadView (string $viewName, $pData=NULL, bool $asString=false)
 
 _getBaseRoute ()
 
 message ($type, $header, $body, $icon='info', $id=null)
 
 newAccountCreationRule ()
 
- Public Member Functions inherited from AuthControllerVariablesTrait
 _checkConnectionTimeout ()
 
- Public Member Functions inherited from AuthControllerOverrideTrait
 _getBaseRoute ()
 To override Return the base route for this Auth controller.
 
 _getActiveUser ()
 To override for getting active user, default : USession::get("activeUser")
 
 _isValidUser ($action=null)
 Checks if user is valid for the action.
 
- Public Member Functions inherited from InsertJqueryTrait
 _insertJquerySemantic ()
 
- Public Member Functions inherited from Auth2FATrait
 bad2FACode ()
 @noRoute
 
 confirm ()
 @noRoute
 
 submitCode ()
 Submits the 2FA code in post request.
 
 sendNew2FACode ()
 

Static Public Member Functions

static init (?string $name=null,?array $config=null)
 

Protected Member Functions

 getConfigFilename ()
 
 useAjax ()
 
 attemptsNumber ()
 To override Returns int the maximum number of allowed login attempts.
 
 passwordLabel ()
 
 passwordConfLabel ()
 
 rememberCaption ()
 
 getTokenSize ()
 To override Returns the default size for generated tokens.
 
 towFACodePrefix ()
 Returns the code prefix (which should not be entered by the user).
 
 hasAccountCreation ()
 
 hasAccountRecovery ()
 
 recoveryAccountCaption ()
 Returns the recovery account link caption.
 
- Protected Member Functions inherited from AuthController
 finalizeAuth ()
 
 initializeAuth ()
 
- Protected Member Functions inherited from AuthControllerCoreTrait
 getFiles ()
 
 _newAccountCreationRule (string $accountName)
 
 canCreateAccountMessage (FlashMessage $fMessage)
 
 getAccountRecoveryLink ()
 
 getBaseUrl ()
 
 fMessage (FlashMessage $fMessage, $id=null)
 
 noAttempts ()
 
 authLoadView ($viewName, $vars=[])
 
 getOriginalURL ()
 
 _getFiles ()
 
 getViewVars ($viewname)
 
 addAccountCreationViewData (array &$vData, $forMessage=false)
 
- Protected Member Functions inherited from AuthControllerVariablesTrait
 noAccessMessage (FlashMessage $fMessage)
 Override for modifying the noAccess message.
 
 attemptsNumberMessage (FlashMessage $fMessage, $attempsCount)
 Override for modifying attempts message You can use {_timer} and {_attemptsCount} variables in message content.
 
 badLoginMessage (FlashMessage $fMessage)
 To override for modifying the bad login message.
 
 terminateMessage (FlashMessage $fMessage)
 To override for modifying the logout message.
 
 disconnectedMessage (FlashMessage $fMessage)
 To override for modifying the disconnect message.
 
- Protected Member Functions inherited from AuthControllerOverrideTrait
 _connect ()
 Processes the data posted by the login form Have to return the connected user instance.
 
 onConnect ($connected)
 
 onBadCreditentials ()
 To override for defining a new action when creditentials are invalid.
 
 toCookie ($connected)
 Returns the value from connected user to save it in the cookie for auto connection.
 
 fromCookie ($cookie)
 Loads the user from database using the cookie value.
 
 rememberMe ($connected)
 Saves the connected user identifier in a cookie.
 
 getCookieUser ()
 Returns the cookie for auto connection.
 
 getFiles ()
 To override for changing view files.
 
- Protected Member Functions inherited from Auth2FATrait
 fMessage (FlashMessage $fMessage, $id=null)
 
 _getFiles ()
 
 getBaseUrl ()
 
 authLoadView ($viewName, $vars=[])
 
 onConnect ($connected)
 
 has2FA ($accountValue=null)
 To override Returns true for a two factor authentification for this account.
 
 onBad2FACode ()
 To override for defining a new action when 2FA code is invalid.
 
 _send2FACode (string $code, $connected)
 To override Send the 2FA code to the user (email, sms, phone call...)
 
 generate2FACode ()
 Generates a new random 2FA code.
 
 twoFACodeDuration ()
 Returns the default validity duration of a generated 2FA code.
 
 twoFAMessage (FlashMessage $fMessage)
 To override for modifying the 2FA panel message.
 
 newTwoFACodeMessage (FlashMessage $fMessage)
 To override.
 
 twoFABadCodeMessage (FlashMessage $fMessage)
 To override for modifying the message displayed if the 2FA code is bad.
 
 check2FACode (string $secret, string $userInput)
 To override for a more secure 2FA code.
 
 save2FACode ()
 
 send2FACode ()
 

Protected Attributes

array $config
 
- Protected Attributes inherited from AuthController
 $authFiles
 
 $_controller
 
 $_action
 
 $_actionParams
 
 $_noAccessMsg
 
 $_loginCaption
 
 $_attemptsSessionKey = '_attempts'
 
 $_controllerInstance
 
 $_compileJS = true
 
 $_invalid =false
 
- Protected Attributes inherited from Controller
View $view
 

Additional Inherited Members

- Data Fields inherited from InsertJqueryTrait
 $jquery
 

Detailed Description

Ubiquity\controllers\auth$AuthControllerConfig This class is part of Ubiquity.

Author
jc
Version
1.0.0

Definition at line 16 of file AuthControllerConfig.php.

Member Function Documentation

◆ _displayInfoAsString()

_displayInfoAsString ( )

Override to define if user info is displayed as string.

If set to true, use {{ _infoUser| raw }} in views to display user info. Remember to use $this->jquery->renderView instead of $this->loadView for the javascript generation.

Reimplemented from AuthControllerVariablesTrait.

Definition at line 48 of file AuthControllerConfig.php.

◆ _getBodySelector()

_getBodySelector ( )

Reimplemented from AuthControllerCoreTrait.

Definition at line 72 of file AuthControllerConfig.php.

◆ _getLoginInputName()

_getLoginInputName ( )

Reimplemented from AuthControllerCoreTrait.

Definition at line 52 of file AuthControllerConfig.php.

◆ _getPasswordInputName()

_getPasswordInputName ( )

Reimplemented from AuthControllerVariablesTrait.

Definition at line 60 of file AuthControllerConfig.php.

◆ _getUserSessionKey()

_getUserSessionKey ( )

To override for defining user session key, default : "activeUser".

Returns
string

Reimplemented from AuthControllerVariablesTrait.

Definition at line 40 of file AuthControllerConfig.php.

◆ _init()

_init ( )

Reimplemented from AuthController.

Definition at line 25 of file AuthControllerConfig.php.

◆ attemptsNumber()

attemptsNumber ( )
protected

To override Returns int the maximum number of allowed login attempts.

Reimplemented from AuthControllerVariablesTrait.

Definition at line 36 of file AuthControllerConfig.php.

◆ attemptsTimeout()

attemptsTimeout ( )

Reimplemented from AuthControllerCoreTrait.

Definition at line 44 of file AuthControllerConfig.php.

◆ getConfigFilename()

getConfigFilename ( )
abstractprotected

◆ getTokenSize()

getTokenSize ( )
protected

To override Returns the default size for generated tokens.

Returns
int

Reimplemented from Auth2FATrait.

Definition at line 80 of file AuthControllerConfig.php.

◆ hasAccountCreation()

hasAccountCreation ( )
protected

Reimplemented from AuthControllerCoreTrait.

Definition at line 88 of file AuthControllerConfig.php.

◆ hasAccountRecovery()

hasAccountRecovery ( )
protected

Reimplemented from AuthControllerCoreTrait.

Definition at line 92 of file AuthControllerConfig.php.

◆ init()

static init ( ?string  $name = null,
?array  $config = null 
)
static

Definition at line 100 of file AuthControllerConfig.php.

◆ initialize()

initialize ( )

{{Method called before each action Can be override in derived class.}

See also
\Ubiquity\controllers\ControllerBaseinitialize()
}

See also
\Ubiquity\controllers\ControllerBase::initialize()

Reimplemented from AuthController.

Definition at line 20 of file AuthControllerConfig.php.

◆ loginLabel()

loginLabel ( )

Reimplemented from AuthControllerVariablesTrait.

Definition at line 56 of file AuthControllerConfig.php.

◆ passwordConfLabel()

passwordConfLabel ( )
protected

Reimplemented from AuthControllerVariablesTrait.

Definition at line 68 of file AuthControllerConfig.php.

◆ passwordLabel()

passwordLabel ( )
protected

Reimplemented from AuthControllerVariablesTrait.

Definition at line 64 of file AuthControllerConfig.php.

◆ recoveryAccountCaption()

recoveryAccountCaption ( )
protected

Returns the recovery account link caption.

Default : Forgot your password?

Returns
string

Reimplemented from AuthAccountRecoveryTrait.

Definition at line 96 of file AuthControllerConfig.php.

◆ rememberCaption()

rememberCaption ( )
protected

Reimplemented from AuthControllerVariablesTrait.

Definition at line 76 of file AuthControllerConfig.php.

◆ towFACodePrefix()

towFACodePrefix ( )
protected

Returns the code prefix (which should not be entered by the user).

Returns
string

Reimplemented from Auth2FATrait.

Definition at line 84 of file AuthControllerConfig.php.

◆ useAjax()

useAjax ( )
protected

Reimplemented from AuthControllerCoreTrait.

Definition at line 32 of file AuthControllerConfig.php.

Field Documentation

◆ $config

array $config
protected

Definition at line 18 of file AuthControllerConfig.php.


The documentation for this class was generated from the following file: