diff --git a/hungng/HungNG_CI_Base_Controllers.php b/hungng/HungNG_CI_Base_Controllers.php index 49cebd3..6c136a6 100644 --- a/hungng/HungNG_CI_Base_Controllers.php +++ b/hungng/HungNG_CI_Base_Controllers.php @@ -517,5 +517,19 @@ protected function command_clean_cache_apc() show_404(); } } + + /** + * Check is human by recaptcha from request + * + * @return bool + */ + protected function reCaptchaIsHuman() + { + $captcha = $this->input->post('g-recaptcha-response', true); + if (!$captcha) { + return false; + } + return true; + } } } diff --git a/hungng/HungNG_CI_Base_Module.php b/hungng/HungNG_CI_Base_Module.php index bde9a7e..f34a2ba 100644 --- a/hungng/HungNG_CI_Base_Module.php +++ b/hungng/HungNG_CI_Base_Module.php @@ -517,5 +517,19 @@ protected function command_clean_cache_apc() show_404(); } } + + /** + * Check is human by recaptcha from request + * + * @return bool + */ + protected function reCaptchaIsHuman() + { + $captcha = $this->input->post('g-recaptcha-response', true); + if (!$captcha) { + return false; + } + return true; + } } }