Skip to content

Commit edc3b79

Browse files
authored
Merge pull request #46 from nguyenanhung/v3.2.0-develop
Add protected function reCaptchaIsHuman
2 parents 4698751 + 0726588 commit edc3b79

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

hungng/HungNG_CI_Base_Controllers.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,5 +517,19 @@ protected function command_clean_cache_apc()
517517
show_404();
518518
}
519519
}
520+
521+
/**
522+
* Check is human by recaptcha from request
523+
*
524+
* @return bool
525+
*/
526+
protected function reCaptchaIsHuman()
527+
{
528+
$captcha = $this->input->post('g-recaptcha-response', true);
529+
if (!$captcha) {
530+
return false;
531+
}
532+
return true;
533+
}
520534
}
521535
}

hungng/HungNG_CI_Base_Module.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,5 +517,19 @@ protected function command_clean_cache_apc()
517517
show_404();
518518
}
519519
}
520+
521+
/**
522+
* Check is human by recaptcha from request
523+
*
524+
* @return bool
525+
*/
526+
protected function reCaptchaIsHuman()
527+
{
528+
$captcha = $this->input->post('g-recaptcha-response', true);
529+
if (!$captcha) {
530+
return false;
531+
}
532+
return true;
533+
}
520534
}
521535
}

0 commit comments

Comments
 (0)