'.$response['access_token'].''.$response['user'].''.esc_html__('Your authentication credentials are for the old Instagram API. Please reauthenticate to keep Photonic working.', 'photonic').'
'.esc_html__('Your authentication credentials are expiring soon. Please reauthenticate to keep Photonic working.', 'photonic').'
'.esc_html__('Your authentication credentials have expired! Please reauthenticate to keep Photonic working.', 'photonic').'
'.$cached_token['user'].''));
}
else {
$this->print_auth_done_all_good();
}
}
}
else if (!empty($auth['token'])) {
$this->print_auth_done_all_good();
}
echo "' . $access_token['oauth_token'] . '' . $access_token['oauth_token_secret'] . ''; esc_html_e('You have already set up your authentication. Unless you wish to regenerate the token this step is not required. ', 'photonic'); if (!empty($additional_msg)) { echo $additional_msg; } echo '
'; } private function get_login_button($provider) { return sprintf(esc_html__('Login and get Access Token from %s', 'photonic'), $provider); } function obtain_token() { $provider = sanitize_text_field($_POST['provider']); if ($provider == 'google') { $code = esc_attr($_POST['code']); require_once(PHOTONIC_PATH."/Modules/Google_Photos.php"); $module = Google_Photos::get_instance(); global $photonic_google_use_own_keys, $photonic_google_client_id, $photonic_google_client_secret; // if (!empty($photonic_google_use_own_keys) || (!empty($photonic_google_client_id) && !empty($photonic_google_client_secret))) { $response = Photonic::http($module->access_token_URL(), 'POST', [ 'code' => $code, 'grant_type' => 'authorization_code', 'client_id' => $module->client_id, 'client_secret' => $module->client_secret, 'redirect_uri' => admin_url('admin.php?page=photonic-auth&source=google'), ]); /* } else { $response = Photonic::http($module->access_token_URL(), 'POST', [ 'code' => $code, 'grant_type' => 'authorization_code', 'client_id' => $module->client_id, 'client_secret' => $module->client_secret, 'redirect_uri' => 'https://aquoid.com/photonic-router/google.php', 'state' => admin_url('admin.php?page=photonic-auth&source=google'), ]); }*/ if (!is_wp_error($response) && is_array($response)) { echo($response['body']); } else { } } else if ($provider == 'flickr') { require_once(PHOTONIC_PATH."/Modules/Flickr.php"); $module = Flickr::get_instance(); if (empty($_POST['oauth_token']) && empty($_POST['oauth_verifier'])) { $request_token = $module->get_request_token(admin_url('admin.php?page=photonic-auth&provider=flickr')); $authorize_url = $module->get_authorize_URL($request_token); $authorize_url .= '&perms=read'; $module->save_token($request_token); echo $authorize_url; } } else if ($provider == 'smug') { require_once(PHOTONIC_PATH."/Modules/SmugMug.php"); $module = SmugMug::get_instance(); if (empty($_POST['oauth_token']) && empty($_POST['oauth_verifier'])) { $request_token = $module->get_request_token(admin_url('admin.php?page=photonic-auth&provider=smug')); $authorize_url = $module->get_authorize_URL($request_token); $authorize_url .= '&Access=Full&Permissions=Read'; $module->save_token($request_token); echo $authorize_url; } } else if ($provider == 'zenfolio') { $module = Zenfolio::get_instance(); if (!empty($_POST['password'])) { $response = $module->authenticate($_POST['password']); if (!empty($response['error'])) { echo $response['error']; } else if (!empty($response['success'])) { esc_html_e('Authentication successful! All your galleries will be displayed with Authentication in place.', 'photonic'); } } } } }