|
Ubiquity 2.5.2
php rapid development framework
|
Inheritance diagram for AuthController:Public Member Functions | ||||
| __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.} | ||||
| initialize () | ||||
| {Method called before 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) | ||||
| _init () | ||||
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) | ||||
| _getBodySelector () | ||||
| _getBaseRoute () | ||||
| _getLoginInputName () | ||||
| message ($type, $header, $body, $icon='info', $id=null) | ||||
| newAccountCreationRule () | ||||
Public Member Functions inherited from AuthControllerVariablesTrait | ||||
| _displayInfoAsString () | ||||
| Override to define if user info is displayed as string. | ||||
| _getUserSessionKey () | ||||
| To override for defining user session key, default : "activeUser". | ||||
| _checkConnectionTimeout () | ||||
| _getLoginInputName () | ||||
| _getPasswordInputName () | ||||
| _getBodySelector () | ||||
| Returns the body selector (jquery selector used for replacing the content of the page). | ||||
Public Member Functions inherited from AuthControllerOverrideTrait | ||||
| _getUserSessionKey () | ||||
| _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 | ||||
| _getBodySelector () | ||||
| _getUserSessionKey () | ||||
| bad2FACode () | ||||
| @noRoute | ||||
| confirm () | ||||
| @noRoute | ||||
| submitCode () | ||||
| Submits the 2FA code in post request. | ||||
| sendNew2FACode () | ||||
Public Member Functions inherited from AuthAccountCreationTrait | ||||
| _getPasswordInputName () | ||||
| _getLoginInputName () | ||||
| _getBodySelector () | ||||
| 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 | ||||
| _getBodySelector () | ||||
| _getPasswordInputName () | ||||
| recoveryInit () | ||||
| recoveryInfo () | ||||
| recovery (string $key, string $hashMail) | ||||
| recoverySubmit () | ||||
Protected Member Functions | |
| finalizeAuth () | |
| initializeAuth () | |
Protected Member Functions inherited from AuthControllerCoreTrait | |
| attemptsTimeout () | |
| getFiles () | |
| _newAccountCreationRule (string $accountName) | |
| hasAccountCreation () | |
| hasAccountRecovery () | |
| canCreateAccountMessage (FlashMessage $fMessage) | |
| getAccountRecoveryLink () | |
| getBaseUrl () | |
| useAjax () | |
| 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. | |
| attemptsNumber () | |
| To override Returns int the maximum number of allowed login attempts. | |
| attemptsTimeout () | |
| To override Returns the time before trying to connect again Effective only if attemptsNumber return a number. | |
| loginLabel () | |
| passwordLabel () | |
| passwordConfLabel () | |
| rememberCaption () | |
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=[]) | |
| useAjax () | |
| 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...) | |
| getTokenSize () | |
| To override Returns the default size for generated tokens. | |
| generate2FACode () | |
| Generates a new random 2FA code. | |
| towFACodePrefix () | |
| Returns the code prefix (which should not be entered by the user). | |
| 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) | |
| useAjax () | |
| authLoadView ($viewName, $vars=[]) | |
| rememberCaption () | |
| loginLabel () | |
| passwordConfLabel () | |
| passwordLabel () | |
| _getFiles () | |
| hasAccountCreation () | |
| Returns true for account creation. | |
| 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=[]) | |
| useAjax () | |
| passwordConfLabel () | |
| passwordLabel () | |
| validateEmail (string $mail) | |
| hasAccountRecovery () | |
| 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. | |
| recoveryAccountCaption () | |
| Returns the recovery account link caption. | |
| 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 | |
| $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' |
Definition at line 26 of file AuthController.php.
| __construct | ( | $instance = null | ) |
Definition at line 43 of file AuthController.php.
| _addAjaxBehavior | ( | JsUtils | $jquery = null, |
$ajaxParameters = ['hasLoader'=>'$(this).children(".button")','historize'=>false,'listenerOn'=>'body'] |
|||
| ) |
Definition at line 311 of file AuthController.php.
| _addFrmAjaxBehavior | ( | $id | ) |
Reimplemented from AuthAccountCreationTrait.
Definition at line 317 of file AuthController.php.
| _autoConnect | ( | ) |
Auto connect the user.
Definition at line 239 of file AuthController.php.
| _disConnected | ( | ) |
Definition at line 184 of file AuthController.php.
| _forward | ( | $url, | |
$initialize = null, |
|||
$finalize = null |
|||
| ) |
| string | $url |
Definition at line 301 of file AuthController.php.
| _init | ( | ) |
Reimplemented in AuthControllerConfig.
Definition at line 324 of file AuthController.php.
| _setLoginCaption | ( | $_loginCaption | ) |
| string | $_loginCaption |
Definition at line 232 of file AuthController.php.
| _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> !".
| string | $content | |
| string | $title | |
| string | $type | |
| string | $icon |
Definition at line 224 of file AuthController.php.
| badLogin | ( | ) |
Default Action for invalid creditentials.
@noRoute()
Reimplemented from AuthControllerOverrideTrait.
Definition at line 147 of file AuthController.php.
| checkConnection | ( | ) |
Definition at line 210 of file AuthController.php.
| connect | ( | ) |
Override to implement the complete connection procedure.
Definition at line 114 of file AuthController.php.
| finalize | ( | ) |
{Method called after each action Can be override in derived class.}
Reimplemented from Controller.
Definition at line 262 of file AuthController.php.
|
protected |
Reimplemented from Auth2FATrait.
Definition at line 274 of file AuthController.php.
| forgetConnection | ( | ) |
Deletes the cookie for auto connection and returns to index.
Definition at line 252 of file AuthController.php.
| index | ( | ) |
| info | ( | $force = null | ) |
Action displaying the logged user information if _displayInfoAsString returns true, use _infoUser var in views to display user info.
| null | boolean | $force |
Exception
Reimplemented from AuthAccountRecoveryTrait.
Definition at line 201 of file AuthController.php.
| initialize | ( | ) |
{Method called before each action Can be override in derived class.}
Reimplemented from Controller.
Reimplemented in AuthControllerConfig.
Definition at line 285 of file AuthController.php.
|
protected |
Reimplemented from Auth2FATrait.
Definition at line 291 of file AuthController.php.
|
final |
{Returns True if access to the controller is allowed To be override in sub classes.
| string | $action |
Reimplemented from Controller.
Definition at line 81 of file AuthController.php.
| noAccess | ( | $urlParts | ) |
Action called when the user does not have access rights to a requested resource.
| array | string | $urlParts |
Definition at line 90 of file AuthController.php.
| terminate | ( | ) |
Logout action Terminate the session and display a logout message.
Definition at line 176 of file AuthController.php.
|
protected |
Definition at line 34 of file AuthController.php.
|
protected |
Definition at line 35 of file AuthController.php.
|
protected |
Definition at line 38 of file AuthController.php.
|
protected |
Definition at line 40 of file AuthController.php.
|
protected |
Definition at line 33 of file AuthController.php.
|
protected |
Definition at line 39 of file AuthController.php.
|
protected |
Definition at line 41 of file AuthController.php.
|
protected |
Definition at line 37 of file AuthController.php.
|
protected |
Definition at line 36 of file AuthController.php.
|
protected |
Definition at line 32 of file AuthController.php.