IPService
class IPService (View source)
Constants
| IPRANGEFLAG_BLACKLIST | 
                     Bit mask for blacklist ranges.  | 
            
| IPRANGEFLAG_WHITELIST | 
                     Bit mask for whitelist ranges.  | 
            
| IPRANGEFLAG_MANUAL | 
                     Bit mask for manually generated ranges.  | 
            
| IPRANGEFLAG_AUTOMATIC | 
                     Bit mask for automatically generated ranges.  | 
            
| IPRANGETYPE_BLACKLIST_MANUAL | 
                     IP range type: manually added to the blacklist.  | 
            
| IPRANGETYPE_BLACKLIST_AUTOMATIC | 
                     IP range type: automatically added to the blacklist.  | 
            
| IPRANGETYPE_WHITELIST_MANUAL | 
                     IP range type: manually added to the whitelist.  | 
            
Properties
| protected Repository | $config | ||
| protected Connection | $connection | ||
| protected Request | $request | 
Methods
Get the IP address of the current request.
Check if an IP adress is blacklisted.
Check if an IP adress is blacklisted.
Get the (localized) message telling the users that their IP address has been banned.
Add the current IP address to the list of IPs with failed login attempts.
Check if the current IP address has reached the failed login attempts threshold.
Add an IP address to the list of IPs banned for too many failed login attempts.
Add persist an IP address range type.
Get the list of currently available ranges.
Find already defined range given its record ID.
Get the range type (if defined) of an IP adress.
Delete the failed login attempts.
Clear the IP addresses automatically blacklisted.
Details
        
                            
    __construct(Repository $config, Connection $connection, Request $request)
        
    
    No description
        
                            AddressInterface
    getRequestIPAddress()
        
    
    Get the IP address of the current request.
        
                            bool
    isBlacklisted(AddressInterface $ip = null)
        
    
    Check if an IP adress is blacklisted.
        
                            bool
    isWhitelisted(AddressInterface $ip = null)
        
    
    Check if an IP adress is blacklisted.
        
                            string
    getErrorMessage()
        
    
    Get the (localized) message telling the users that their IP address has been banned.
        
                            
    logFailedLogin(AddressInterface $ip = null, bool $ignoreConfig = false)
        
    
    Add the current IP address to the list of IPs with failed login attempts.
        
                            bool
    failedLoginsThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false)
        
    
    Check if the current IP address has reached the failed login attempts threshold.
        
                            
    addToBlacklistForThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false)
        
    
    Add an IP address to the list of IPs banned for too many failed login attempts.
        
                            IPRange
    createRange(RangeInterface $range, int $type, DateTime $expiration = null)
        
    
    Add persist an IP address range type.
        
                            IPRange[]|Generator
    getRanges(int $type, bool $includeExpired = false)
        
    
    Get the list of currently available ranges.
        
                            IPRange|null
    getRangeByID(int $id)
        
    
    Find already defined range given its record ID.
        
                            
    deleteRange(IPRange|int $range)
        
    
    Delete a range record.
        
                    protected        int|null
    getRangeType(AddressInterface $ip)
        
    
    Get the range type (if defined) of an IP adress.
        
                            int
    deleteFailedLoginAttempts(int|null $maxAge = null)
        
    
    Delete the failed login attempts.
        
                            
    deleteAutomaticBlacklist(bool $onlyExpired = true)
        
    
    Clear the IP addresses automatically blacklisted.
        
                            
    getRequestIP()
        deprecated
    
    deprecated
No description
        
                            
    isBanned($ip = false)
        deprecated
    
    deprecated
No description
        
                            
    createIPBan($ip = false, $ignoreConfig = false)
        deprecated
    
    deprecated
No description
        
                            
    logSignupRequest($ignoreConfig = false)
        deprecated
    
    deprecated
No description
        
                            
    signupRequestThreshholdReached($ignoreConfig = false)
        deprecated
    
    deprecated
No description
        
                            
    signupRequestThresholdReached($ignoreConfig = false)
        deprecated
    
    deprecated
No description