Methods summary
public
integer
|
#
GetExpirationIdentity( )
Get expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
Get expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
Returns
integer
|
public
integer
|
#
GetExpirationAuthorization( )
Get expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
Get expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
Returns
integer
|
public
string
|
#
GetUserClass( )
Get full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\User .
Get full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\User .
Returns
string
|
public
string
|
#
GetRoleClass( )
Get full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Role .
Get full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Role .
Returns
string
|
public
string
|
#
GetControllerClass( )
Get full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Controller .
Get full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Controller .
Returns
string
|
public
string
|
#
GetSignInFormClass( )
Get full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignInForm .
Get full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignInForm .
Returns
string
|
public
string
|
#
GetSignOutFormClass( )
Full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignOutForm .
Full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignOutForm .
Returns
string
|
public
string|null
|
#
GetSignedInUrl( )
Get full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
Get full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
Returns
string|null
|
public
string|null
|
#
GetSignedOutUrl( )
Get full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
Get full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
Returns
string|null
|
public
string|null
|
#
GetSignErrorUrl( string $signErrorUrl,… )
Get full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
Get full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
Parameters
Returns
string|null
|
public
MvcCore\Route
|
#
GetSignInRoute( )
Get route instance to submit sign in form into.
Default configured route for sign in request is /signin by POST.
Get route instance to submit sign in form into.
Default configured route for sign in request is /signin by POST.
Returns
|
public
MvcCore\Route
|
#
GetSignOutRoute( )
Get route to submit sign out form into.
Default configured route for sign in request is /signout by POST.
Get route to submit sign out form into.
Default configured route for sign in request is /signout by POST.
Returns
|
public
string|null
|
#
GetPasswordHashSalt( )
Get configured salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
Get configured salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
Returns
string|null
|
public
integer
|
#
GetInvalidCredentialsTimeout( )
Get timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
Get timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
Returns
integer
|
public
callable|null
|
#
GetTranslator( )
Get configured callable translator to set it into authentication form
to translate form labels, placeholders, buttons or error messages.
Default value is NULL (forms without translations).
Get configured callable translator to set it into authentication form
to translate form labels, placeholders, buttons or error messages.
Default value is NULL (forms without translations).
Returns
callable|null
|
public
MvcCore\Ext\Auths\Basics\User |null
|
#
GetUser( )
Get authenticated user model instance reference
or NULL if user has no username record in session namespace.
If user has not yet been initialized, load the user internally by
{$configuredUserClass}::SetUpUserBySession(); to try to load
user by username record in session namespace.
Get authenticated user model instance reference
or NULL if user has no username record in session namespace.
If user has not yet been initialized, load the user internally by
{$configuredUserClass}::SetUpUserBySession(); to try to load
user by username record in session namespace.
Returns
|
public
boolean
|
#
IsAuthenticated( )
Return TRUE if user is authenticated/signed in,
TRUE if user has any username record in session namespace.
If user has not yet been initialized, load the user internally by
$auth->GetUser(); to try to load user by username record in session namespace.
Return TRUE if user is authenticated/signed in,
TRUE if user has any username record in session namespace.
If user has not yet been initialized, load the user internally by
$auth->GetUser(); to try to load user by username record in session namespace.
Returns
boolean
|
public
|
#
GetForm( )
Return completed sign in or sign out form instance.
Form instance completion is processed only once,
any created form instance is stored in $auth->form property.
This method is always called by you, your application
to set form into you custom template to render it for user.
If user is not authenticated, sign in form is returned and
if user is authenticated, opposite sign out form is returned.
This method is only alias to call two other methods:
- \MvcCore\Ext\Auths\Basic::GetInstance()->GetSignInForm(); for not authenticated users.
- \MvcCore\Ext\Auths\Basic::GetInstance()->GetSignOutForm(); for authenticated users.
Return completed sign in or sign out form instance.
Form instance completion is processed only once,
any created form instance is stored in $auth->form property.
This method is always called by you, your application
to set form into you custom template to render it for user.
If user is not authenticated, sign in form is returned and
if user is authenticated, opposite sign out form is returned.
This method is only alias to call two other methods:
- \MvcCore\Ext\Auths\Basic::GetInstance()->GetSignInForm(); for not authenticated users.
- \MvcCore\Ext\Auths\Basic::GetInstance()->GetSignOutForm(); for authenticated users.
Var
\MvcCore\Ext\Auths\Basics\SignInForm|\MvcCore\Ext\Auths\Basics\SignOutForm
|
public
MvcCore\Ext\Auths\Basics\SignInForm
|
#
GetSignInForm( )
Return completed sign in form instance.
Form instance completion is processed only once,
created form instance is stored in $auth->form property.
Return completed sign in form instance.
Form instance completion is processed only once,
created form instance is stored in $auth->form property.
Returns
|
public
MvcCore\Ext\Auths\Basics\SignOutForm
|
#
GetSignOutForm( )
Return completed sign out form instance.
Form instance completion is processed only once,
created form instance is stored in $auth->form property.
Return completed sign out form instance.
Form instance completion is processed only once,
created form instance is stored in $auth->form property.
Returns
|
public
array
|
#
GetConfiguration( )
Return array with all protected configuration properties.
Return array with all protected configuration properties.
Returns
array
|
public
MvcCore\Ext\Auths\Basic
|
#
SetExpirationIdentity( integer $identityExpirationSeconds = 2592000 )
Set expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
Set expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
Parameters
- $identityExpirationSeconds
- $expirationIdentity
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetExpirationAuthorization( $authorizationExpirationSeconds = 600 )
Set expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
Set expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetUserClass( string $userClass = '' )
Set full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\User .
Set full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\User .
Parameters
- $userClass
- User full class name implementing
\MvcCore\Ext\Auths\Basics\IUser .
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetRoleClass( string $roleClass = '' )
Set full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Role .
Set full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Role .
Parameters
- $roleClass
- Role full class name implementing
\MvcCore\Ext\Auths\Basics\IRole .
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetControllerClass( string $controllerClass = '' )
Set full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Controller .
Set full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\Controller .
Parameters
- $controllerClass
- Controller full class name implementing
\MvcCore\Ext\Auths\Basics\IController .
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignInFormClass( string $signInFormClass = '' )
Set full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignInForm .
Set full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignInForm .
Parameters
- $signInFormClass
- Form full class name implementing
\MvcCore\Ext\Auths\Basics\IForm .
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignOutFormClass( string $signOutFormClass = '' )
Set full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignOutForm .
Set full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Default value after authentication module init is
configured to \MvcCore\Ext\Auths\Basics\SignOutForm .
Parameters
- $signOutFormClass
- $signInFormClass Form full class name implementing
\MvcCore\Ext\Auths\Basics\IForm .
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignedInUrl( string|null $signedInUrl = NULL )
Set full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
Set full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignedOutUrl( string|null $signedOutUrl = NULL )
Set full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
Set full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignErrorUrl( string|null $signErrorUrl = NULL )
Set full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
Set full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignInRoute( string|array|MvcCore\Route $signInRoute = NULL )
Set route instance to submit sign in form into.
Default configured route for sign in request is /signin by POST.
Set route instance to submit sign in form into.
Default configured route for sign in request is /signin by POST.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetSignOutRoute( string|array|MvcCore\Route $signOutRoute = NULL )
Set route to submit sign out form into.
Default configured route for sign in request is /signout by POST.
Set route to submit sign out form into.
Default configured route for sign in request is /signout by POST.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetPasswordHashSalt( string $passwordHashSalt = '' )
Set configured salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
Set configured salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetInvalidCredentialsTimeout( integer $seconds = 3 )
Set timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
Set timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetTranslator( callable $translator = NULL )
Set callable translator to set it into authentication form
to translate form labels, placeholders or buttons.
Default value is NULL (forms without translations).
Set callable translator to set it into authentication form
to translate form labels, placeholders or buttons.
Default value is NULL (forms without translations).
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetUser( MvcCore\Ext\Auths\Basics\IUser $user = NULL )
Set user instance manually. If you use this method
no authentication by {$configuredUserClass}::SetUpUserBySession();
is used and authentication state is always positive.
Set user instance manually. If you use this method
no authentication by {$configuredUserClass}::SetUpUserBySession();
is used and authentication state is always positive.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetForm( MvcCore\Ext\Auths\Basics\IForm $form )
Set sign in, sign out or any authentication form instance.
Use this method only if you need sometimes to complete different form to render.
Set sign in, sign out or any authentication form instance.
Use this method only if you need sometimes to complete different form to render.
Parameters
Returns
|
public
MvcCore\Ext\Auths\Basic
|
#
SetConfiguration( array $configuration = [], boolean $throwExceptionIfPropertyIsMissing = TRUE )
Set up authorization module configuration.
Each array key has to be key by protected configuration property in this class.
All properties are one by one configured by it's setter method.
Set up authorization module configuration.
Each array key has to be key by protected configuration property in this class.
All properties are one by one configured by it's setter method.
Parameters
- $configuration
- Keys by protected properties names in camel case.
- $throwExceptionIfPropertyIsMissing
Returns
Throws
InvalidArgumentException
|
public
MvcCore\Ext\Auths\Basic
|
#
SetTableStructureForDbUsers( string|null $tableName = NULL, string[]|null $columnNames = NULL )
Optional alias method if you have user class configured
to database user: \MvcCore\Ext\Auths\Basics\Users\Database .
Alias for \MvcCore\Ext\Auths\Basics\Users\Database::SetUsersTableStructure($tableName, $columnNames); .
Optional alias method if you have user class configured
to database user: \MvcCore\Ext\Auths\Basics\Users\Database .
Alias for \MvcCore\Ext\Auths\Basics\Users\Database::SetUsersTableStructure($tableName, $columnNames); .
Parameters
- $tableName
- Database table name.
- $columnNames
- Keys are user class protected properties names in camel case, values are database columns names.
Returns
|
protected
string
|
#
checkClassImplementation( string $testClassName, string $interfaceName, boolean $checkStaticMethods = FALSE )
Check if given class name implements given interface
and optionally if test class implements static interface methods.
If not, thrown an \InvalidArgumentException every time.
Check if given class name implements given interface
and optionally if test class implements static interface methods.
If not, thrown an \InvalidArgumentException every time.
Parameters
- $testClassName
- Full test class name.
- $interfaceName
- Full interface class name.
- $checkStaticMethods
FALSE by default.
Returns
string
Throws
InvalidArgumentException
|
Properties summary
protected static
MvcCore\Ext\Auths\Basic |null
|
$instance
Singleton instance of authentication extension module.
Singleton instance of authentication extension module.
|
|
protected static
string|null
|
$toolClass
Shortcut for configured core tool class value
from \MvcCore\Application::GetInstance()->GetToolClass(); .
Shortcut for configured core tool class value
from \MvcCore\Application::GetInstance()->GetToolClass(); .
|
|
protected static
array
|
$nonConfigurationProperties
Properties names which are internal properties
or internal instances for authentication module,
which are not configuration properties, instance properties only.
This array is used only in \MvcCore\Ext\Auth::GetConfiguration(); .
Properties names which are internal properties
or internal instances for authentication module,
which are not configuration properties, instance properties only.
This array is used only in \MvcCore\Ext\Auth::GetConfiguration(); .
|
#
[
'userInitialized', 'application', 'user', 'form',
]
|
protected
integer
|
$expirationIdentity
Expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
Expiration time (in seconds) how long to remember the user name in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 1 month (30 days, 2592000 seconds).
|
|
protected
integer
|
$expirationAuthorization
Expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
Expiration time (in seconds) how long to remember the authorization in session.
You can use zero (0 ) to browser close moment, but some browsers can
restore previous session after next browser application start. Or anybody
else in your project could use session for storing any information
for some longer time in your application and session cookie could then
exists much longer then browser close moment only.
So better is not to use a zero value.
Default value is 10 minutes (600 seconds).
|
|
protected
string
|
$userClass
Full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
Full class name to use for user instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IUser .
|
#
'MvcCore\\Ext\\Auths\\Basics\\User'
|
protected
string
|
$roleClass
Full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
Full class name to use for user role class.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IRole .
|
#
'MvcCore\\Ext\\Auths\\Basics\\Role'
|
protected
string
|
$controllerClass
Full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
Full class name to use for controller instance
to submit authentication form(s). Class name has to implement interfaces:
- \MvcCore\Ext\Auths\Basics\IController
- \MvcCore\IController
|
#
'//MvcCore\\Ext\\Auths\\Basics\\Controller'
|
protected
string
|
$signInFormClass
Full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Full class name to use for sign in form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
|
#
'MvcCore\\Ext\\Auths\\Basics\\SignInForm'
|
protected
string
|
$signOutFormClass
Full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
Full class name to use for sign out form instance.
Class name has to implement interface
\MvcCore\Ext\Auths\Basics\IForm .
|
#
'MvcCore\\Ext\\Auths\\Basics\\SignOutForm'
|
protected
string|null
|
$signedInUrl
Full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
Full URL to redirect user, after sign in
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign in form rendered.
|
|
protected
string|null
|
$signedOutUrl
Full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
Full URL to redirect user, after sign out
POST request was successful.
If NULL (by default), user will be redirected
to the same url, where was sign out form rendered.
|
|
protected
string|null
|
$signErrorUrl
Full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
Full URL to redirect user, after sign in POST
request or sign out POST request was not successful,
for example wrong credentials.
If NULL (by default), user will be redirected
to the same url, where was sign in/out form rendered.
|
|
protected
string|array|MvcCore\Route
|
$signInRoute
Route to submit sign in form to.
It could be defined only as a string (route pattern),
or as route configuration array or as route instance.
Default match/reverse pattern for route sign request is
/signin by POST.
Route to submit sign in form to.
It could be defined only as a string (route pattern),
or as route configuration array or as route instance.
Default match/reverse pattern for route sign request is
/signin by POST.
|
#
[
'name' => 'auth_signin',
'match' => '#^/signin/?$#',
'reverse' => '/signin',
'method' => \MvcCore\IRequest::METHOD_POST
]
|
protected
string|array|MvcCore\Route
|
$signOutRoute
Route to submit sign out form into.
It could be defined only as a string (route pattern),
or as route configuration array or as route instance.
Default match/reverse pattern for route sign request is
/signout by POST.
Route to submit sign out form into.
It could be defined only as a string (route pattern),
or as route configuration array or as route instance.
Default match/reverse pattern for route sign request is
/signout by POST.
|
#
[
'name' => 'auth_signout',
'match' => '#^/signout/?$#',
'reverse' => '/signout',
'method' => \MvcCore\IRequest::METHOD_POST
]
|
protected
string
|
$passwordHashSalt
Salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
Salt for passord_hash(); to generate password by PASSWORD_BCRYPT .
NULL by default. This option is the only one option required
to configure authentication module to use it properly.
|
|
protected
integer
|
$invalidCredentialsTimeout
Timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
Timeout to sleep(); PHP script before sending response to user,
when user submitted invalid username or password.
Default value is 3 (3 seconds).
|
|
protected
callable|null
|
$translator
Callable translator to set it into authentication form
to translate form labels, placeholders, buttons or error messages.
Default value is NULL (forms without translations).
Callable translator to set it into authentication form
to translate form labels, placeholders, buttons or error messages.
Default value is NULL (forms without translations).
|
|
protected
integer
|
$preHandlersPriority
Pre-route and pre-dispatch application callable handlers priority index.
This property has no setter and getter. It's possible to configure only throw constructor.
Pre-route and pre-dispatch application callable handlers priority index.
This property has no setter and getter. It's possible to configure only throw constructor.
|
|
protected
MvcCore\Application
|
$application
MvcCore application instance reference from
\MvcCore\Application::GetInstance() , because
it's used many times in authentication class.
MvcCore application instance reference from
\MvcCore\Application::GetInstance() , because
it's used many times in authentication class.
|
|
protected
MvcCore\Ext\Auths\Basics\User |null
|
$user
User model instance or NULL if user has no username record in session namespace.
User model instance or NULL if user has no username record in session namespace.
|
|
protected
MvcCore\Ext\Auths\Basics\SignInForm |MvcCore\Ext\Auths\Basics\SignOutForm
|
$form
Sign in form instance, sign out form instance or any
other authentication form instance in extended classes.
If user is authenticated by username record in session namespace,
there is completed sign out form, if not authenticated, sign in form otherwise etc...
Sign in form instance, sign out form instance or any
other authentication form instance in extended classes.
If user is authenticated by username record in session namespace,
there is completed sign out form, if not authenticated, sign in form otherwise etc...
|
|
protected
boolean
|
$userInitialized
This is only internal semaphore to call
\MvcCore\Ext\Auths\Basics\User::SetUpUserBySession()
only once (if result is NULL ) in request pre-dispatch state.
TRUE if method \MvcCore\Ext\Auth::GetInstance()->GetUser()
has been called already with any result and also TRUE if
method \MvcCore\Ext\Auth::GetInstance()->SetUser($user) has been
already called with any first argument $user value.
This is only internal semaphore to call
\MvcCore\Ext\Auths\Basics\User::SetUpUserBySession()
only once (if result is NULL ) in request pre-dispatch state.
TRUE if method \MvcCore\Ext\Auth::GetInstance()->GetUser()
has been called already with any result and also TRUE if
method \MvcCore\Ext\Auth::GetInstance()->SetUser($user) has been
already called with any first argument $user value.
|
|
protected
boolean
|
$addRoutesForAnyRequestMethod
This is only internal semaphore to define when to add
sign in or sign out route into router in pre route request state.
If any configured route is for different http method than POST ,
than this property is set to TRUE . If both configured routes
use only POST method, this property is automatically FALSE to
not add routes for all requests, only for POST requests.
Default value is FALSE because both default routes use POST methods.
This is only internal semaphore to define when to add
sign in or sign out route into router in pre route request state.
If any configured route is for different http method than POST ,
than this property is set to TRUE . If both configured routes
use only POST method, this property is automatically FALSE to
not add routes for all requests, only for POST requests.
Default value is FALSE because both default routes use POST methods.
|
|