function __construct()
 {
     global $photonic_slideshow_library, $photonic_custom_lightbox;
     if ($photonic_slideshow_library != 'custom') {
         $this->library = $photonic_slideshow_library;
     } else {
         $this->library = $photonic_custom_lightbox;
     }
     $this->nonce = Photonic_Processor::nonce();
     $this->oauth_timestamp = time();
     $this->oauth_version = '1.0';
     $this->show_more_link = false;
     $this->is_server_down = false;
     $this->is_more_required = true;
     $this->login_shown = false;
     $this->login_box_counter = 0;
     $this->gallery_index = 0;
 }
 function __construct()
 {
     parent::__construct();
     global $photonic_instagram_disable_title_link;
     $this->provider = 'zenfolio';
     $this->user_agent = "Photonic for " . get_home_url();
     $this->link_lightbox_title = empty($photonic_instagram_disable_title_link);
     $query_url = add_query_arg('dummy', 'dummy');
     $query_url = remove_query_arg('dummy');
     if (stripos($query_url, ':') === FALSE) {
         $protocol = 'http';
     } else {
         $protocol = substr($query_url, 0, stripos($query_url, ':'));
     }
     //$this->service_url = $protocol.'://api.zenfolio.com/api/1.6/zfapi.asmx';
     $this->service_url = 'http://api.zenfolio.com/api/1.8/zfapi.asmx';
     $this->secure_url = 'https://www.zenfolio.com/api/1.8/zfapi.asmx';
     $this->unlocked_realms = array();
 }
 /**
  * Tests to see if the OAuth Access Token that is cached is still valid. This is important because a user might have manually revoked
  * access for your app through the provider's control panel.
  *
  * @param $request_token
  * @return array|WP_Error
  */
 function check_access_token($request_token)
 {
     if ($this->provider == 'flickr') {
         $method = 'GET';
     } else {
         $method = 'POST';
     }
     $signature = $this->generate_signature($this->check_access_token_method(), array('method' => $this->check_access_token_method()), $method, $request_token);
     $parameters = array('oauth_consumer_key' => $this->api_key, 'oauth_nonce' => $this->nonce, 'oauth_signature' => $signature, 'oauth_signature_method' => $this->oauth_signature_method(), 'oauth_timestamp' => $this->oauth_timestamp, 'oauth_token' => $request_token['oauth_token'], 'oauth_version' => $this->oauth_version, 'method' => $this->check_access_token_method());
     $end_point = $this->end_point();
     if ($method == 'GET') {
         $end_point .= '?' . Photonic_Processor::build_query($parameters);
         $parameters = null;
     }
     $response = Photonic::http($end_point, $method, $parameters);
     return $response;
 }
 /**
  * Method to validate that the stored token is indeed authenticated.
  *
  * @param $request_token
  * @return array|WP_Error
  */
 function check_access_token($request_token)
 {
     $signed_parameters = $this->sign_call('https://api.500px.com/v1/users', 'GET', array());
     //		$end_point = $this->end_point();
     $end_point = 'https://api.500px.com/v1/users?' . Photonic_Processor::build_query($signed_parameters);
     $response = Photonic::http($end_point, 'GET', null);
     return $response;
 }
 function __construct()
 {
     parent::__construct();
 }
Example #6
0
 public function get_oauth2_access_token()
 {
     $parameters = Photonic_Processor::parse_parameters($_SERVER['QUERY_STRING']);
     global $photonic_picasa_client_secret, $photonic_instagram_client_secret;
     if (isset($parameters['code']) || isset($parameters['token']) && isset($parameters['state'])) {
         $state_args = explode('::', $parameters['state']);
         if ($state_args[0] == md5($photonic_picasa_client_secret . 'picasa')) {
             // Picasa response
             global $photonic_picasa_gallery;
             if (!isset($photonic_picasa_gallery)) {
                 $photonic_picasa_gallery = new Photonic_Picasa_Processor();
             }
             $photonic_picasa_gallery->get_access_token($parameters);
         } else {
             if ($state_args[0] == md5($photonic_instagram_client_secret . 'instagram')) {
                 // Instagram response
                 global $photonic_instagram_gallery;
                 if (!isset($photonic_instagram_gallery)) {
                     $photonic_instagram_gallery = new Photonic_Instagram_Processor();
                 }
                 $photonic_instagram_gallery->get_access_token($parameters);
             }
         }
     }
 }
 function get_google_plus_url($query_url)
 {
     // Try Google+
     $url = Photonic_Processor::get_normalized_http_url($query_url);
     $user_and_album = substr($url, strlen('https://picasaweb.google.com/data/feed/api/'));
     $user_and_album = explode('/', $user_and_album);
     foreach ($user_and_album as $key => $value) {
         if ($value == 'user' && isset($user_and_album[$key + 1])) {
             $user = $user_and_album[$key + 1];
         } else {
             if ($value == 'album' && isset($user_and_album[$key + 1])) {
                 $album = $user_and_album[$key + 1];
             }
         }
     }
     $query_args = substr($query_url, strlen($url));
     $new_url = '';
     if (isset($user) && isset($album)) {
         $new_url = 'https://plus.google.com/photos/' . $user . '/albums/' . $album . $query_args;
     }
     // https://plus.google.com/photos/104926144534698413096/albums/5818977512257357377
     return $new_url;
 }
 /**
  * Method to validate that the stored token is indeed authenticated.
  *
  * @param $request_token
  * @return array|WP_Error
  */
 function check_access_token($request_token)
 {
     $parameters = array('method' => $this->check_access_token_method(), 'format' => 'json', 'nojsoncallback' => 1);
     $signed_parameters = $this->sign_call($this->end_point(), 'GET', $parameters);
     $end_point = $this->end_point();
     $end_point .= '?' . Photonic_Processor::build_query($signed_parameters);
     $parameters = null;
     $response = Photonic::http($end_point, 'GET', $parameters);
     return $response;
 }