⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.94
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hrms.dev-unit.com
/
app
/
Listeners
/
View File Name :
VerifyReCaptchaTokenLis.php
<?php namespace App\Listeners; use App\Events\VerifyReCaptchaToken; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; class VerifyReCaptchaTokenLis { /** * Create the event listener. */ public function __construct() { // } /** * Handle the event. */ public function handle(VerifyReCaptchaToken $event) { $request = $event->request->all(); $token=isset($request['g-recaptcha-response']) ? $request['g-recaptcha-response'] : ""; $setting = \App\Models\Utility::settings(); $secretKey = $setting['google_recaptcha_secret']; $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array( 'secret' => $secretKey, 'response' => $token ); $options = array( 'http' => array( 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result); if ($response->success) { return ['status'=>true]; } else { return ['status'=>false]; } } }