protection

This commit is contained in:
Claude 2012-06-14 14:55:25 +02:00
parent c747bd54ae
commit 500b05cc7e
2 changed files with 13 additions and 0 deletions

View File

@ -72,6 +72,8 @@ $config['per_page'] = 10;
**/
$config['private_only'] = false;
$config['enable_captcha'] = false;
$config['spamadmin_user'] = '';
$config['spamadmin_pass'] = '';
/**
* Default language

View File

@ -15,6 +15,17 @@ class Spamadmin extends CI_Controller
function __construct()
{
parent::__construct();
//protection
$user = $this->config->item('spamadmin_user');
$pass = $this->config->item('spamadmin_pass');
if ($user == '' || $pass == '' || !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass)
{
header('WWW-Authenticate: Basic realm="Backup"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
}
function index()