Skip to content

Commit

Permalink
possible fix for #66
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Oct 6, 2015
1 parent f7d44fc commit 9aca808
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,15 @@ public function login($identifier, $pass, $remember = FALSE, $totp_code = NULL)
}

$user_id = $query->row()->id;
if($this->config_vars['recaptcha_active']){
if( ($this->config_vars['use_cookies'] == TRUE && $this->CI->input->cookie('reCAPTCHA', TRUE) == 'true') || ($this->config_vars['use_cookies'] == FALSE && $this->CI->session->tempdata('reCAPTCHA') == 'true') ){
$reCaptcha = new ReCaptcha( $this->config_vars['recaptcha_secret']);
$resp = $reCaptcha->verifyResponse( $this->CI->input->server("REMOTE_ADDR"), $this->CI->input->post("g-recaptcha-response") );

if( ($this->config_vars['use_cookies'] == TRUE && $this->CI->input->cookie('reCAPTCHA', TRUE) == 'true') || ($this->config_vars['use_cookies'] == FALSE && $this->CI->session->tempdata('reCAPTCHA') == 'true') ){
$reCaptcha = new ReCaptcha( $this->config_vars['recaptcha_secret']);
$resp = $reCaptcha->verifyResponse( $this->CI->input->server("REMOTE_ADDR"), $this->CI->input->post("g-recaptcha-response") );

if(!$resp->success){
$this->error($this->CI->lang->line('aauth_error_recaptcha_not_correct'));
return FALSE;
if(!$resp->success){
$this->error($this->CI->lang->line('aauth_error_recaptcha_not_correct'));
return FALSE;
}
}
}

Expand Down

0 comments on commit 9aca808

Please sign in to comment.