HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/kms.komma.pro/wwwroot/lib/login/blacklist.class.php
<?php
/**
 * blacklist.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 9/27/13
 */

class Blacklist
{
    private $_Storage;

    public function __construct()
    {
        // Set Storage object
        $this->_Storage = new Storage();
    }

    /*
     * Is the Ip on our blacklist
     * $data['ip'], $data['email']
     */
    public function get($data)
    {
        // Search the blacklist for this IP
        $this->_Storage->setTableName(TABLE_PREFIX . 'kms_blacklist');
        $this->_Storage->addRule('user',$data['user']);
        $this->_Storage->addRule('ip',$data['ip']);
        $result = $this->_Storage->select();
        // If result, return true
        return ! empty( $result );
    }

    public function put($data)
    {
        // Add a timestamp to data
        $data['timest'] = time();

        if( ! $this->get($data))
        {
            $this->_Storage->setTableName(TABLE_PREFIX . 'kms_blacklist');
            $this->_Storage->setData($data);
            $this->_Storage->insert();
        }
    }

}