Пример #1
0
 function __construct()
 {
     global $globals;
     // syslog(LOG_INFO, "construct: ".$_SERVER["REQUEST_URI"]);
     $this->service = 'facebook';
     if ($globals['mobile_version']) {
         $server = 'm.facebook.com';
     } else {
         $server = 'www.facebook.com';
     }
     $this->facebook = new Facebook(array('appId' => $globals['facebook_key'], 'secret' => $globals['facebook_secret']));
     $this->user = $this->facebook->getUser();
     parent::__construct();
 }
Пример #2
0
 function __construct()
 {
     global $globals;
     $server = 'api.twitter.com';
     $this->request_token_url = "https://{$server}/oauth/request_token";
     $this->access_token_url = "https://{$server}/oauth/access_token";
     $this->authorize_url = "https://{$server}/oauth/authenticate";
     $this->credentials_url = "https://{$server}/1.1/account/verify_credentials.json";
     if (!$globals['oauth']['twitter']['consumer_key'] || !$globals['oauth']['twitter']['consumer_secret']) {
         $oauth = null;
     }
     $this->service = 'twitter';
     $this->oauth = new OAuth($globals['oauth']['twitter']['consumer_key'], $globals['oauth']['twitter']['consumer_secret'], OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
     parent::__construct();
 }
Пример #3
0
 function __construct()
 {
     global $globals;
     $this->service = 'facebook';
     if ($globals['mobile_version']) {
         $server = 'm.facebook.com';
     } else {
         $server = 'www.facebook.com';
     }
     // Store de FB URL for login
     $location_ok = urlencode('http://' . get_server_name() . $globals['base_url'] . 'oauth/fbconnect.php?op=ok' . '&t=' . time());
     $location_cancel = urlencode('http://' . get_server_name() . $globals['base_url'] . 'oauth/fbconnect.php?op=cancel' . '&t=' . time());
     $this->authorize_url = "http://{$server}/login.php?api_key=" . $globals['facebook_key'] . '&extern=1&fbconnect=1&return_session=1&v=1.0&next=' . $location_ok . '&cancel_url=' . $location_ok;
     parent::__construct();
 }
Пример #4
0
 function __construct()
 {
     global $globals;
     if (!$globals['oauth']['gplus']['consumer_key'] || !$globals['oauth']['gplus']['consumer_secret']) {
         $oauth = null;
     }
     $this->service = 'gplus';
     $callback = $globals['scheme'] . '//' . get_server_name() . $globals['base_url'] . 'oauth/signin.php?service=gplus';
     $this->client = new apiClient();
     $this->client->setClientId($globals['oauth']['gplus']['consumer_key']);
     $this->client->setClientSecret($globals['oauth']['gplus']['consumer_secret']);
     $this->client->setRedirectUri($callback);
     // $this->client->setApprovalPrompt('auto'); // TODO: pass to auto, check token is ok
     $this->client->setApplicationName("Menéame Login");
     $this->gplus = new apiPlusService($this->client);
     parent::__construct();
 }