okapi r672
This commit is contained in:
@ -778,7 +778,7 @@ class Okapi
|
||||
{
|
||||
public static $data_store;
|
||||
public static $server;
|
||||
public static $revision = 669; # This gets replaced in automatically deployed packages
|
||||
public static $revision = 672; # This gets replaced in automatically deployed packages
|
||||
private static $okapi_vars = null;
|
||||
|
||||
/** Get a variable stored in okapi_vars. If variable not found, return $default. */
|
||||
@ -933,14 +933,14 @@ class Okapi
|
||||
return $dict;
|
||||
}
|
||||
|
||||
/** Returns something like "OpenCaching.PL" or "OpenCaching.DE". */
|
||||
/** Returns something like "Opencaching.PL" or "Opencaching.DE". */
|
||||
public static function get_normalized_site_name($site_url = null)
|
||||
{
|
||||
if ($site_url == null)
|
||||
$site_url = Settings::get('SITE_URL');
|
||||
$matches = null;
|
||||
if (preg_match("#^https?://(www.)?opencaching.([a-z.]+)/$#", $site_url, $matches)) {
|
||||
return "OpenCaching.".strtoupper($matches[2]);
|
||||
return "Opencaching.".strtoupper($matches[2]);
|
||||
} else {
|
||||
return "DEVELSITE";
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<p>A dictionary of the following structure:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<b>site_url</b> - URL of the OpenCaching site which is running
|
||||
<b>site_url</b> - URL of the Opencaching site which is running
|
||||
the OKAPI installation (usually this looks like
|
||||
"http://www.opencaching.<i>xx</i>/", where <b>xx</b> is a top
|
||||
level domain of a country).
|
||||
@ -21,10 +21,10 @@
|
||||
method URLs,
|
||||
</li>
|
||||
<li>
|
||||
<b>site_name</b> - international name of the OpenCaching site,
|
||||
<b>site_name</b> - international name of the Opencaching site,
|
||||
</li>
|
||||
<li><b>okapi_revision</b> - integer, an SVN revision of the OKAPI project
|
||||
installed on this OpenCaching site, <b>or null</b>, when could not
|
||||
installed on this Opencaching site, <b>or null</b>, when could not
|
||||
determine revision number.</li>
|
||||
</ul>
|
||||
</returns>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<p>A dictionary of the following structure:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<b>site_url</b> - URL of the OpenCaching site which is running
|
||||
<b>site_url</b> - URL of the Opencaching site which is running
|
||||
the OKAPI installation (usually this looks like
|
||||
"http://www.opencaching.<i>xx</i>/", where <b>xx</b> is a top
|
||||
level domain of a country).
|
||||
|
@ -41,7 +41,7 @@
|
||||
</opt>
|
||||
<opt name='ns_ox' default='false'>
|
||||
Boolean. If <b>true</b> then response will include Garmin's
|
||||
<a href='http://www.opencaching.com/xmlschemas/opencaching/1/0/opencaching.xsd'>OpenCaching.com
|
||||
<a href='http://www.opencaching.com/xmlschemas/opencaching/1/0/opencaching.xsd'>Opencaching.com
|
||||
GPX extension</a>. This namespace declares an extra <opencaching> element
|
||||
used by <a href='http://www.opencaching.com/'>Garmin's Opencaching.com</a>.
|
||||
The element includes information on cache difficulty, ratings, tags and images.
|
||||
|
@ -270,7 +270,7 @@
|
||||
<li>
|
||||
<p><b>last_found</b> - date and time (ISO 8601) when the
|
||||
geocache was last found <b>or null</b> when it hasn't been yet found.</p>
|
||||
<p>Note, that some OpenCaching servers don't store the exact times along
|
||||
<p>Note, that some Opencaching servers don't store the exact times along
|
||||
with the log entries.</p>
|
||||
</li>
|
||||
<li><b>last_modified</b> - date and time (ISO 8601) when the
|
||||
|
@ -3,7 +3,7 @@
|
||||
<issue-id>116</issue-id>
|
||||
<desc>
|
||||
<p>Given a set of URLs, determine codes of geocaches referenced within them.</p>
|
||||
<p>This might be useful if you have a link to an OpenCaching geocache page, but you're
|
||||
<p>This might be useful if you have a link to an Opencaching geocache page, but you're
|
||||
not able to extract cache code from such link (and you need the cache code to operate
|
||||
on a cache using OKAPI). Geocache pages may be referenced using various types of URLs,
|
||||
only some of them contain the cache code.</p>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<li><b>cache_code</b> - code of the cache which the log entry refers to,</li>
|
||||
<li>
|
||||
<p><b>date</b> - date and time (ISO 8601) when the log entry was submitted.</p>
|
||||
<p>Note, that some OpenCaching servers don't store the exact times along
|
||||
<p>Note, that some Opencaching servers don't store the exact times along
|
||||
with the log entries.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<li><b>uuid</b> - ID of the log entry,</li>
|
||||
<li>
|
||||
<p><b>date</b> - date and time (ISO 8601) when the log entry was submitted.</p>
|
||||
<p>Note, that some OpenCaching servers don't store the exact times along
|
||||
<p>Note, that some Opencaching servers don't store the exact times along
|
||||
with the log entries.</p>
|
||||
</li>
|
||||
<li><b>cache_code</b> - code of the geocache,</li>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<ul>
|
||||
<li>If he's not already logged in, he will be asked to do so.</li>
|
||||
<li>OKAPI will check if the User haven't previously granted your
|
||||
application access to his OpenCaching account.</li>
|
||||
application access to his Opencaching account.</li>
|
||||
<li>If User did not previously authorize your application, OKAPI
|
||||
will display an "Authorization Request" form to the User. User
|
||||
will be presented with a choice to allow or not to allow your
|
||||
@ -43,7 +43,7 @@
|
||||
<p>Pipe-separated list of ISO 639-1 language codes. This indicates the
|
||||
order of preference in which the language will be chosen for the authorization page.</p>
|
||||
<p>By default, OKAPI will display the page in the primary native language of local
|
||||
OpenCaching installation.</p>
|
||||
Opencaching installation.</p>
|
||||
</opt>
|
||||
<returns>
|
||||
<p>Technically, an HTTP 302 Redirect - it will direct user's browser to the OKAPI apps
|
||||
|
@ -3,11 +3,11 @@
|
||||
<issue-id>109</issue-id>
|
||||
<desc>
|
||||
<p><b>Beta status.</b> Get the list of changes to be replayed on your own copy
|
||||
of OpenCaching database. Use this method periodically (ex. once per hour) to
|
||||
of Opencaching database. Use this method periodically (ex. once per hour) to
|
||||
keep your database in sync with ours.</p>
|
||||
|
||||
<p>For some applications it might be desireable to have a quick access to the entire
|
||||
OpenCaching database (instead of querying for specific portions of it). You may use
|
||||
Opencaching database (instead of querying for specific portions of it). You may use
|
||||
OKAPI's <b>replicate</b> module to achive this effect. The <b>changelog</b> method
|
||||
is the primary replication service which you will use. However, to correctly set up
|
||||
your first database copy, you will need to use the <b>fulldump</b> method.</p>
|
||||
|
@ -6,7 +6,7 @@
|
||||
only once.</p>
|
||||
|
||||
<p>For some applications it might be desireable to have a quick access to the entire
|
||||
OpenCaching database (instead of querying for specific portions of it). You may use
|
||||
Opencaching database (instead of querying for specific portions of it). You may use
|
||||
OKAPI's <b>replicate</b> module to achive this condition. The <b>changelog</b> method
|
||||
is the primary replication service which you will use. However, to correctly set up
|
||||
your first database copy, you will need to use the <b>fulldump</b> method.</p>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<ul>
|
||||
<li><b>uuid</b> - ID of the user,</li>
|
||||
<li><b>username</b> - username (login) of the user,</li>
|
||||
<li><b>profile_url</b> - URL of the user's OpenCaching profile page,</li>
|
||||
<li><b>profile_url</b> - URL of the user's Opencaching profile page,</li>
|
||||
<li>
|
||||
<p><b>is_admin</b> - boolean; true is user has admin privileges.</p>
|
||||
<p>This value can be accessed only with <b>Level 3</b> Authentication
|
||||
|
@ -32,7 +32,7 @@ final class Settings
|
||||
'DEBUG' => false,
|
||||
|
||||
/**
|
||||
* Currently there are two mainstream branches of OpenCaching code.
|
||||
* Currently there are two mainstream branches of Opencaching code.
|
||||
* Which branch is you installation using?
|
||||
*
|
||||
* Possible values: "oc.pl" or "oc.de". (As far as we know, oc.us and
|
||||
@ -41,7 +41,7 @@ final class Settings
|
||||
'OC_BRANCH' => "oc.pl",
|
||||
|
||||
/**
|
||||
* Each OpenCaching site has a default language. I.e. the language in
|
||||
* Each Opencaching site has a default language. I.e. the language in
|
||||
* which all the names of caches are entered. What is the ISO 639-1 code
|
||||
* of this language? Note: ISO 639-1 codes are always lowercase.
|
||||
*
|
||||
|
@ -138,7 +138,7 @@ class View
|
||||
return new OkapiRedirectResponse($token['callback'].$callback_concat_char."error=access_denied");
|
||||
} else {
|
||||
# Consumer did not provide a callback URL (oauth_callback=oob).
|
||||
# We'll have to redirect to the OpenCaching main page then...
|
||||
# We'll have to redirect to the Opencaching main page then...
|
||||
return new OkapiRedirectResponse(Settings::get('SITE_URL')."index.php");
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<div class='okapi'>
|
||||
<a href='<?= $vars['okapi_base_url'] ?>'><img src='<?= $vars['okapi_base_url'] ?>static/logo-xsmall.gif' alt='OKAPI' style='float: right; margin-left: 10px;'></a>
|
||||
<a href='/'><img src="/images/oc_logo.png" alt='OpenCaching' style='float: left; margin-right: 10px'></a>
|
||||
<a href='/'><img src="/images/oc_logo.png" alt='Opencaching' style='float: left; margin-right: 10px'></a>
|
||||
<a class='opencaching'><?= $vars['site_name'] ?></a>
|
||||
|
||||
<div style='float: right; clear: right; margin: 10px 0 10px 30px'>
|
||||
|
@ -36,7 +36,7 @@ class View
|
||||
if (!$token)
|
||||
{
|
||||
# Probably Request Token has expired or it was already used. We'll
|
||||
# just redirect to the OpenCaching main page.
|
||||
# just redirect to the Opencaching main page.
|
||||
return new OkapiRedirectResponse(Settings::get('SITE_URL'));
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
<div class='okapi'>
|
||||
<a href='<?= $vars['okapi_base_url'] ?>'><img src='<?= $vars['okapi_base_url'] ?>static/logo-xsmall.gif' alt='OKAPI' style='float: right; margin-left: 10px;'></a>
|
||||
<a href='/'><img src="/images/oc_logo.png" alt='OpenCaching' style='float: left; margin-right: 10px'></a>
|
||||
<a href='/'><img src="/images/oc_logo.png" alt='Opencaching' style='float: left; margin-right: 10px'></a>
|
||||
<a class='opencaching'><?= $vars['site_name'] ?></a>
|
||||
|
||||
<h1 style='clear: both'><?= _("Access successfully granted") ?></h1>
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
<div class='okapi'>
|
||||
<a href='<?= $vars['okapi_base_url'] ?>'><img src='<?= $vars['okapi_base_url'] ?>static/logo-xsmall.gif' alt='OKAPI' style='float: right; margin-left: 10px;'></a>
|
||||
<a href='/'><img src="<?= $vars['okapi_base_url'] ?>static/oc_logo.png" alt='OpenCaching' style='float: left; margin-right: 10px'></a>
|
||||
<a href='/'><img src="<?= $vars['okapi_base_url'] ?>static/oc_logo.png" alt='Opencaching' style='float: left; margin-right: 10px'></a>
|
||||
<a class='opencaching'><?= $vars['site_name'] ?></a>
|
||||
|
||||
<h1 style='clear: both'><?= _("Your external applications") ?></h1>
|
||||
@ -50,7 +50,7 @@
|
||||
<?= sprintf(_("
|
||||
<p>Thanks to the <a href='%s'>OKAPI Framework</a> you can grant external applications
|
||||
access to your <b>%s</b> account. Currently no applications are authorized to act
|
||||
on your behalf. Once you start using external OpenCaching applications, they will appear here.</p>
|
||||
on your behalf. Once you start using external Opencaching applications, they will appear here.</p>
|
||||
"), $vars['okapi_base_url'], $vars['site_name']) ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@ If you're just getting to know OKAPI, you might want to check out
|
||||
(<a href='https://raw.github.com/wrygiel/okapi-browser/master/extras/screenshot.png'>screenshot</a>),
|
||||
a basic OAuth Console for OKAPI methods. It is an open-source project. You can
|
||||
<a href='https://github.com/wrygiel/okapi-browser'>fork it</a> on GitHub or simply
|
||||
<a href='http://usosphp.mimuw.edu.pl/~rygielski/okapi-browser/'>install it here</a>.
|
||||
<a href='http://opencaching.pl/download/okapi-browser/'>install it here</a>.
|
||||
|
||||
<h2 id='libraries'>Are there any client libraries?</h2>
|
||||
|
||||
@ -101,7 +101,7 @@ the <a href='<?= $vars['okapi_base_url'] ?>services/apisrv/installations.html'>a
|
||||
and <a href='<?= $vars['okapi_base_url'] ?>services/apiref/method_index.html'>apiref</a>
|
||||
modules to dynamically retrieve the current list of OKAPI installations and methods.
|
||||
<a href='https://github.com/wrygiel/okapi-browser'>Get the source</a> or
|
||||
<a href='http://usosphp.mimuw.edu.pl/~rygielski/okapi-browser/'>try it</a> first.</p>
|
||||
<a href='http://opencaching.pl/download/okapi-browser/'>try it</a> first.</p>
|
||||
|
||||
<h2 id='comments'>Comments</h2>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>OKAPI - OpenCaching API</title>
|
||||
<title>OKAPI - Opencaching API</title>
|
||||
<link rel="stylesheet" href="<?= $vars['okapi_base_url'] ?>static/common.css?<?= $vars['okapi_rev'] ?>">
|
||||
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script>
|
||||
<script>
|
||||
@ -22,17 +22,17 @@
|
||||
|
||||
<h1>
|
||||
The OKAPI Project
|
||||
<div class='subh1'>:: <b>OpenCaching API</b> Reference</div>
|
||||
<div class='subh1'>:: <b>Opencaching API</b> Reference</div>
|
||||
</h1>
|
||||
|
||||
<p><b>OKAPI</b> is a <b>public API</b> project for National OpenCaching sites (also known as
|
||||
OpenCaching Nodes).</p>
|
||||
<p><b>OKAPI</b> is a <b>public API</b> project for National Opencaching sites (also known as
|
||||
Opencaching Nodes).</p>
|
||||
<ul>
|
||||
<li>It provides OC site with a set of useful well-documented API methods,</li>
|
||||
<li>Allows external developers to easily <b>read public</b> OpenCaching data,</li>
|
||||
<li>Allows external developers to easily <b>read public</b> Opencaching data,</li>
|
||||
<li>Allows <b>read and write private</b> (user-related) data with OAuth 3-legged authentication.</li>
|
||||
</ul>
|
||||
<p>The project is aiming to become a standard API for all National OpenCaching.<i>xx</i> sites.
|
||||
<p>The project is aiming to become a standard API for all National Opencaching.<i>xx</i> sites.
|
||||
This OKAPI installation provides API for the
|
||||
<a href='<?= $vars['site_url']; ?>'><?= $vars['site_url']; ?></a> site.
|
||||
Check out other OKAPI installations:</p>
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
<h1>
|
||||
Sign up for an API Key
|
||||
<div class='subh1'>:: <b>OpenCaching API</b> Reference</div>
|
||||
<div class='subh1'>:: <b>Opencaching API</b> Reference</div>
|
||||
</h1>
|
||||
|
||||
<form id='signup'>
|
||||
|
@ -430,7 +430,7 @@ class View
|
||||
print "prefix), but it won't usually alter other tables in your\n";
|
||||
print "database. Still, sometimes we may change something\n";
|
||||
print "slightly (either to make OKAPI work properly OR as a part of\n";
|
||||
print "bigger \"international OpenCaching unification\" ideas).\n\n";
|
||||
print "bigger \"international Opencaching unification\" ideas).\n\n";
|
||||
print "We will let you know every time OKAPI alters database structure\n";
|
||||
print "(outside of the \"okapi_\" table-scope). If you have any comments\n";
|
||||
print "on this procedure, please submit them to our issue tracker.\n\n";
|
||||
|
Reference in New Issue
Block a user