Ubiquity 2.5.2
php rapid development framework
|
Ubiquity\controllers\auth$AuthControllerConfig This class is part of Ubiquity. More...
Public Member Functions | ||||
initialize () | ||||
{{Method called before each action Can be override in derived class.}
| ||||
_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.
| ||||
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 () | ||||
Public Member Functions inherited from AuthAccountCreationTrait | ||||
checkEmail (string $key, string $hashMail) | ||||
Route for email validation checking when creating a new account. | ||||
addAccount () | ||||
Displays the account creation form. | ||||
createAccount () | ||||
Submit for a new account creation. | ||||
Public Member Functions inherited from AuthAccountRecoveryTrait | ||||
recoveryInit () | ||||
recoveryInfo () | ||||
recovery (string $key, string $hashMail) | ||||
recoverySubmit () | ||||
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 Member Functions inherited from AuthAccountCreationTrait | |
getBaseUrl () | |
fMessage (FlashMessage $fMessage, $id=null) | |
authLoadView ($viewName, $vars=[]) | |
_getFiles () | |
hasEmailValidation () | |
emailValidationDuration () | |
Returns the default validity duration of a mail validation link. | |
createAccountMessage (FlashMessage $fMessage) | |
To override for modifying the account creation message. | |
canCreateAccountMessage (FlashMessage $fMessage) | |
To override for modifying the account creation message information. | |
createAccountErrorMessage (FlashMessage $fMessage) | |
To override for modifying the error for account creation. | |
emailValidationSuccess (FlashMessage $fMessage) | |
To override Displayed when email is valid. | |
emailValidationError (FlashMessage $fMessage) | |
To override Displayed when email is invalid or if an error occurs. | |
_create (string $login, string $password) | |
To override For creating a new user account. | |
_newAccountCreationRule (string $accountName) | |
To override Returns true if the creation of $accountName is possible. | |
_sendEmailValidation (string $email, string $validationURL, string $expire) | |
Sends an email for email checking. | |
getEmailFromNewAccount ($account) | |
To override Returns the email from an account object. | |
getAuthTokensEmailValidation () | |
To override Returns the AuthTokens instance used for tokens generation when sending an email for the account creation. | |
generateEmailValidationUrl ($email) | |
prepareEmailValidation (string $email) | |
validateEmail (string $mail) | |
To override Checks an email. | |
Protected Member Functions inherited from AuthAccountRecoveryTrait | |
fMessage (FlashMessage $fMessage, $id=null) | |
_getFiles () | |
getBaseUrl () | |
authLoadView ($viewName, $vars=[]) | |
validateEmail (string $mail) | |
recoveryInitMessage (FlashMessage $fMessage) | |
To override Displayed when an account recovery operation is initiated. | |
recoveryEmailSendMessage (FlashMessage $fMessage) | |
To override Displayed when email is sent for a recovery account operation. | |
recoveryEmailErrorMessage (FlashMessage $fMessage) | |
To override Displayed when email is not associated with an existing account. | |
resetPasswordSuccessMessage (FlashMessage $fMessage) | |
To override Displayed when a new password is set with recovery account. | |
resetPasswordErrorMessage (FlashMessage $fMessage) | |
To override Displayed when an error occurs when a new password is set with recovery account. | |
emailAccountRecoverySuccess (FlashMessage $fMessage) | |
To override Displayed when the account recovery link is valid. | |
emailAccountRecoveryError (FlashMessage $fMessage) | |
To override Displayed when the account recovery link is not valid. | |
accountRecoveryDuration () | |
Returns the default validity duration for an email account recovery. | |
getAuthTokensAccountRecovery () | |
To override Returns the AuthTokens instance used for tokens generation for a recovery account. | |
isValidEmailForRecovery (string $email) | |
To override Checks if a valid account matches this email. | |
_sendEmailAccountRecovery (string $email, string $validationURL, string $expire) | |
Sends an email for account recovery (password reset). | |
passwordResetAction (string $email, string $newPasswordHash) | |
To override Changes the active password associated with the account corresponding to this email. | |
getAccountRecoveryLink () | |
generateEmailAccountRecoveryUrl ($email) | |
prepareEmailAccountRecovery (string $email) | |
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 | |
Static Protected Attributes inherited from AuthAccountCreationTrait | |
static string | $TOKENS_VALIDATE_EMAIL ='email.validation' |
Static Protected Attributes inherited from AuthAccountRecoveryTrait | |
static string | $TOKENS_RECOVERY_ACCOUNT ='account.recovery' |
Ubiquity\controllers\auth$AuthControllerConfig This class is part of Ubiquity.
Definition at line 16 of file AuthControllerConfig.php.
_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 | ( | ) |
Reimplemented from AuthControllerCoreTrait.
Definition at line 72 of file AuthControllerConfig.php.
_getLoginInputName | ( | ) |
Reimplemented from AuthControllerCoreTrait.
Definition at line 52 of file AuthControllerConfig.php.
_getPasswordInputName | ( | ) |
Reimplemented from AuthControllerVariablesTrait.
Definition at line 60 of file AuthControllerConfig.php.
_getUserSessionKey | ( | ) |
To override for defining user session key, default : "activeUser".
Reimplemented from AuthControllerVariablesTrait.
Definition at line 40 of file AuthControllerConfig.php.
_init | ( | ) |
Reimplemented from AuthController.
Definition at line 25 of file AuthControllerConfig.php.
|
protected |
To override Returns int the maximum number of allowed login attempts.
Reimplemented from AuthControllerVariablesTrait.
Definition at line 36 of file AuthControllerConfig.php.
attemptsTimeout | ( | ) |
Reimplemented from AuthControllerCoreTrait.
Definition at line 44 of file AuthControllerConfig.php.
|
abstractprotected |
|
protected |
To override Returns the default size for generated tokens.
Reimplemented from Auth2FATrait.
Definition at line 80 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerCoreTrait.
Definition at line 88 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerCoreTrait.
Definition at line 92 of file AuthControllerConfig.php.
|
static |
Definition at line 100 of file AuthControllerConfig.php.
initialize | ( | ) |
{{Method called before each action Can be override in derived class.}
Reimplemented from AuthController.
Definition at line 20 of file AuthControllerConfig.php.
loginLabel | ( | ) |
Reimplemented from AuthControllerVariablesTrait.
Definition at line 56 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerVariablesTrait.
Definition at line 68 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerVariablesTrait.
Definition at line 64 of file AuthControllerConfig.php.
|
protected |
Returns the recovery account link caption.
Default : Forgot your password?
Reimplemented from AuthAccountRecoveryTrait.
Definition at line 96 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerVariablesTrait.
Definition at line 76 of file AuthControllerConfig.php.
|
protected |
Returns the code prefix (which should not be entered by the user).
Reimplemented from Auth2FATrait.
Definition at line 84 of file AuthControllerConfig.php.
|
protected |
Reimplemented from AuthControllerCoreTrait.
Definition at line 32 of file AuthControllerConfig.php.
|
protected |
Definition at line 18 of file AuthControllerConfig.php.