- Katılım
- 20 Tem 2021
- Konular
- 148
- Mesajlar
- 905
- Çözüm
- 3
- Online süresi
- 1mo 3d
- Reaksiyon Skoru
- 1,079
- Altın Konu
- 32
- TM Yaşı
- 4 Yıl 10 Ay 21 Gün
- Başarım Puanı
- 185
- MmoLira
- 500
- DevLira
- 3
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
[CODE lang="php" title="config.php"]<?php
@session_start();
@ob_start();
$db = new PDO("mysql:host=localhost;dbname=itjagoogle;charset=utf8","itjagoogle","itja") or die("bağlanmadı");
?>[/CODE]
[CODE lang="php" title="google-api.php"]Not: bu api süresi geçmiş olabilir kendinize yeni api bulun sıkıntı çıkabilir.
<?php
class GooogleLoginApi{
public function GetAccessToken($client_id,$redirect_uri,$client_secret,$code){
$url = 'https://www.googleapis.com/oauth2/v4/token';
$curlPost = 'client_id='.$client_id.'&redirect_uri='.$redirect_uri.'&client_secret='.$client_secret.'&code='.$code.'&grant_type=authorization_code';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data2 = curl_exec($ch);
$data = json_decode($data2,true);
return $data;
}
public function GetUserProfileInfo($access_token){
$url = 'https://www.googleapis.com/oauth2/v2/userinfo?fields=name,email,gender,id,picture,verified_email';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. $access_token));
$data2 = curl_exec($ch);
$data = json_decode($data2,true);
return $data;
}
}
?>[/CODE]
[CODE lang="php" title="google-redirect.php"]<?php
require_once 'config.php';
require_once 'google-api.php';
require_once 'google-settings.php';
if(isset($_GET['code'])){
$gapi = new GooogleLoginApi();
$data = $gapi->GetAccessToken(CLIENT_ID,CLIENT_REDIRECT_URL,CLIENT_SECRET, $_GET['code']);
$user = $gapi->GetUserProfileInfo($data['access_token']);
echo $user['id'];
$isim = $user['name'];
$eposta = $user['email'];
$id = $user['id'];
$resim = $user['picture'];
$sifrele = sha1(md5($id.$eposta));
$varmi = $db->prepare("SELECT * FROM uyeler WHERE eposta=:e AND googleid=:g");
$varmi->execute([':e' => $eposta,':g'=>$id]);
if($varmi->rowCount()){
$guncelle = $db->prepare("UPDATE uyeler SET isim=:i,resim=:r WHERE eposta=:e AND googleid=:g");
$guncelle->execute([':i' => $isim,':r'=>$resim,':e'=>$eposta,':g'=>$id]);
}else{
$ekle = $db->prepare("INSERT INTO uyeler SET
isim =:i,
eposta =:e,
sifre =:s,
resim =:r,
googleid=:g
");
$ekle->execute([
':i' => $isim,
':e' => $eposta,
':s' => $sifrele,
':r' => $resim,
':g' => $id
]);
}
$_SESSION['oturum'] = true;
$_SESSION['isim'] = $isim;
$_SESSION['eposta'] = $eposta;
$_SESSION['resim'] = $resim;
header('Location:index.php');
}
?>[/CODE]
[CODE lang="php" title="google-settings.php"]<?php
define('CLIENT_ID','410101718610-1q5hqcvv3225ja27gl0op8l4anjv205n.apps.googleusercontent.com');
define('CLIENT_SECRET','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');
define('CLIENT_REDIRECT_URL','https://googlegiris.petlevet.com/google-redirect.php');
?>[/CODE]
[CODE lang="php" title="index.php"]<?php
require_once 'config.php';
require_once 'google-settings.php';
$login_url = 'https://accounts.google.com/o/oauth2/v2/auth?scope=' . urlencode('https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email') . '&redirect_uri=' . urlencode(CLIENT_REDIRECT_URL) . '&response_type=code&client_id=' . CLIENT_ID . '&access_type=online';
?>
<?php if(isset($_SESSION['oturum'])){ ?>
<h2>Hoşgeldiniz, <?php echo $_SESSION['isim'];?></h2>
<img src="<?php echo $_SESSION['resim'];?>" width="200" height="200" />
<br>
<a href="logout.php">Çıkış Yap</a>
<?php }else{ ?>
<a href="<?php echo $login_url;?>">GOOGLE İLE ÜYE GİRİŞİ YAP</a>
<?php } ?>[/CODE]
[CODE lang="php" title="logout.php"]<?php
require_once 'config.php';
session_destroy();
header('Location:index.php');
[/CODE]
Sql:
Virustotal:
@session_start();
@ob_start();
$db = new PDO("mysql:host=localhost;dbname=itjagoogle;charset=utf8","itjagoogle","itja") or die("bağlanmadı");
?>[/CODE]
[CODE lang="php" title="google-api.php"]Not: bu api süresi geçmiş olabilir kendinize yeni api bulun sıkıntı çıkabilir.
<?php
class GooogleLoginApi{
public function GetAccessToken($client_id,$redirect_uri,$client_secret,$code){
$url = 'https://www.googleapis.com/oauth2/v4/token';
$curlPost = 'client_id='.$client_id.'&redirect_uri='.$redirect_uri.'&client_secret='.$client_secret.'&code='.$code.'&grant_type=authorization_code';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data2 = curl_exec($ch);
$data = json_decode($data2,true);
return $data;
}
public function GetUserProfileInfo($access_token){
$url = 'https://www.googleapis.com/oauth2/v2/userinfo?fields=name,email,gender,id,picture,verified_email';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. $access_token));
$data2 = curl_exec($ch);
$data = json_decode($data2,true);
return $data;
}
}
?>[/CODE]
[CODE lang="php" title="google-redirect.php"]<?php
require_once 'config.php';
require_once 'google-api.php';
require_once 'google-settings.php';
if(isset($_GET['code'])){
$gapi = new GooogleLoginApi();
$data = $gapi->GetAccessToken(CLIENT_ID,CLIENT_REDIRECT_URL,CLIENT_SECRET, $_GET['code']);
$user = $gapi->GetUserProfileInfo($data['access_token']);
echo $user['id'];
$isim = $user['name'];
$eposta = $user['email'];
$id = $user['id'];
$resim = $user['picture'];
$sifrele = sha1(md5($id.$eposta));
$varmi = $db->prepare("SELECT * FROM uyeler WHERE eposta=:e AND googleid=:g");
$varmi->execute([':e' => $eposta,':g'=>$id]);
if($varmi->rowCount()){
$guncelle = $db->prepare("UPDATE uyeler SET isim=:i,resim=:r WHERE eposta=:e AND googleid=:g");
$guncelle->execute([':i' => $isim,':r'=>$resim,':e'=>$eposta,':g'=>$id]);
}else{
$ekle = $db->prepare("INSERT INTO uyeler SET
isim =:i,
eposta =:e,
sifre =:s,
resim =:r,
googleid=:g
");
$ekle->execute([
':i' => $isim,
':e' => $eposta,
':s' => $sifrele,
':r' => $resim,
':g' => $id
]);
}
$_SESSION['oturum'] = true;
$_SESSION['isim'] = $isim;
$_SESSION['eposta'] = $eposta;
$_SESSION['resim'] = $resim;
header('Location:index.php');
}
?>[/CODE]
[CODE lang="php" title="google-settings.php"]<?php
define('CLIENT_ID','410101718610-1q5hqcvv3225ja27gl0op8l4anjv205n.apps.googleusercontent.com');
define('CLIENT_SECRET','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');
define('CLIENT_REDIRECT_URL','https://googlegiris.petlevet.com/google-redirect.php');
?>[/CODE]
[CODE lang="php" title="index.php"]<?php
require_once 'config.php';
require_once 'google-settings.php';
$login_url = 'https://accounts.google.com/o/oauth2/v2/auth?scope=' . urlencode('https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email') . '&redirect_uri=' . urlencode(CLIENT_REDIRECT_URL) . '&response_type=code&client_id=' . CLIENT_ID . '&access_type=online';
?>
<?php if(isset($_SESSION['oturum'])){ ?>
<h2>Hoşgeldiniz, <?php echo $_SESSION['isim'];?></h2>
<img src="<?php echo $_SESSION['resim'];?>" width="200" height="200" />
<br>
<a href="logout.php">Çıkış Yap</a>
<?php }else{ ?>
<a href="<?php echo $login_url;?>">GOOGLE İLE ÜYE GİRİŞİ YAP</a>
<?php } ?>[/CODE]
[CODE lang="php" title="logout.php"]<?php
require_once 'config.php';
session_destroy();
header('Location:index.php');
[/CODE]
Sql:
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
Virustotal:
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
- Katılım
- 7 May 2010
- Konular
- 10,579
- Mesajlar
- 58,614
- Çözüm
- 219
- Online süresi
- 10mo 29d
- Reaksiyon Skoru
- 16,721
- Altın Konu
- 444
- TM Yaşı
- 16 Yıl 1 Ay 3 Gün
- Başarım Puanı
- 691
- MmoLira
- 19,925
- DevLira
- 601
Paylaşım için teşekkürler.
- Katılım
- 20 Tem 2021
- Konular
- 148
- Mesajlar
- 905
- Çözüm
- 3
- Online süresi
- 1mo 3d
- Reaksiyon Skoru
- 1,079
- Altın Konu
- 32
- TM Yaşı
- 4 Yıl 10 Ay 21 Gün
- Başarım Puanı
- 185
- MmoLira
- 500
- DevLira
- 3
sağolun adminim teşekkürler.Paylaşım için teşekkürler.
- Katılım
- 20 Kas 2021
- Konular
- 2,085
- Mesajlar
- 5,972
- Çözüm
- 5
- Online süresi
- 3mo 10d
- Reaksiyon Skoru
- 5,735
- Altın Konu
- 218
- TM Yaşı
- 4 Yıl 6 Ay 17 Gün
- Başarım Puanı
- 317
- Yaş
- 27
- MmoLira
- 1,573
- DevLira
- 0
Paylaşım için teşekkürler
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 1
- Görüntüleme
- 30
- Cevaplar
- 3
- Görüntüleme
- 68

