Hola de nuevo,
Dejo el código correspondiente del archivo problemático, y abajo adjunto el del include_once('fbapi/Authenticated_User.php').
Quería preguntar si sería posible que respondierais en inglés porque mis compañeros no entienden español (si no ya lo traduzco, no problem). Si nos decís qué hay que tocar estaría muy agradecido porque no nos sale :(. Nosotros hemos cambiado cosas y nada. Si podéis retocar los archivos sería genial para probarlos directo.
Hemos encontrado esto:
http://www.novalet.com/brion/post/fa...p-issue-solved http://www.foobots.net/breakouts.html
================================================== =================
include_once('fbapi/facebook.php');
include_once('fbapi/Authenticated_User.php'); // Finds if the current user installed this application or not
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true,
'oAuth' => true,
'fileUpload' => true
));
$user = $facebook->getUser(); // User id of the current Facebook user
//if(is_Authenticated_user($access))
$access = $facebook->getAccessToken();
//echo is_Authenticated_user();
//exit;
$perms = 'publish_stream,friends_events,create_event,user_e vents,rsvp_event,manage_pages,user_groups';
$loginUrl = $facebook->getLoginUrl(array('scope' => $perms, 'redirect_uri' => $redirect_Url));
/* Check that current user have all the wanted permissions */
if($user && $access){
$perms_fb = $facebook->api('/me/permissions?access_token='.$access);
$permissions = explode(',',$perms);
$check_all_perms = 0;
foreach($permissions as $key => $value){
if(!array_key_exists($value,$perms_fb['data'][0])){
$check_all_perms = 1;
}
}
}
/* If user does not have permission then use a javascript redirect...*/
if (!is_Authenticated_user($access) || $check_all_perms) {
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>"; // Authentication part
exit;
}
================================================== =======
Authenticated_User.php
function curl_get_file_contents($URL) {
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
$err = curl_getinfo($c,CURLINFO_HTTP_CODE);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
function is_Authenticated_user($access_tokan)
{
$graph_url = "https://graph.facebook.com/me?"
. "access_token=" . $access_tokan;
$response = curl_get_file_contents($graph_url);
$decoded_response = json_decode($response);
//print_r($decoded_response);exit;
//Check for errors
if (isset($decoded_response->error))
{
// check to see if this is an oAuth error:
if ($decoded_response->error->type== "OAuthException")
{
// Retrieving a valid access token.
$Authenticated_User = 0;
}
else
{
$Authenticated_User = 0;
}
}
else
{
// success
$Authenticated_User = 1;
}
return $Authenticated_User;
}
?>