芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/thefirstcookout.com/support/application/libraries/Recaptcha.php
"The secret parameter is missing.", "invalid-input-secret"=>"The secret parameter is invalid or malformed.", "missing-input-response"=>"Captcha error.", "invalid-input-response"=>"Captcha is invalid or malformed.", "bad-request"=>"The request is invalid or malformed." ]; $response=self::SendRequest($user_response); $response=json_decode($response); if($response->success){ return true; }else{ if(is_array($response->{"error-codes"})){ foreach ($response->{"error-codes"} as $ecode){ if(isset($error_codes[$ecode])){ AddError($error_codes[$ecode]); } } } } return false; } static function get_chapcha_html($class="",$input_class=''){ if(!self::$isloadedSettings){ self::load_setting(); } self::$id++; return '
'; } static function SendRequest($user_response) { $isLog=ENVIRONMENT=="development"; $fields=array( "secret"=>self::$secret, "response"=>$user_response ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $result = curl_exec($ch); if ($result === FALSE) { if($isLog && function_exists("AddFileLog")){ AddFileLog('Problem occurred: ' . curl_error($ch),true,"recaptcha.log",false); } return FALSE; } curl_close($ch); if($isLog && function_exists("AddFileLog")){ AddFileLog('GCM Result: ' .$result,true,"recaptcha.log",false); } return $result; } }