Hybrid_Providers_Facebook use the Facebook PHP SDK created by Facebook http://hybridauth.sourceforge.net/userguide/IDProvider_info_Facebook.html
Inheritance: extends Hybrid_Provider_Model
Exemplo n.º 1
0
 /**
  * extends the user profile with photo url in better resolution
  */
 function getUserProfile()
 {
     parent::getUserProfile();
     if ($this->user && $this->user->profile && $this->user->profile->identifier) {
         $photoJsonUri = "https://graph.facebook.com/" . $this->user->profile->identifier . "/picture?width=350&height=350&redirect=false";
         $curl_handle = curl_init();
         curl_setopt($curl_handle, CURLOPT_URL, $photoJsonUri);
         curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
         curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($curl_handle, CURLOPT_USERAGENT, 'PxHybridAuth');
         $photoJson = curl_exec($curl_handle);
         $photoJsonObj = json_decode($photoJson);
         if (isset($photoJsonObj->data->url)) {
             $this->user->profile->photoURL = $photoJsonObj->data->url;
         }
     }
     return $this->user->profile;
 }
Exemplo n.º 2
0
 function __construct($providerId, $config, $params = NULL)
 {
     parent::__construct($providerId, $config, $params);
     // TODO: Change the autogenerated stub
     $this->user = new PxHybridAuth_Hybrid_User();
 }