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();
}
}
}