]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<?php session_start(); ob_start(); ob_clean(); include_once "admin/include/config.php"; $sel_obj = new config(); // include google API client require_once "vendor/autoload.php"; // set google client ID $google_oauth_client_id = "888902028900-7037mb07nnvukpgabmgjv8kbksd575i1.apps.googleusercontent.com"; // create google client object with client ID $client = new Google_Client([ 'client_id' => $google_oauth_client_id ]); // verify the token sent from AJAX $id_token = $_POST["id_token"]; $payload = $client->verifyIdToken($id_token); if ($payload && $payload['aud'] == $google_oauth_client_id) { // get user information from Google $user_google_id = $payload['sub']; // $_SESSION['userdata'] = $payload; $name = $payload["name"]; $email = $payload["email"]; $phone_number = $payload["email"]; $picture = $payload["picture"]; $FullName = $payload["given_name"]; $last_name = $payload["family_name"]; /*------------ Insert Database -----------------------*/ $ret=$sel_obj->signinwithgmail($user_google_id,$email); $num=mysqli_fetch_array($ret); if($num>0) { $_SESSION['uid']=$num['id']; $_SESSION['UserEmail']=$num['UserEmail']; }else{ $sql=$sel_obj->registrationwithgmail($email,$user_google_id,$picture,$FullName,$last_name); if($sql) { $ret=$sel_obj->signinwithgmail($user_google_id,$email); $num=mysqli_fetch_array($ret); if($num>0) { $_SESSION['uid']=$num['id']; $_SESSION['UserEmail']=$num['UserEmail']; /*-------- Send Welcome Email ----------*/ $ct_u_name = $FullName." ".$last_name; include_once('welcome_mail_to_user.php'); /*--------------------------------------*/ } } } /*----------------------------------------------------*/ // send the response back to client side echo "Successfully logged in. " . $user_google_id . ", " . $name . ", " . $email . ", " . $picture; } else { // token is not verified or expired echo "Failed to login."; } ?>