Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** fbcmd.bak 2015-04-26 14:04:02.719292200 +0000
- --- fbcmd.php 2015-04-26 16:36:59.956286857 +0000
- ***************
- *** 578,584 ****
- if ($fbcmdCommand == 'RESET') {
- ValidateParamCount(0);
- if (file_exists($fbcmdAuthFileName)) {
- ! if (!unlink($fbcmdOldKeyFileName)) {
- FbcmdFatalError("Could not delete {$fbcmdAuthFileName}\n");
- }
- print "{$fbcmdAuthFileName} has been deleted\n";
- --- 578,584 ----
- if ($fbcmdCommand == 'RESET') {
- ValidateParamCount(0);
- if (file_exists($fbcmdAuthFileName)) {
- ! if (!unlink($fbcmdAuthFileName)) {
- FbcmdFatalError("Could not delete {$fbcmdAuthFileName}\n");
- }
- print "{$fbcmdAuthFileName} has been deleted\n";
- ***************
- *** 591,601 ****
- if ($fbcmdCommand == 'AUTH') {
- ValidateParamCount(1);
- ! GetOldSessionKey($fbcmdParams[1]);
- ! GenAuthInfoFromSessionKey();
- ! if (!isset($fbcmdAuthInfo['access_token'])) {
- ! FbcmdFatalError("Could not obtain oauth access_token");
- }
- SaveDataFile('authfile',$fbcmdAuthInfo);
- $facebook->setAccessToken($fbcmdAuthInfo['access_token']);
- try {
- --- 591,614 ----
- if ($fbcmdCommand == 'AUTH') {
- ValidateParamCount(1);
- ! $accessToken = $fbcmdParams[1];
- ! $exchangeTokenUrl = "https://graph.facebook.com/oauth/access_token".
- ! "?client_id={$fbcmdPrefs['appkey']}&client_secret={$fbcmdPrefs['appsecret']}".
- ! "&grant_type=fb_exchange_token&fb_exchange_token={$accessToken}";
- ! $response = file_get_contents($exchangeTokenUrl);
- ! if (!empty($response)) {
- ! $response_params = array();
- ! parse_str($response, $response_params);
- ! if (!empty($response_params['access_token'])) {
- ! $accessToken = $response_params['access_token'];
- ! if (!empty($response_params['expires'])) {
- ! print "\nObtained long-lived access token - you should be good until ".date("c",time()+$response_params['expires']).".\n\n";
- ! }
- ! }
- }
- + $fbcmdAuthInfo = array(
- + 'access_token' => $accessToken
- + );
- SaveDataFile('authfile',$fbcmdAuthInfo);
- $facebook->setAccessToken($fbcmdAuthInfo['access_token']);
- try {
- ***************
- *** 2079,2085 ****
- $fbcmdRefCache['timestamp'] = time();
- $fbcmdRefCache['username'] = array();
- GetRefArray('accounts','/me/accounts',true);
- ! GetRefArray('friends','/me/friends',true);
- GetRefArray('friendlists','/me/friendlists');
- GetRefArray('likes','/me/likes',true);
- GetRefArray('groups','/me/groups');
- --- 2092,2098 ----
- $fbcmdRefCache['timestamp'] = time();
- $fbcmdRefCache['username'] = array();
- GetRefArray('accounts','/me/accounts',true);
- ! GetRefArray('friends','/me/friends',false); // JT, username field no longer available
- GetRefArray('friendlists','/me/friendlists');
- GetRefArray('likes','/me/likes',true);
- GetRefArray('groups','/me/groups');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement