function parse_token($response) { $body = $response['body']; $token = Photonic_Processor::parse_parameters($body); return $token; }
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); } } } }