Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1', \IPS\Request::i()->ipAddress() ) )->first() > 10 )
- {
- \IPS\Db::i()->insert( 'core_banfilters', array(
- 'ban_type' => 'ip',
- 'ban_content' => \IPS\Request::i()->ipAddress(),
- 'ban_date' => time(),
- 'ban_reason' => 'API',
- ) );
- unset( \IPS\Data\Store::i()->bannedIpAddresses );
- throw new \IPS\Api\Exception( 'IP_ADDRESS_BANNED', '1S290/A', 403 );
- }
Advertisement
Add Comment
Please, Sign In to add comment