-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathactivate.php
More file actions
executable file
·56 lines (50 loc) · 2.43 KB
/
activate.php
File metadata and controls
executable file
·56 lines (50 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
session_start();
class FbShield
{
protected $username;
protected $password;
function __construct($username, $password, $active){
$this->username = $username;
$this->password = $password;
$this->active = $active;
}
function token(){
return $this->generate();
}
function generate(){
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, 'https://b-api.facebook.com/method/auth.login?access_token=237759909591655%25257C0f140aabedfb65ac27a739ed1a2263b1&format=json&sdk_version=2&email='.$this->username.'&locale=en_US&password='.$this->password.'&sdk=ios&generate_session_cookies=1&sig=3f555f99fb61fcd7aa0c44f58f522ef6');
$res = curl_exec($curl);
curl_close($curl);
if(strpos($res, 'error')){
throw new Exception('Please Check Your Username and Password!');
}else{
return json_decode($res, true);
}
}
function data(){
return 'variables={"0":{"is_shielded":'.$this->active.',"session_id":"9b78191c-84fd-4ab6-b0aa-19b39f04a6bc","actor_id":'.$this->token()['uid'].',"client_mutation_id":"b0316dd6-3fd6-4beb-aed4-bb29c5dc64b0"}}&method=post&doc_id=1477043292367183&query_name=IsShieldedSetMutation&strip_defaults=true&strip_nulls=true&locale=en_US&client_country_code=US&fb_api_req_friendly_name=IsShieldedSetMutation&fb_api_caller_class=IsShieldedSetMutation';
}
function headers()
{
$header = array('Content-Type: application/x-www-form-urlencoded', 'Authorization: OAuth '.$this->token()['access_token'].'');
return $header;
}
function request()
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://graph.facebook.com/graphql');
curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers());
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $this->data());
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
curl_close($curl);
if(!$curl){
throw new Exception('Unknown error occured, Please Try Again.');
}
return ($this->active === "true") ? $_SESSION['msg'] = "<div class=\"alert alert-success\" role=\"alert\"><strong>Congratulations!</strong> Profile Guard Has Been Enabled!.</div>" : $_SESSION['msg'] = "<div class=\"alert alert-success\" role=\"alert\"><strong>Congratulations!</strong> Profile Guard Has Been Disabled!.</div> ";
}
}