MemberAuthenticationFilter
extends Filter
in package
Member authentication filter.
Ensures user is authenticated and has member-level access (not admin-only). Also checks for email verification if required. Redirects to login page if not authenticated or to verification page if not verified.
Table of Contents
Properties
- $_authentication : Authentication
- $_loginUrl : string
- $_postFn : Closure|null
- $_preFn : Closure|null
- $_redirectParam : string
- $_requireEmailVerification : bool
- $_verifyEmailUrl : string
Methods
- __construct() : mixed
- post() : mixed|null
- pre() : mixed|null
- setLoginUrl() : self
- Set login URL
- setRequireEmailVerification() : self
- Set whether email verification is required
- setVerifyEmailUrl() : self
- Set verify email URL
- checkAuthentication() : void
- Check if user is authenticated and verified
Properties
$_authentication
private
Authentication
$_authentication
$_loginUrl
private
string
$_loginUrl
= '/login'
$_postFn
private
Closure|null
$_postFn
$_preFn
private
Closure|null
$_preFn
$_redirectParam
private
string
$_redirectParam
= 'redirect'
$_requireEmailVerification
private
bool
$_requireEmailVerification
= true
$_verifyEmailUrl
private
string
$_verifyEmailUrl
= '/verify-email-required'
Methods
__construct()
public
__construct(Authentication $authentication[, string $loginUrl = '/login' ][, bool $requireEmailVerification = true ]) : mixed
Parameters
- $authentication : Authentication
- $loginUrl : string = '/login'
- $requireEmailVerification : bool = true
post()
public
post(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullpre()
public
pre(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullsetLoginUrl()
Set login URL
public
setLoginUrl(string $loginUrl) : self
Parameters
- $loginUrl : string
Return values
selfsetRequireEmailVerification()
Set whether email verification is required
public
setRequireEmailVerification(bool $require) : self
Parameters
- $require : bool
Return values
selfsetVerifyEmailUrl()
Set verify email URL
public
setVerifyEmailUrl(string $verifyEmailUrl) : self
Parameters
- $verifyEmailUrl : string
Return values
selfcheckAuthentication()
Check if user is authenticated and verified
protected
checkAuthentication(RouteMap $route) : void
Parameters
- $route : RouteMap