added securimage captcha

This commit is contained in:
SJ
2013-08-30 15:18:59 +02:00
parent cfdb2bcd6c
commit ec6b7fabd0
83 changed files with 20338 additions and 0 deletions

View File

@ -35,6 +35,9 @@ class ControllerLoginLogin extends Controller {
$this->data['title'] = $this->data['text_login'];
$this->data['title_prefix'] = TITLE_PREFIX;
$this->data['failed_login_count'] = $this->model_user_auth->get_failed_login_count();
if($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate() == true) {
if($this->model_user_auth->checkLogin($this->request->post['username'], $_POST['password']) == 1) {
@ -55,6 +58,10 @@ class ControllerLoginLogin extends Controller {
header("Location: " . SITE_URL . "search.php");
exit;
}
else {
$this->model_user_auth->increment_failed_login_count($this->data['failed_login_count']);
$this->data['failed_login_count']++;
}
$this->data['x'] = $this->data['text_invalid_email_or_password'];
@ -91,6 +98,16 @@ class ControllerLoginLogin extends Controller {
}
if(CAPTCHA_FAILED_LOGIN_COUNT > 0 && $this->data['failed_login_count'] > CAPTCHA_FAILED_LOGIN_COUNT) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$image = new Securimage();
if($image->check($this->request->post['captcha']) != true) {
$this->error['captcha'] = 'captcha error';
}
}
if (!$this->error) {
return true;
} else {