OKAPI Project update (r1031)

This commit is contained in:
Wojciech Rygielski
2014-10-08 10:06:07 +02:00
parent 2becadb611
commit ccf5cf33a3
135 changed files with 19432 additions and 18479 deletions

View File

@@ -9,6 +9,7 @@ namespace okapi;
use Exception;
use ErrorException;
use ArrayObject;
use OAuthServerException;
use OAuthServer400Exception;
use OAuthServer401Exception;
@@ -183,9 +184,30 @@ class OkapiExceptionHandler
}
}
public static function removeSensitiveData($message)
{
return str_replace(
array(
Settings::get('DB_PASSWORD'),
"'".Settings::get('DB_USERNAME')."'",
Settings::get('DB_SERVER'),
"'".Settings::get('DB_NAME')."'"
),
array(
"******",
"'******'",
"******",
"'******'"
),
$message
);
}
public static function get_exception_info($e)
{
$exception_info = "===== ERROR MESSAGE =====\n".trim($e->getMessage())."\n=========================\n\n";
$exception_info = "===== ERROR MESSAGE =====\n"
.trim(self::removeSensitiveData($e->getMessage()))
."\n=========================\n\n";
if ($e instanceof FatalError)
{
# This one doesn't have a stack trace. It is fed directly to OkapiExceptionHandler::handle
@@ -196,7 +218,8 @@ class OkapiExceptionHandler
}
else
{
$exception_info .= "--- Stack trace ---\n".$e->getTraceAsString()."\n\n";
$exception_info .= "--- Stack trace ---\n".
self::removeSensitiveData($e->getTraceAsString())."\n\n";
}
$exception_info .= (isset($_SERVER['REQUEST_URI']) ? "--- OKAPI method called ---\n".
@@ -226,10 +249,8 @@ class OkapiErrorHandler
/** Handle error encountered while executing OKAPI request. */
public static function handle($severity, $message, $filename, $lineno)
{
if ($severity == E_STRICT) return false;
if (($severity == E_NOTICE || $severity == E_DEPRECATED) &&
!self::$treat_notices_as_errors)
{
if ($severity == E_STRICT || $severity == E_DEPRECATED) return false;
if (($severity == E_NOTICE) && !self::$treat_notices_as_errors) {
return false;
}
throw new ErrorException($message, 0, $severity, $filename, $lineno);
@@ -451,6 +472,16 @@ class Db
return $rs;
}
/**
* Return number of rows actually updated, inserted or deleted by the last
* statement executed with execute(). It DOES NOT return number of rows
* returned by the last select statement.
*/
public static function get_affected_row_count()
{
return mysql_affected_rows();
}
public static function field_exists($table, $field)
{
if (!preg_match("/[a-z0-9_]+/", $table.$field))
@@ -816,7 +847,7 @@ class Okapi
{
public static $data_store;
public static $server;
public static $revision = 938; # This gets replaced in automatically deployed packages
public static $revision = 1031; # 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. */
@@ -854,6 +885,18 @@ class Okapi
self::$okapi_vars[$varname] = $value;
}
/**
* Remove database passwords and other sensitive data from the given
* message (which is usually a trace, var_dump or print_r output).
*/
public static function removeSensitiveData($message)
{
# This method is initially defined in the OkapiExceptionHandler class,
# so that it is accessible even before the Okapi class is initialized.
return OkapiExceptionHandler::removeSensitiveData($message);
}
/** Send an email message to local OKAPI administrators. */
public static function mail_admins($subject, $message)
{
@@ -1406,10 +1449,10 @@ class Okapi
{
$chunks[] = "<null$attrs/>";
}
elseif (is_array($obj))
elseif (is_array($obj) || ($obj instanceof ArrayObject))
{
# Have to check if this is associative or not! Shit. I hate PHP.
if (array_keys($obj) === range(0, count($obj) - 1))
if (is_array($obj) && (array_keys($obj) === range(0, count($obj) - 1)))
{
# Not assoc.
$chunks[] = "<array$attrs>";
@@ -1433,7 +1476,7 @@ class Okapi
else
{
# That's a bug.
throw new Exception("Cannot encode as xmlmap2: " + print_r($obj, true));
throw new Exception("Cannot encode as xmlmap2: " . print_r($obj, true));
}
}
@@ -2001,9 +2044,17 @@ class OkapiHttpRequest extends OkapiRequest
if ($this->get_parameter('oauth_signature'))
{
# User is using OAuth. There is a cronjob scheduled to run every 5 minutes and
# delete old Request Tokens and Nonces. We may assume that cleanup was executed
# not more than 5 minutes ago.
# User is using OAuth.
# Check for duplicate keys in the parameters. (Datastore doesn't
# do that on its own, it caused vague server errors - issue #307.)
$this->get_parameter('oauth_consumer');
$this->get_parameter('oauth_version');
$this->get_parameter('oauth_token');
$this->get_parameter('oauth_nonce');
# Verify OAuth request.
list($this->consumer, $this->token) = Okapi::$server->
verify_request2($this->request, $this->opt_token_type, $this->opt_min_auth_level == 3);

View File

@@ -85,7 +85,7 @@ class OkapiDataStore extends OAuthDataStore
if ((preg_match("#^[a-z][a-z0-9_.-]*://#", $callback) > 0) ||
$callback == "oob")
{ /* ok */ }
else { throw new BadRequest("oauth_callback should begin with <scheme>://, or should equal 'oob'."); }
else { throw new BadRequest("oauth_callback should begin with lower case <scheme>://, or should equal 'oob'."); }
$token = new OkapiRequestToken(Okapi::generate_key(20), Okapi::generate_key(40),
$consumer->key, $callback, null, Okapi::generate_key(8, true));
Db::execute("

View File

@@ -34,6 +34,7 @@ use okapi\OkapiServiceRunner;
use okapi\OkapiInternalRequest;
use okapi\OkapiFacadeConsumer;
use okapi\OkapiFacadeAccessToken;
use okapi\Cache;
require_once($GLOBALS['rootpath']."okapi/core.php");
OkapiErrorHandler::$treat_notices_as_errors = true;
@@ -95,7 +96,7 @@ class Facade
*/
public static function import_search_set($temp_table, $min_store, $max_ref_age)
{
require_once 'services/caches/search/save.php';
require_once($GLOBALS['rootpath'].'okapi/services/caches/search/save.php');
$tables = array('caches', $temp_table);
$where_conds = array(
$temp_table.".cache_id = caches.cache_id",
@@ -172,4 +173,87 @@ class Facade
{
OkapiErrorHandler::reenable();
}
/**
* Store the object $value in OKAPI's cache, under the name of $key.
*
* Parameters:
*
* $key -- must be a string of max 57 characters in length (you can use
* md5(...) to shorten your keys). Use the same $key to retrieve your
* value later.
*
* $value -- can be any serializable PHP object. Currently there's no
* strict size limit, but try to keep it below 1 MB (for future
* compatibility with memcached).
*
* $timeout -- *maximum* time allowed to store the value, given in seconds
* (however, the value *can* be removed sooner than that, see the note
* below). Timeout can be also set to null, but you should avoid this,
* because such objects may clutter the cache unnecessarilly. (You must
* remember to remove them yourself!)
*
* Please note, that this cache is not guaranteed to be persistent.
* Usually it is, but it can be emptied in case of emergency (low disk
* space), or if we decide to switch the underlying cache engine in the
* future (e.g. to memcached). Most of your values should be safe though.
*/
public static function cache_set($key, $value, $timeout)
{
Cache::set("facade#".$key, $value, $timeout);
}
/** Same as `cache_set`, but works on many key->value pair at once. */
public static function cache_set_many($dict, $timeout)
{
$prefixed_dict = array();
foreach ($dict as $key => &$value_ref) {
$prefixed_dict["facade#".$key] = &$value_ref;
}
Cache::set_many($prefixed_dict, $timeout);
}
/**
* Retrieve object stored in cache under the name of $key. If object does
* not exist or its timeout has expired, return null.
*/
public static function cache_get($key)
{
return Cache::get("facade#".$key);
}
/** Same as `cache_get`, but it works on multiple keys at once. */
public static function get_many($keys)
{
$prefixed_keys = array();
foreach ($keys as $key) {
$prefixed_keys[] = "facade#".$key;
}
$prefixed_result = Cache::get_many($prefixed_keys);
$result = array();
foreach ($prefixed_result as $prefixed_key => &$value_ref) {
$result[substr($prefixed_key, 7)] = &$value_ref;
}
return $result;
}
/**
* Delete the entry named $key from the cache.
*/
public static function cache_delete($key)
{
Cache::delete("facade#".$key);
}
/** Same as `cache_delete`, but works on many keys at once. */
public static function cache_delete_many($keys)
{
$prefixed_keys = array();
foreach ($keys as $key) {
$prefixed_keys[] = "facade#".$key;
}
Cache::delete_many($prefixed_keys);
}
}
# (This comment is added here simply to debug OKAPI deployment.....)

View File

@@ -2,11 +2,11 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-10 12:30+0100\n"
"PO-Revision-Date: 2013-07-10 12:31+0100\n"
"Last-Translator: following <following@online.de>\n"
"POT-Creation-Date: 2014-01-23 15:51+0100\n"
"PO-Revision-Date: 2014-01-23 15:52+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"Language-Team: following <following@online.de>\n"
"Language: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -14,20 +14,29 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.5.5\n"
"X-Generator: Poedit 1.6.3\n"
"X-Poedit-SearchPath-0: c:\\source\\oc\\server-3.0\\htdocs\\okapi\n"
"X-Poedit-SearchPath-1: D:\\PRIV\\Projekty\\EclipseWorkspace\\opencaching-api"
"\\okapi\n"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:956
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:957
msgid "Stage"
msgstr "Station"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:1108
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:986
msgid "User location"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:989
#, php-format
msgid "Your own custom coordinates for the %s geocache"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1148
msgid "National Park / Landscape"
msgstr "Nationalpark / Landschaft"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:1260
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1300
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
@@ -35,7 +44,7 @@ msgid ""
msgstr ""
"Diese <a href='%s'>Cache</a>-Beschreibung stammt von <a href='%s'>%s</a>."
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:1272
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1312
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -46,7 +55,7 @@ msgstr ""
"creativecommons.org/licenses/by-nc-nd/3.0/de/'>CC-BY-NC-ND</a>, Stand: %s; "
"alle Logeinträge &copy; jeweiliger Autor"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:1283
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1323
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -57,63 +66,84 @@ msgstr ""
"creativecommons.org/licenses/by-nc-nd/3.0/de/'>CC-BY-NC-ND</a>; alle "
"Logeinträge &copy; jeweiliger Autor"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:31
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:60
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:360
msgid ""
"<b>Geocache coordinates have been changed.</b> They have been replaced with "
"your own custom coordinates which you have provided for this geocache."
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:366
msgid ""
"<b>Geocache coordinates have been changed.</b> Currently they point to one "
"of the alternate waypoints originally described as:"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:379
msgid "Original geocache location"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:381
#, php-format
msgid "Original (owner-supplied) location of the %s geocache"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:30
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:62
msgid "hidden by"
msgstr "versteckt von"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:62
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:64
#, php-format
msgid "%d recommendation"
msgid_plural "%d recommendations"
msgstr[0] "%d Empfehlung"
msgstr[1] "%d Empfehlungen"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:63
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:65
#, php-format
msgid "found %d time"
msgid_plural "found %d times"
msgstr[0] "%d mal gefunden"
msgstr[1] "%d mal gefunden"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:66
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:68
#, php-format
msgid "%d trackable"
msgid_plural "%d trackables"
msgstr[0] "%d Geokret"
msgstr[1] "%d Geokrets"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:70
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:72
msgid "Personal notes"
msgstr "Persönliche Notizen"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:74
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:76
msgid "Attributes"
msgstr "Attribute"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:78
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:80
msgid "Trackables"
msgstr "Geokrets"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:88
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:104
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:90
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:106
msgid "Images"
msgstr "Bilder"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:111
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:113
msgid "Spoilers"
msgstr "Spoiler"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:120
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:122
msgid "Image descriptions"
msgstr "Bildbeschreibungen"
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:128
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:130
msgid "The cache probably is located in the following protection areas:"
msgstr ""
"Der Geocache befindet sich wahrscheinlich in den folgenden Schutzgebieten:"
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:70
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:70
msgid ""
"You are trying to publish a log entry with a date in future. Cache log "
"entries are allowed to be published in the past, but NOT in the future."
@@ -121,7 +151,7 @@ msgstr ""
"Das Datum deines Logeintrags liegt in der Zukunft. Cache-Logs können nur für "
"die Vergangenheit oder für heute eingetragen werden."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:92
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:92
#, php-format
msgid ""
"However, your cache rating was ignored, because %s does not have a rating "
@@ -129,7 +159,7 @@ msgid ""
msgstr ""
"Deine Cachewertung wurde jedoch ignoriert, weil %s kein Bewertungssystem hat."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:111
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:111
#, php-format
msgid ""
"However, your cache recommendation was ignored, because %s does not allow "
@@ -138,7 +168,7 @@ msgstr ""
"Deine Empfehlung wurde jedoch ignoriert, weil auf %s keine Event-Caches "
"empfohlen werden können."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:125
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:125
#, php-format
msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not "
@@ -147,7 +177,7 @@ msgstr ""
"Deine Angabe \"benötigt Wartung\" wurde jedoch ignoriert, weil es diese "
"Funktion bei %s nicht gibt."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:145
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:145
msgid ""
"This cache is an Event cache. You cannot \"Find\" it (but you can attend it, "
"or comment on it)!"
@@ -155,7 +185,7 @@ msgstr ""
"Dies ist ein Event-Cache. Du kannst ihn nicht \"finden\" (aber du kannst am "
"Event teilnehmen oder einen Hinweis loggen)."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:150
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:150
msgid ""
"This cache is NOT an Event cache. You cannot \"Attend\" it (but you can find "
"it, or comment on it)!"
@@ -163,26 +193,26 @@ msgstr ""
"Dies ist KEIN Event-Cache. Du kannst an ihm nicht \"teilnehmen\" (aber du "
"kannst ihn finden oder kommentieren)."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:155
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:155
msgid "Your have to supply some text for your comment."
msgstr "Du musst einen Text für dein Hinweislog eingeben!"
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:168
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:168
msgid "This cache requires a password. You didn't provide one!"
msgstr ""
"Dieser Cache kann nur mit Kennwort geloggt werden, aber du hast keines "
"angegeben."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:170
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:170
msgid "Invalid password!"
msgstr "Ungültiges Kennwort!"
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:282
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:285
msgid "You have already submitted a log entry with exactly the same contents."
msgstr ""
"Du hast bereits einen Logeintrag mit genau dem gleichen Inhalt gemacht."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:305
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:308
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@@ -190,53 +220,53 @@ msgstr ""
"Du hast diesen Cache bereits als gefunden geloggt. Ein zweites Fundlog ist "
"nicht möglich, aber du kannst stattdessen einen Hinweis loggen."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:307
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:310
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr ""
"Als Besitzer des Caches kannst du nur Hinweise loggen, keine Funde oder "
"Nichtfunde."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:325
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:328
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr ""
"Du hast diesen Cache bereits bewertet. Deine Bewertung ist nicht änderbar."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:342
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:345
msgid "You have already recommended this cache once."
msgstr "Du hast diesen Cache bereits empfohlen."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:352
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:355
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
"Du musst mehr Caches finden, um eine weitere Bewertung abgeben zu können!"
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:395
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:398
msgid "Event caches cannot \"need maintenance\"."
msgstr "Event-Caches können keine \"Wartung benötigen\"."
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:525
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:528
msgid "Your cache log entry was posted successfully."
msgstr "Dein Log wurde veröffentlicht."
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:5
msgid "Authorization Form"
msgstr "Authorisierungs-Formular"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:46
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:46
msgid "Expired request"
msgstr "Anfrage abgelaufen"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:47
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:47
msgid "Unfortunately, the request has expired. Please try again."
msgstr ""
"Die Anfrage ist wegen Zeitüberschreitung abgelaufen. Bitte versuche es noch "
"einmal."
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:49
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:49
msgid "External application is requesting access..."
msgstr "Eine externe Anwendung wünscht Zugriff ..."
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:50
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:50
#, php-format
msgid ""
"<b>%s</b> wants to access your <b>%s</b> account. Do you agree to grant "
@@ -245,28 +275,29 @@ msgstr ""
"<b>%s</b> möchte auf dein <b>%s</b>-Benutzerkonto zugreifen. Möchtest du "
"dieser Anwendung Zugriff gewähren?"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:53
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:53
msgid "I agree"
msgstr "Ja"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:54
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:54
msgid "Decline"
msgstr "Nein"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:56
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:56
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Once permission is granted it is valid until its withdrawal on\n"
"\t\t\t\t\tthe <a href='%s'>applications management</a> page.</p>\n"
"\t\t\t\t\t<p>The application will access your acount via <a href='%s'>the "
"OKAPI Framework</a>.\n"
"\t\t\t\t\tIf you allow this request application will be able to access all "
"methods delivered\n"
"\t\t\t\t\tby the OKAPI Framework, i.e. post log entries on geocaches in your "
"name.\n"
"\t\t\t\t\tYou can revoke this permission at any moment.</p>\n"
"\t\t\t\t"
" <p>Once permission is granted it is valid until its "
"withdrawal on\n"
" the <a href='%s'>applications management</a> page.</p>\n"
" <p>The application will access your acount via <a "
"href='%s'>the OKAPI Framework</a>.\n"
" If you allow this request application will be able to "
"access all methods delivered\n"
" by the OKAPI Framework, i.e. post log entries on "
"geocaches in your name.\n"
" You can revoke this permission at any moment.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Wenn die Erlaubnis erteilt wurde, ist sie so lange gültig, bis "
@@ -281,23 +312,23 @@ msgstr ""
"\t\t\t\t\tDu kannst diese Erlaubnis jederzeit widerrufen.</p>\n"
"\t\t\t\t"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:5
msgid "Authorization Succeeded"
msgstr "Authorisierung erfolgreich"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:28
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:28
msgid "Access successfully granted"
msgstr "Zugang wurde gewährt"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:29
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:29
#, php-format
msgid ""
"\n"
"\t\t\t\t<p><b>You've just granted %s application access to your %s account.</"
"b>\n"
"\t\t\t\tTo complete the operation, go back to %s and enter the following PIN "
"code:</p>\n"
"\t\t\t"
" <p><b>You've just granted %s application access to your %s "
"account.</b>\n"
" To complete the operation, go back to %s and enter the "
"following PIN code:</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t<p><b>Du hast der Anwendung \"%s\" Zugriff auf dein %s-Benutzerkonto "
@@ -306,26 +337,26 @@ msgstr ""
"PIN-Code ein:</p>\n"
"\t\t\t"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:5
msgid "My Apps"
msgstr "Meine Apps"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:29
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:29
msgid "Your external applications"
msgstr "Deine externen Anwendungen"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:31
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:31
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>This is the list of applications which you granted access to "
"your <b>%s</b> account.\n"
"\t\t\t\t\tThis page gives you the abbility to revoke all previously granted "
"privileges.\n"
"\t\t\t\t\tOnce you click \"remove\" the application will no longer be able "
"to perform any\n"
"\t\t\t\t\tactions on your behalf.</p>\n"
"\t\t\t\t"
" <p>This is the list of applications which you granted "
"access to your <b>%s</b> account.\n"
" This page gives you the abbility to revoke all "
"previously granted privileges.\n"
" Once you click \"remove\" the application will no longer "
"be able to perform any\n"
" actions on your behalf.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Dies ist eine Liste der Anwendungen, denen du Zugriff auf dein "
@@ -336,21 +367,21 @@ msgstr ""
"Aktionen mehr unter deinem \t\t\t\t\tBenutzername ausführen können.</p>\n"
"\t\t\t\t"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:45
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:45
msgid "remove"
msgstr "entfernen"
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:50
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:50
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Thanks to the <a href='%s'>OKAPI Framework</a> you can grant "
"external applications\n"
"\t\t\t\t\taccess to your <b>%s</b> account. Currently no applications are "
"authorized to act\n"
"\t\t\t\t\ton your behalf. Once you start using external Opencaching "
"applications, they will appear here.</p>\n"
"\t\t\t\t"
" <p>Thanks to the <a href='%s'>OKAPI Framework</a> you "
"can grant external applications\n"
" access to your <b>%s</b> account. Currently no "
"applications are authorized to act\n"
" on your behalf. Once you start using external "
"Opencaching applications, they will appear here.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Die <a href='%s'>OKAPI-Schnittstelle</a> ermöglichst es dir, "

View File

@@ -2,11 +2,11 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-19 08:41+0100\n"
"PO-Revision-Date: 2013-07-19 08:46+0100\n"
"Last-Translator: faina09 <stefanocotterli@gmail.com>\n"
"POT-Creation-Date: 2014-01-23 15:53+0100\n"
"PO-Revision-Date: 2014-01-23 16:04+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"Language-Team: following <following@online.de>\n"
"Language: Italian\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -14,22 +14,31 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.5.7\n"
"X-Generator: Poedit 1.6.3\n"
"X-Poedit-SearchPath-0: c:\\source\\okapi\\following2\n"
"X-Poedit-SearchPath-1: D:\\PRIV\\Projekty\\EclipseWorkspace\\opencaching-api"
"\\okapi\n"
"X-Poedit-SearchPath-2: C:\\Users\\stefano.cotterli\\Desktop\\opencaching-"
"api\n"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/geocaches.php:956
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:957
msgid "Stage"
msgstr "Passo"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/geocaches.php:1111
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:986
msgid "User location"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:989
#, php-format
msgid "Your own custom coordinates for the %s geocache"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1148
msgid "National Park / Landscape"
msgstr "Parco Nazionale / Paesaggio"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/geocaches.php:1263
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1300
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
@@ -38,7 +47,7 @@ msgstr ""
"La deescrizione di questa <a href='%s'>geocache</a>proviene dal sito <a "
"href='%s'>%s</a>."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/geocaches.php:1275
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1312
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -46,7 +55,7 @@ msgid ""
"%s; all log entries &copy; their authors"
msgstr ""
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/geocaches.php:1286
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/geocaches.php:1323
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -54,62 +63,83 @@ msgid ""
"log entries &copy; their authors"
msgstr ""
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:31
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:60
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:360
msgid ""
"<b>Geocache coordinates have been changed.</b> They have been replaced with "
"your own custom coordinates which you have provided for this geocache."
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:366
msgid ""
"<b>Geocache coordinates have been changed.</b> Currently they point to one "
"of the alternate waypoints originally described as:"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:379
msgid "Original geocache location"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpx.php:381
#, php-format
msgid "Original (owner-supplied) location of the %s geocache"
msgstr ""
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:30
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:62
msgid "hidden by"
msgstr "nascosta da"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:62
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:64
#, php-format
msgid "%d recommendation"
msgid_plural "%d recommendations"
msgstr[0] "%d raccomandazione"
msgstr[1] "%d raccomandazioni"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:63
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:65
#, php-format
msgid "found %d time"
msgid_plural "found %d times"
msgstr[0] "trovata %d volta"
msgstr[1] "trovata %d volte"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:66
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:68
#, php-format
msgid "%d trackable"
msgid_plural "%d trackables"
msgstr[0] "%d travel bug"
msgstr[1] "%d travel bugs"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:70
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:72
msgid "Personal notes"
msgstr "Note personali"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:74
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:76
msgid "Attributes"
msgstr "Attributi"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:78
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:80
msgid "Trackables"
msgstr "Travel bugs"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:88
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:104
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:90
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:106
msgid "Images"
msgstr "Immagini"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:111
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:113
msgid "Spoilers"
msgstr "Spoiler"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:120
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:122
msgid "Image descriptions"
msgstr "Descrizione immagine"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/caches/formatters/gpxfile.tpl.php:128
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/caches/formatters/gpxfile.tpl.php:130
msgid "The cache probably is located in the following protection areas:"
msgstr "La cache probabilmente &egrave; situata nelle seguenti aree protette:"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:70
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:70
msgid ""
"You are trying to publish a log entry with a date in future. Cache log "
"entries are allowed to be published in the past, but NOT in the future."
@@ -117,7 +147,7 @@ msgstr ""
"Hai cercato di pubblicare un log con una data nel futuro. E' permsso loggare "
"una cache con una data passata, ma NON futura."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:92
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:92
#, php-format
msgid ""
"However, your cache rating was ignored, because %s does not have a rating "
@@ -126,7 +156,7 @@ msgstr ""
"Tuttavia, la tua valutazione della cache sarà ignorata, perché %s non ha un "
"sistema di valutazione."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:111
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:111
#, php-format
msgid ""
"However, your cache recommendation was ignored, because %s does not allow "
@@ -135,7 +165,7 @@ msgstr ""
"Tuttavia, la tua valutazione della cache sarà ignorata, perché %s non ha "
"permette la valutazione di cache evento."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:125
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:125
#, php-format
msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not "
@@ -144,7 +174,7 @@ msgstr ""
"Tuttavia, la tua segnalazione di \"manutenzione necessaria\" sarà ignorata, "
"perché %s non supporta questa opzione."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:145
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:145
msgid ""
"This cache is an Event cache. You cannot \"Find\" it (but you can attend it, "
"or comment on it)!"
@@ -152,7 +182,7 @@ msgstr ""
"Questa cache è una cache Evento. Non puoi \"Trovarla\" (ma puoi partecipare, "
"o commentare l'evento)!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:150
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:150
msgid ""
"This cache is NOT an Event cache. You cannot \"Attend\" it (but you can find "
"it, or comment on it)!"
@@ -160,23 +190,23 @@ msgstr ""
"Questa cache NON è una cache Evento. Non puoi \"Partecipare\" (ma puoi "
"trovarla, o inserirci un commento)!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:155
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:155
msgid "Your have to supply some text for your comment."
msgstr "Devi inserire del testo per il tuo commento."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:168
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:168
msgid "This cache requires a password. You didn't provide one!"
msgstr "Questa cache richiede una password, ma non ne hai fornita nessuuna."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:170
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:170
msgid "Invalid password!"
msgstr "Password non valida!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:282
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:285
msgid "You have already submitted a log entry with exactly the same contents."
msgstr "Hai già inserito un log esattamente con lo stesso contenuto."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:305
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:308
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@@ -184,49 +214,49 @@ msgstr ""
"Hai già inserito un log \"Trovata\". Adesso puoi inserire solamente "
"\"Commenti\"!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:307
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:310
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr "Sei il proprietario della cache. Puoi inserire solamente \"Commenti\"!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:325
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:328
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr ""
"Hai giàvalutato questa cache. La tua valutazione non può essere cambiata."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:342
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:345
msgid "You have already recommended this cache once."
msgstr "Hai già raccmandato questa cache."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:352
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:355
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
"Non hai possibilità di dare raccomandazioni. Prima devio trovare altre cache!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:395
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:398
msgid "Event caches cannot \"need maintenance\"."
msgstr "Le cache evento non necessitano di manutenzione!"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/services/logs/submit.php:525
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/services/logs/submit.php:528
msgid "Your cache log entry was posted successfully."
msgstr "Il tuo log sulla cache è stato correttamente inserito."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:5
msgid "Authorization Form"
msgstr "Modulo di autorizzazione"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:46
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:46
msgid "Expired request"
msgstr "Richiesta scaduta"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:47
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:47
msgid "Unfortunately, the request has expired. Please try again."
msgstr "Sfortunatamente, la richiesta è scaduta. Per favore riprova."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:49
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:49
msgid "External application is requesting access..."
msgstr "Una applicazione esterna sta richiedendo l'accesso."
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:50
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:50
#, php-format
msgid ""
"<b>%s</b> wants to access your <b>%s</b> account. Do you agree to grant "
@@ -235,122 +265,118 @@ msgstr ""
"<b>%s</b> vuole accedere al tuo account <b>%s</b>. Sei d'accordo nel "
"concedere l'accesso a questa applicazione?"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:53
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:53
msgid "I agree"
msgstr "Sono d'accordo"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:54
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:54
msgid "Decline"
msgstr "No"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorize.tpl.php:56
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorize.tpl.php:56
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Once permission is granted it is valid until its withdrawal on\n"
"\t\t\t\t\tthe <a href='%s'>applications management</a> page.</p>\n"
"\t\t\t\t\t<p>The application will access your acount via <a href='%s'>the "
"OKAPI Framework</a>.\n"
"\t\t\t\t\tIf you allow this request application will be able to access all "
"methods delivered\n"
"\t\t\t\t\tby the OKAPI Framework, i.e. post log entries on geocaches in your "
"name.\n"
"\t\t\t\t\tYou can revoke this permission at any moment.</p>\n"
"\t\t\t\t"
" <p>Once permission is granted it is valid until its "
"withdrawal on\n"
" the <a href='%s'>applications management</a> page.</p>\n"
" <p>The application will access your acount via <a "
"href='%s'>the OKAPI Framework</a>.\n"
" If you allow this request application will be able to "
"access all methods delivered\n"
" by the OKAPI Framework, i.e. post log entries on "
"geocaches in your name.\n"
" You can revoke this permission at any moment.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Una volta concessa, l'autorizzazoine è valida finché non venga\n"
"\t\t\t\t\trevocata nella pagina di <a href='%s'>gestione applicazioni</a>.</"
"p>\n"
"\t\t\t\t\t<p>L'applicazione accederà al tuo account tramite il <a "
"href='%s'>frameword OKAPI</a>.\n"
"\t\t\t\t\tSe permetti questa richiesta, l'applicazione potrà accedere a "
"tutti i metodi forniti\n"
"\t\t\t\t\tdal framework OKAPI, per es. postare i log delle geocache a tuo "
"nome..\n"
"\t\t\t\t\tPuoi revocare questo permesso in qualsiasi momento.</p>\n"
"\t\t\t\t"
"<p>Una volta concessa, l'autorizzazoine è valida finché non venga\n"
"revocata nella pagina di <a href='%s'>gestione applicazioni</a>.</p>\n"
"<p>L'applicazione accederà al tuo account tramite il <a href='%s'>frameword "
"OKAPI</a>.\n"
"Se permetti questa richiesta, l'applicazione potrà accedere a tutti i metodi "
"forniti\n"
"dal framework OKAPI, per es. postare i log delle geocache a tuo nome..\n"
"Puoi revocare questo permesso in qualsiasi momento.</p>"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorized.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:5
msgid "Authorization Succeeded"
msgstr "Autorizzazione concessa"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorized.tpl.php:28
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:28
msgid "Access successfully granted"
msgstr "Accesso correttamente consentito"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/authorized.tpl.php:29
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/authorized.tpl.php:29
#, php-format
msgid ""
"\n"
"\t\t\t\t<p><b>You've just granted %s application access to your %s account.</"
"b>\n"
"\t\t\t\tTo complete the operation, go back to %s and enter the following PIN "
"code:</p>\n"
"\t\t\t"
" <p><b>You've just granted %s application access to your %s "
"account.</b>\n"
" To complete the operation, go back to %s and enter the "
"following PIN code:</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t<p><b>Hai appena concesso all'applicazione \"%s\" l'accesso al tuo "
"account %s.</b>\n"
"\t\t\t\tPer completare l'operazione, riorna a %s e inserisci il seguente "
"codice PIN:</p>\n"
"\t\t\t"
"<p><b>Hai appena concesso all'applicazione \"%s\" l'accesso al tuo account "
"%s.</b>\n"
"Per completare l'operazione, riorna a %s e inserisci il seguente codice PIN:"
"</p>"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/index.tpl.php:5
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:5
msgid "My Apps"
msgstr "Mie App"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/index.tpl.php:29
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:29
msgid "Your external applications"
msgstr "Le tue applicazioni esterne"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/index.tpl.php:31
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:31
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>This is the list of applications which you granted access to "
"your <b>%s</b> account.\n"
"\t\t\t\t\tThis page gives you the abbility to revoke all previously granted "
"privileges.\n"
"\t\t\t\t\tOnce you click \"remove\" the application will no longer be able "
"to perform any\n"
"\t\t\t\t\tactions on your behalf.</p>\n"
"\t\t\t\t"
" <p>This is the list of applications which you granted "
"access to your <b>%s</b> account.\n"
" This page gives you the abbility to revoke all "
"previously granted privileges.\n"
" Once you click \"remove\" the application will no longer "
"be able to perform any\n"
" actions on your behalf.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Questa è la lista delle applicazioni a cui hai concesso "
"l'accesso al tuo account <b>%s</b.\n"
"\t\t\t\t\tQuesta pagina ti da la possibilità di revocare tutti privilegi "
"<p>Questa è la lista delle applicazioni a cui hai concesso l'accesso al tuo "
"account <b>%s</b.\n"
"Questa pagina ti da la possibilità di revocare tutti privilegi "
"precedentemente concessi.\n"
"\t\t\t\t\tQundo clicchi su \"rimuovi\" all'applicazione non sarà più "
"concesso eseguire nessuna\n"
" \t\t\t\t\tazione per tuo conto.</p>\n"
"\t\t\t\t"
"Qundo clicchi su \"rimuovi\" all'applicazione non sarà più concesso eseguire "
"nessuna\n"
"azione per tuo conto.</p>"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/index.tpl.php:45
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:45
msgid "remove"
msgstr "entfernen"
#: C:\Users\stefano.cotterli\Desktop\opencaching-api/okapi/views/apps/index.tpl.php:50
#: D:\PRIV\Projekty\EclipseWorkspace\opencaching-api\okapi/views/apps/index.tpl.php:50
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Thanks to the <a href='%s'>OKAPI Framework</a> you can grant "
"external applications\n"
"\t\t\t\t\taccess to your <b>%s</b> account. Currently no applications are "
"authorized to act\n"
"\t\t\t\t\ton your behalf. Once you start using external Opencaching "
"applications, they will appear here.</p>\n"
"\t\t\t\t"
" <p>Thanks to the <a href='%s'>OKAPI Framework</a> you "
"can grant external applications\n"
" access to your <b>%s</b> account. Currently no "
"applications are authorized to act\n"
" on your behalf. Once you start using external "
"Opencaching applications, they will appear here.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Grazie al <a href='%s'>framework OKAPI</a>puoi concedere ad "
"applicazioni esterne\n"
"\t\t\t\t\t l'accesso al tuo account <b>%s</b>. Attualmente non ci son "
"applicazioni autorizzate\n"
"\t\t\t\t\tad agire per tuo conto. Quando userai applicazioni esterne a "
"Opencaching, queste appariranno qui</p>\n"
"\t\t\t\t"
"<p>Grazie al <a href='%s'>framework OKAPI</a>puoi concedere ad applicazioni "
"esterne\n"
"l'accesso al tuo account <b>%s</b>. Attualmente non ci son applicazioni "
"autorizzate\n"
"ad agire per tuo conto. Quando userai applicazioni esterne a Opencaching, "
"queste appariranno qui</p>\n"
" "
#~ msgid "Recommending is allowed only for 'Found it' logtypes."
#~ msgstr "Le raccomandazioni sono ammesse solo per i log di tipo 'Trovata'"

View File

@@ -2,9 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-04-10 01:08+0100\n"
"PO-Revision-Date: 2013-04-10 01:12+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"POT-Creation-Date: 2014-01-23 16:05+0100\n"
"PO-Revision-Date: 2014-08-09 03:47+0100\n"
"Last-Translator: Harrie Klomp <harrie@harrieklomp.be>\n"
"Language-Team: \n"
"Language: nl_NL\n"
"MIME-Version: 1.0\n"
@@ -13,50 +13,96 @@ msgstr ""
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: D:\\PRIV\\Projekty\\EclipseWorkspace\\opencaching-api\\\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.5\n"
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-SearchPath-0: .\n"
# For additional waypoints. As in "Stage 1: Parking".
#: okapi/services/caches/geocaches.php:846
#: okapi/services/caches/geocaches.php:957
msgid "Stage"
msgstr "Etappe"
#: okapi/services/caches/geocaches.php:1009
#: okapi/services/caches/geocaches.php:986
msgid "User location"
msgstr "Gebruikers locatie"
#: okapi/services/caches/geocaches.php:989
#, php-format
msgid "Your own custom coordinates for the %s geocache"
msgstr "Eigen gecorrigeerde coördinaten voor %s geocache"
#: okapi/services/caches/geocaches.php:1148
msgid "National Park / Landscape"
msgstr "Nationaal park / Landschap"
#: okapi/services/caches/geocaches.php:1300
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
"a> site."
msgstr ""
"Deze <a href='%s'>geocache</a> beschrijving komt van de <a href='%s'>%s</a> "
"\"\"site."
#: okapi/services/caches/geocaches.php:1021
#, php-format
#: okapi/services/caches/geocaches.php:1312
#, fuzzy, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>, as of "
"%s; all log entries &copy; their authors"
msgstr ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en'>CC-BY-NC-ND</a>, as of "
"%s; all log entries &copy; their authors"
#: okapi/services/caches/geocaches.php:1032
#, php-format
#: okapi/services/caches/geocaches.php:1323
#, fuzzy, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>; all "
"log entries &copy; their authors"
msgstr ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en'>CC-BY-NC-ND</a>; all "
"log entries &copy; their authors"
#: okapi/services/caches/formatters/gpxfile.tpl.php:31
#: okapi/services/caches/formatters/gpxfile.tpl.php:48
#: okapi/services/caches/formatters/gpx.php:360
msgid ""
"<b>Geocache coordinates have been changed.</b> They have been replaced with "
"your own custom coordinates which you have provided for this geocache."
msgstr ""
"Geocache coördinaten zijn veranderd.</b> Deze zijn aangepast door "
"coördinaten die je zelf hebt gewijzigd voor deze geocache."
#: okapi/services/caches/formatters/gpx.php:366
msgid ""
"<b>Geocache coordinates have been changed.</b> Currently they point to one "
"of the alternate waypoints originally described as:"
msgstr ""
"Geocache coördinaten zijn veranderd.</b> Momenteel wijzen zij een van de "
"alternatieve waypoints oorspronkelijk beschreven als:"
#: okapi/services/caches/formatters/gpx.php:379
msgid "Original geocache location"
msgstr "Orginele geocache locatie"
#: okapi/services/caches/formatters/gpx.php:381
#, php-format
msgid "Original (owner-supplied) location of the %s geocache"
msgstr "Originele (opgegeven door plaatser) locatie van de %s geocache"
#: okapi/services/caches/formatters/gpxfile.tpl.php:30
#: okapi/services/caches/formatters/gpxfile.tpl.php:62
msgid "hidden by"
msgstr "geplaatst door"
#: okapi/services/caches/formatters/gpxfile.tpl.php:50
#: okapi/services/caches/formatters/gpxfile.tpl.php:64
#, php-format
msgid "%d recommendation"
msgid_plural "%d recommendations"
msgstr[0] "%d aanbeveling"
msgstr[1] "%d aanbevelingen"
#: okapi/services/caches/formatters/gpxfile.tpl.php:51
#: okapi/services/caches/formatters/gpxfile.tpl.php:65
#, php-format
msgid "found %d time"
msgid_plural "found %d times"
@@ -64,37 +110,42 @@ msgstr[0] "%d keer gevonden"
msgstr[1] "%d keren gevonden"
# Generic term for trackable items (like geocoins and travelbugs).
#: okapi/services/caches/formatters/gpxfile.tpl.php:54
#: okapi/services/caches/formatters/gpxfile.tpl.php:68
#, php-format
msgid "%d trackable"
msgid_plural "%d trackables"
msgstr[0] "%d trackable"
msgstr[1] "%d trackables"
#: okapi/services/caches/formatters/gpxfile.tpl.php:58
#: okapi/services/caches/formatters/gpxfile.tpl.php:72
msgid "Personal notes"
msgstr "Persoonlijke notities"
#: okapi/services/caches/formatters/gpxfile.tpl.php:62
#: okapi/services/caches/formatters/gpxfile.tpl.php:76
msgid "Attributes"
msgstr "Attributen"
#: okapi/services/caches/formatters/gpxfile.tpl.php:66
#: okapi/services/caches/formatters/gpxfile.tpl.php:80
msgid "Trackables"
msgstr "Trackables"
#: okapi/services/caches/formatters/gpxfile.tpl.php:84
#: okapi/services/caches/formatters/gpxfile.tpl.php:90
#: okapi/services/caches/formatters/gpxfile.tpl.php:106
msgid "Images"
msgstr "Afbeeldingen"
#: okapi/services/caches/formatters/gpxfile.tpl.php:91
#: okapi/services/caches/formatters/gpxfile.tpl.php:113
msgid "Spoilers"
msgstr "Spoilers"
#: okapi/services/caches/formatters/gpxfile.tpl.php:99
#: okapi/services/caches/formatters/gpxfile.tpl.php:122
msgid "Image descriptions"
msgstr "Afbeelding omschrijving"
#: okapi/services/caches/formatters/gpxfile.tpl.php:130
msgid "The cache probably is located in the following protection areas:"
msgstr "De cache is waarschijnlijk in een volgend beschermd gebied geplaatst:"
#: okapi/services/logs/submit.php:70
msgid ""
"You are trying to publish a log entry with a date in future. Cache log "
@@ -112,40 +163,59 @@ msgstr ""
"De cachewaardering is genegeerd, omdat %s geen waarderingen in het systeem "
"heeft."
#: okapi/services/logs/submit.php:113
#: okapi/services/logs/submit.php:111
#, php-format
msgid ""
"However, your cache recommendation was ignored, because %s does not allow "
"recommending event caches."
msgstr ""
"De cachewaardering is genegeerd, omdat %s geen waarderingen op evenementen "
"ondersteund."
#: okapi/services/logs/submit.php:125
#, php-format
msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not "
"support this feature."
msgstr ""
"Maar jouw \"Heeft onderhoud nodig\" log is genegeerd omdat %s dit niet "
"ondersteunt."
# The user will see this error when he is trying to submit a "Fount it" entry on an event cache. "Attended" or "Will attend" log entries are not the same as "Found it". Currently OKAPI does not allow to submit "Attended" nor "Will attend" log entries, that's why user can only "Comment" on it.
#: okapi/services/logs/submit.php:131
# Missing "you can attend it"
#: okapi/services/logs/submit.php:145
msgid ""
"This cache is an Event cache. You cannot \"Find it\"! (But - you may "
"\"Comment\" on it.)"
"This cache is an Event cache. You cannot \"Find\" it (but you can attend it, "
"or comment on it)!"
msgstr ""
"Dit is een eventcache. Deze kan niet als \"Gevonden\" gelogd worden. Maar "
"wel als \"Notitie\"."
"Dit is een evenement. Deze kan niet als \"Gevonden\" gelogd worden. (maar "
"wel deelgenomen of een notitie plaatsen)."
#: okapi/services/logs/submit.php:133
#: okapi/services/logs/submit.php:150
msgid ""
"This cache is NOT an Event cache. You cannot \"Attend\" it (but you can find "
"it, or comment on it)!"
msgstr ""
"Deze cache is GEEN evenement. Je kunt niet \"Deelnemen\" (maar wel als "
"gevonden loggen of een notitie plaatsen)"
#: okapi/services/logs/submit.php:155
msgid "Your have to supply some text for your comment."
msgstr "Er dient enige tekst ingevuld te worden."
#: okapi/services/logs/submit.php:146
#: okapi/services/logs/submit.php:168
msgid "This cache requires a password. You didn't provide one!"
msgstr "Deze cache vraagt om een wachtwoord. Deze is niet opgegeven!"
#: okapi/services/logs/submit.php:148
#: okapi/services/logs/submit.php:170
msgid "Invalid password!"
msgstr "Verkeerd wachtwoord!"
# This error will be shown to the user when he tries to submit a log entry which is EXACTLY the same as one he had submitted before.
#: okapi/services/logs/submit.php:260
#: okapi/services/logs/submit.php:285
msgid "You have already submitted a log entry with exactly the same contents."
msgstr "Deze log is reeds met dezelfde tekst verzonden."
#: okapi/services/logs/submit.php:279
#: okapi/services/logs/submit.php:308
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@@ -153,25 +223,29 @@ msgstr ""
"Je hebt deze cache al als \"Gevonden\" gelogd. Je kunt nu wel een \"Notitie"
"\" plaatsen."
# The English text was changed from "you cannot rate it" to "you cannot find it". The translation remained.
#: okapi/services/logs/submit.php:281
#: okapi/services/logs/submit.php:310
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr ""
"Je bent eigenaar van deze cache. Je kunt alleen een \"Notitie\" plaatsen."
#: okapi/services/logs/submit.php:299
#: okapi/services/logs/submit.php:328
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr ""
"Je hebt deze cache al gewaardeerd. De waardering kan niet veranderd worden."
#: okapi/services/logs/submit.php:316
#: okapi/services/logs/submit.php:345
msgid "You have already recommended this cache once."
msgstr ""
msgstr "Je hebt al een aanbeveling op deze cache gegeven."
#: okapi/services/logs/submit.php:323
#: okapi/services/logs/submit.php:355
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
msgstr "Je kunt geen aanbeveling meer geven. Vind eerst meer caches."
#: okapi/services/logs/submit.php:491
#: okapi/services/logs/submit.php:398
msgid "Event caches cannot \"need maintenance\"."
msgstr "Evenementen hebben geen \"onderhoud nodig"
#: okapi/services/logs/submit.php:528
msgid "Your cache log entry was posted successfully."
msgstr "De log is succesvol verzonden."
@@ -208,35 +282,33 @@ msgstr "Toestemmen"
msgid "Decline"
msgstr "Afwijzen"
# This should begin with "\n", but you may ignore the rest of \n and \r characters.
# This should begin with "\n", but you may ignore the rest of \n characters.
# This message is shown to the user when external application is trying to get user's permission to access his account.
# Sample: http://i.imgur.com/ZCJNT.png
#: okapi/views/apps/authorize.tpl.php:56
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Once permission is granted it is valid until its withdrawal on\n"
"\t\t\t\t\tthe <a href='%s'>applications management</a> page.</p>\n"
"\t\t\t\t\t<p>The application will access your acount via <a href='%s'>the "
"OKAPI Framework</a>.\n"
"\t\t\t\t\tIf you allow this request application will be able to access all "
"methods delivered\n"
"\t\t\t\t\tby the OKAPI Framework, i.e. post log entries on geocaches in your "
"name.\n"
"\t\t\t\t\tYou can revoke this permission at any moment.</p>\n"
"\t\t\t\t"
" <p>Once permission is granted it is valid until its "
"withdrawal on\n"
" the <a href='%s'>applications management</a> page.</p>\n"
" <p>The application will access your acount via <a "
"href='%s'>the OKAPI Framework</a>.\n"
" If you allow this request application will be able to "
"access all methods delivered\n"
" by the OKAPI Framework, i.e. post log entries on "
"geocaches in your name.\n"
" You can revoke this permission at any moment.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Wanneer toegestemd is blijft deze geldig tot intrekking op\n"
"\t\t\t\t\tde <a href='%s'>toepassingsbeheer</a> pagina.</p>\n"
"\t\t\t\t\t<p>De toepassing zal toegang krijgen via jouw account op <a "
"href='%s'>the OKAPI Framework</a>.\n"
"\t\t\t\t\tWanneer je toestemming geeft voor deze toepassing zullen de "
"mogelijkheden\n"
"\t\t\t\t\tvan OKAPI Framework toegepast worden, b.v. het loggen van een "
"cache.\n"
"\t\t\t\t\tDe toestemming kan elk moment ingetrokken worden.</p>\n"
"\t\t\t\t"
"<p>Wanneer toegestemd is blijft deze geldig tot intrekking op\n"
"de <a href='%s'>toepassingsbeheer</a> pagina.</p>\n"
"<p>De toepassing zal toegang krijgen via jouw account op <a href='%s'>the "
"OKAPI Framework</a>.\n"
"Wanneer je toestemming geeft voor deze toepassing zullen de mogelijkheden\n"
"van OKAPI Framework toegepast worden, b.v. het loggen van een cache.\n"
"De toestemming kan elk moment ingetrokken worden.</p>"
#: okapi/views/apps/authorized.tpl.php:5
msgid "Authorization Succeeded"
@@ -251,18 +323,16 @@ msgstr "Met succes toegang verleend"
#, php-format
msgid ""
"\n"
"\t\t\t\t<p><b>You've just granted %s application access to your %s account.</"
"b>\n"
"\t\t\t\tTo complete the operation, go back to %s and enter the following PIN "
"code:</p>\n"
"\t\t\t"
" <p><b>You've just granted %s application access to your %s "
"account.</b>\n"
" To complete the operation, go back to %s and enter the "
"following PIN code:</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t<p><b>Je hebt toegang verleent voor %s toepassing op jouw %s account."
"</b>\n"
"\t\t\t\tOm de aktie te voltooien, ga terug naar %s en gebruik de volgende "
"PIN code:</p>\n"
"\t\t\t"
"<p><b>Je hebt toegang verleent voor %s toepassing op jouw %s account.</b>\n"
"Om de actie te voltooien, ga terug naar %s en gebruik de volgende PIN code:</"
"p>"
#: okapi/views/apps/index.tpl.php:5
msgid "My Apps"
@@ -273,29 +343,25 @@ msgid "Your external applications"
msgstr "Jouw externe toepassingen"
# This will be shown when user visits /okapi/apps page.
# Sample: http://i.imgur.com/ZCJNT.png
#: okapi/views/apps/index.tpl.php:31
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>This is the list of applications which you granted access to "
"your <b>%s</b> account.\n"
"\t\t\t\t\tThis page gives you the abbility to revoke all previously granted "
"privileges.\n"
"\t\t\t\t\tOnce you click \"remove\" the application will no longer be able "
"to perform any\n"
"\t\t\t\t\tactions on your behalf.</p>\n"
"\t\t\t\t"
" <p>This is the list of applications which you granted "
"access to your <b>%s</b> account.\n"
" This page gives you the abbility to revoke all "
"previously granted privileges.\n"
" Once you click \"remove\" the application will no longer "
"be able to perform any\n"
" actions on your behalf.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Dit is een lijst met toegestane toepassingen op jouw <b>%s</b> "
"account.\n"
"\t\t\t\t\tOp deze pagina kun je alle toestemmingen intrekken die gegeven "
"zijn.\n"
"\t\t\t\t\tMet een klik op \"verwijderen\" zal de toepassing verwijderen en "
"is dan ook niet meer beschikbaar\n"
"\t\t\t\t\voor anderen.</p>\n"
"\t\t\t\t"
"<p>Dit is een lijst met toegestane toepassingen op jouw <b>%s</b> account.\n"
"Op deze pagina kun je alle toestemmingen intrekken die gegeven zijn.\n"
"Met een klik op \"verwijderen\" zal de toepassing verwijderen en is dan ook "
"niet meer beschikbaar\n"
"oor anderen.</p>"
#: okapi/views/apps/index.tpl.php:45
msgid "remove"
@@ -305,22 +371,21 @@ msgstr "verwijderen"
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Thanks to the <a href='%s'>OKAPI Framework</a> you can grant "
"external applications\n"
"\t\t\t\t\taccess to your <b>%s</b> account. Currently no applications are "
"authorized to act\n"
"\t\t\t\t\ton your behalf. Once you start using external Opencaching "
"applications, they will appear here.</p>\n"
"\t\t\t\t"
" <p>Thanks to the <a href='%s'>OKAPI Framework</a> you "
"can grant external applications\n"
" access to your <b>%s</b> account. Currently no "
"applications are authorized to act\n"
" on your behalf. Once you start using external "
"Opencaching applications, they will appear here.</p>\n"
" "
msgstr ""
"\n"
"\t\t\t\t\t<p>Dankzij het <a href='%s'>OKAPI Framework</a> kun je toegang "
"verlenen via externe\n"
"\t\t\t\t\ttoepassingen op een <b>%s</b> account. Momenteel zijn op dit "
"account nog geen externe\n"
"\t\t\t\t\ttoepassingen actief. Geactiveerde Opencaching toepassingen "
"zullen hier getoond worden.</p>\n"
"\t\t\t\t"
"<p>Dankzij het <a href='%s'>OKAPI Framework</a> kun je toegang verlenen via "
"externe\n"
"toepassingen op een <b>%s</b> account. Momenteel zijn op dit account nog "
"geen externe\n"
"toepassingen actief. Geactiveerde Opencaching toepassingen zullen hier "
"getoond worden.</p>"
#~ msgid ""
#~ "This cache is archived. Only admins and the owner are allowed to add a "

View File

@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-11 08:28+0100\n"
"PO-Revision-Date: 2013-07-11 08:35+0100\n"
"POT-Creation-Date: 2014-01-23 15:48+0100\n"
"PO-Revision-Date: 2014-01-23 15:49+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"Language-Team: \n"
"Language: pl_PL\n"
@@ -15,26 +15,35 @@ msgstr ""
"\\okapi\n"
"Plural-Forms: nplurals=3; plural= n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.6.3\n"
"X-Poedit-SearchPath-0: .\n"
#: services/caches/geocaches.php:956
#: services/caches/geocaches.php:957
msgid "Stage"
msgstr "Etap"
#: services/caches/geocaches.php:1111
#: services/caches/geocaches.php:986
msgid "User location"
msgstr "Współrzędne użytkownika"
#: services/caches/geocaches.php:989
#, php-format
msgid "Your own custom coordinates for the %s geocache"
msgstr "Twoje osobiste współrzędne skrzynki %s"
#: services/caches/geocaches.php:1148
msgid "National Park / Landscape"
msgstr "Park narodowy lub krajobrazowy"
#: services/caches/geocaches.php:1263
#: services/caches/geocaches.php:1300
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
"a> site."
msgstr "Opis <a href='%s'>skrzynki</a> pochodzi z serwisu <a href='%s'>%s</a>."
#: services/caches/geocaches.php:1275
#: services/caches/geocaches.php:1312
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -45,7 +54,7 @@ msgstr ""
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.pl'>CC-BY-NC-ND</a>, w "
"dniu %s. Prawa autorskie wpisów do logów należą do ich autorów."
#: services/caches/geocaches.php:1286
#: services/caches/geocaches.php:1323
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
@@ -56,12 +65,37 @@ msgstr ""
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.pl'>CC-BY-NC-ND</a>. Prawa "
"autorskie wpisów do logów należą do ich autorów."
#: services/caches/formatters/gpxfile.tpl.php:31
#: services/caches/formatters/gpxfile.tpl.php:60
#: services/caches/formatters/gpx.php:360
msgid ""
"<b>Geocache coordinates have been changed.</b> They have been replaced with "
"your own custom coordinates which you have provided for this geocache."
msgstr ""
"<b>Współrzędne skrzynki zostały zmienione.</b> Zostały zastąpione Twoimi "
"osobistymi współrzędnymi, które wprowadziłeś na stronie tej skrzynki."
#: services/caches/formatters/gpx.php:366
msgid ""
"<b>Geocache coordinates have been changed.</b> Currently they point to one "
"of the alternate waypoints originally described as:"
msgstr ""
"<b>Współrzędne skrzynki zostały zmienione.</b> Aktualnie wskazują one na "
"jeden z dodatkowych waypointów, oryginalnie opisanego jako:"
#: services/caches/formatters/gpx.php:379
msgid "Original geocache location"
msgstr "Oryginalne współrzędne skrzynki"
#: services/caches/formatters/gpx.php:381
#, php-format
msgid "Original (owner-supplied) location of the %s geocache"
msgstr "Oryginalne współrzędne skrzynki %s (podane przez autora)"
#: services/caches/formatters/gpxfile.tpl.php:30
#: services/caches/formatters/gpxfile.tpl.php:62
msgid "hidden by"
msgstr "ukryta przez"
#: services/caches/formatters/gpxfile.tpl.php:62
#: services/caches/formatters/gpxfile.tpl.php:64
#, php-format
msgid "%d recommendation"
msgid_plural "%d recommendations"
@@ -69,7 +103,7 @@ msgstr[0] "%d rekomendacja"
msgstr[1] "%d rekomendacje"
msgstr[2] "%d rekomendacji"
#: services/caches/formatters/gpxfile.tpl.php:63
#: services/caches/formatters/gpxfile.tpl.php:65
#, php-format
msgid "found %d time"
msgid_plural "found %d times"
@@ -77,7 +111,7 @@ msgstr[0] "znaleziona %d raz"
msgstr[1] "znaleziona %d razy"
msgstr[2] "znaleziona %d razy"
#: services/caches/formatters/gpxfile.tpl.php:66
#: services/caches/formatters/gpxfile.tpl.php:68
#, php-format
msgid "%d trackable"
msgid_plural "%d trackables"
@@ -85,32 +119,32 @@ msgstr[0] "%d GeoKret (lub TravelBug)"
msgstr[1] "%d GeoKrety (lub TravelBugi)"
msgstr[2] "%d GeoKretów (lub TravelBugów)"
#: services/caches/formatters/gpxfile.tpl.php:70
#: services/caches/formatters/gpxfile.tpl.php:72
msgid "Personal notes"
msgstr "Osobiste notatki"
#: services/caches/formatters/gpxfile.tpl.php:74
#: services/caches/formatters/gpxfile.tpl.php:76
msgid "Attributes"
msgstr "Atrybuty"
#: services/caches/formatters/gpxfile.tpl.php:78
#: services/caches/formatters/gpxfile.tpl.php:80
msgid "Trackables"
msgstr "Geokrety, Travelbugi itp."
#: services/caches/formatters/gpxfile.tpl.php:88
#: services/caches/formatters/gpxfile.tpl.php:104
#: services/caches/formatters/gpxfile.tpl.php:90
#: services/caches/formatters/gpxfile.tpl.php:106
msgid "Images"
msgstr "Obrazki"
#: services/caches/formatters/gpxfile.tpl.php:111
#: services/caches/formatters/gpxfile.tpl.php:113
msgid "Spoilers"
msgstr "Spoilery"
#: services/caches/formatters/gpxfile.tpl.php:120
#: services/caches/formatters/gpxfile.tpl.php:122
msgid "Image descriptions"
msgstr "Opisy obrazków"
#: services/caches/formatters/gpxfile.tpl.php:128
#: services/caches/formatters/gpxfile.tpl.php:130
msgid "The cache probably is located in the following protection areas:"
msgstr "Prawdopodobnie skrzynka znajduje się na terenie obszarów chronionych:"
@@ -177,11 +211,11 @@ msgstr "Ta skrzynka wymaga podania hasła. Nie wpisałeś go."
msgid "Invalid password!"
msgstr "Niepoprawne hasło!"
#: services/logs/submit.php:282
#: services/logs/submit.php:285
msgid "You have already submitted a log entry with exactly the same contents."
msgstr "Już opublikowałeś wcześniej wpis z dokładnie taką samą treścią."
#: services/logs/submit.php:305
#: services/logs/submit.php:308
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@@ -189,30 +223,30 @@ msgstr ""
"Już opublikowałeś jeden wpis typu \"Znaleziona\" dla tej skrzynki. Teraz "
"możesz dodawać jedynie \"Komentarze\"!"
#: services/logs/submit.php:307
#: services/logs/submit.php:310
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr ""
"Jesteś właścicielem tej skrzynki. Możesz przesyłać jedynie \"Komentarze\"."
#: services/logs/submit.php:325
#: services/logs/submit.php:328
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr "Już oceniłeś tę skrzynkę. Ocena nie może być zmieniona."
#: services/logs/submit.php:342
#: services/logs/submit.php:345
msgid "You have already recommended this cache once."
msgstr "Już raz zarekomendowałeś tę skrzynkę."
#: services/logs/submit.php:352
#: services/logs/submit.php:355
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
"Aktualnie nie możesz wystawić kolejnej rekomendacji. Znajdź najpierw więcej "
"skrzynek!"
#: services/logs/submit.php:395
#: services/logs/submit.php:398
msgid "Event caches cannot \"need maintenance\"."
msgstr "Skrzynki typu Wydarzenie nie mogą \"potrzebować serwisu\"."
#: services/logs/submit.php:525
#: services/logs/submit.php:528
msgid "Your cache log entry was posted successfully."
msgstr "Twój wpis do logbooka został opublikowany pomyślnie."
@@ -253,16 +287,17 @@ msgstr "Odmawiam"
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Once permission is granted it is valid until its withdrawal on\n"
"\t\t\t\t\tthe <a href='%s'>applications management</a> page.</p>\n"
"\t\t\t\t\t<p>The application will access your acount via <a href='%s'>the "
"OKAPI Framework</a>.\n"
"\t\t\t\t\tIf you allow this request application will be able to access all "
"methods delivered\n"
"\t\t\t\t\tby the OKAPI Framework, i.e. post log entries on geocaches in your "
"name.\n"
"\t\t\t\t\tYou can revoke this permission at any moment.</p>\n"
"\t\t\t\t"
" <p>Once permission is granted it is valid until its "
"withdrawal on\n"
" the <a href='%s'>applications management</a> page.</p>\n"
" <p>The application will access your acount via <a "
"href='%s'>the OKAPI Framework</a>.\n"
" If you allow this request application will be able to "
"access all methods delivered\n"
" by the OKAPI Framework, i.e. post log entries on "
"geocaches in your name.\n"
" You can revoke this permission at any moment.</p>\n"
" "
msgstr ""
"\n"
"<p>Raz udzielona zgoda jest ważna aż do momentu jej wycofania na stronie <a "
@@ -285,11 +320,11 @@ msgstr "Pomyślnie dałeś dostęp"
#, php-format
msgid ""
"\n"
"\t\t\t\t<p><b>You've just granted %s application access to your %s account.</"
"b>\n"
"\t\t\t\tTo complete the operation, go back to %s and enter the following PIN "
"code:</p>\n"
"\t\t\t"
" <p><b>You've just granted %s application access to your %s "
"account.</b>\n"
" To complete the operation, go back to %s and enter the "
"following PIN code:</p>\n"
" "
msgstr ""
"\n"
"<p><b>Właśnie dałeś dostęp aplikacji %s do Twojego konta %s.</b>\n"
@@ -308,14 +343,14 @@ msgstr "Twoje zewnętrzne aplikacje"
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>This is the list of applications which you granted access to "
"your <b>%s</b> account.\n"
"\t\t\t\t\tThis page gives you the abbility to revoke all previously granted "
"privileges.\n"
"\t\t\t\t\tOnce you click \"remove\" the application will no longer be able "
"to perform any\n"
"\t\t\t\t\tactions on your behalf.</p>\n"
"\t\t\t\t"
" <p>This is the list of applications which you granted "
"access to your <b>%s</b> account.\n"
" This page gives you the abbility to revoke all "
"previously granted privileges.\n"
" Once you click \"remove\" the application will no longer "
"be able to perform any\n"
" actions on your behalf.</p>\n"
" "
msgstr ""
"\n"
"<p>Następującym aplikacjom zezwoliłeś na dostęp do swojego konta <b>%s</b>.\n"
@@ -332,13 +367,13 @@ msgstr "usuń"
#, php-format
msgid ""
"\n"
"\t\t\t\t\t<p>Thanks to the <a href='%s'>OKAPI Framework</a> you can grant "
"external applications\n"
"\t\t\t\t\taccess to your <b>%s</b> account. Currently no applications are "
"authorized to act\n"
"\t\t\t\t\ton your behalf. Once you start using external Opencaching "
"applications, they will appear here.</p>\n"
"\t\t\t\t"
" <p>Thanks to the <a href='%s'>OKAPI Framework</a> you "
"can grant external applications\n"
" access to your <b>%s</b> account. Currently no "
"applications are authorized to act\n"
" on your behalf. Once you start using external "
"Opencaching applications, they will appear here.</p>\n"
" "
msgstr ""
"\n"
"<p>Dzięki platformie <a href='%s'>OKAPI</a> możesz dawać zewnętrznym "
@@ -348,6 +383,30 @@ msgstr ""
"w Twoim imieniu. Gdy zaczniesz korzystać z zewnętrznych aplikacji, ich lista "
"pojawi się tutaj.</p>"
#~ msgid ""
#~ "\n"
#~ "\t\t\t\t\t\t\t\t<b>Warning: Changed coordinates.</b> These are not the "
#~ "original\n"
#~ "\t\t\t\t\t\t\t\tcoordinates of this geocache (as supplied by the owner). "
#~ "They\n"
#~ "\t\t\t\t\t\t\t\thave been replaced with other coordinates:\n"
#~ "\t\t\t\t\t\t\t"
#~ msgstr ""
#~ "\n"
#~ "<b>Uwaga: Zmienione współrzędne.</b> To nie są oryginalne współrzędne tej "
#~ "skrzynki (takie, jakie podał jej autor). Współrzędne zostały nadpisane "
#~ "innymi współrzędnymi:"
#~ msgid ""
#~ "<b>Geocache's coordinates has been changed</b> to point to the user "
#~ "supplied value."
#~ msgstr ""
#~ "<b>Współrzędne skrzynki zostały zmienione</b> na własną wartość "
#~ "wprowadzoną przez użytkownika."
#~ msgid "User-supplied location of the %s geocache"
#~ msgstr "Współrzędne skrzynki %s wprowadzone przez użytkownika"
#~ msgid "Recommending is allowed only for 'Found it' logtypes."
#~ msgstr "Rekomendacje są dozwolone jedynie z wpisem \"Znaleziona\"."

View File

@@ -839,6 +839,9 @@ class OAuthServer {
if( ! $timestamp )
throw new OAuthMissingParameterException('oauth_timestamp');
// Cast to integer. See issue #314.
$timestamp = $timestamp + 0;
// verify that timestamp is recentish
$now = time();
if (abs($now - $timestamp) > $this->timestamp_threshold) {

View File

@@ -38,6 +38,7 @@ class OkapiServiceRunner
'services/caches/geocache',
'services/caches/geocaches',
'services/caches/mark',
'services/caches/save_personal_notes',
'services/caches/formatters/gpx',
'services/caches/formatters/garmin',
'services/caches/map/tile',

View File

@@ -47,11 +47,46 @@ class WebService
/* Find and replace %okapi:plugins%. */
$s = preg_replace_callback("~%OKAPI:([a-z:]+)%~", array("self", "plugin_callback"), $s);
$s = preg_replace_callback('~%OKAPI:([a-z:/_#]+)%~', array("self", "plugin_callback"), $s);
return $s;
}
/**
* You can use the following syntax:
*
* <a href="%OKAPI:docurl:fragment%">any text</a> - to reference fragment of introducing
* documentation
*
* <a href="%OKAPI:methodref:methodname%">any text</a> - to reference any other method
*
* <a href="%OKAPI:methodref:methodname#html_anchor%">any text</a> - to reference
* any HTML anchor in other method
*
* <a href="%OKAPI:methodref:#html_anchor%">any text</a> - to reference any HTML
* anchor within current document
*
* <a href="%OKAPI:methodargref:methodname#argument_name%">any text</a> - to
* reference argument of another method
*
* <a href="%OKAPI:methodargref:#argument_name%">any text</a> - to reference
* argument within current method
*
* <a href="%OKAPI:methodretref:methodname#returned_key%">any text</a> - to
* reference returned value of another method
*
* <a href="%OKAPI:methodretref:#returned_key%">any text</a> - to reference
* returned value within current method
*
* NOTE!
*
* Since returned JSON dictionaries are not standardized (they are simply plain
* HTML in the docs), to reference returned values you must manually create an
* anchor prefixed with ret_, i.e. (HTML snippet): <li
* id="ret_alt_wpts"><p><b>alt_wpts</b> - list of alternate/additional
* waypoints</...> and access it with (HTML snippet): <a
* href="%OKAPI:methodretref:#alt_wpts%">any text</a>.
*/
public static function plugin_callback($matches)
{
$input = $matches[1];
@@ -62,6 +97,29 @@ class WebService
case 'docurl':
$fragment = $arr[1];
return Settings::get('SITE_URL')."okapi/introduction.html#".$fragment;
case 'methodref':
case 'methodargref':
case 'methodretref':
$elements = explode('#', $arr[1]);
$result = '';
if ($elements[0] != '')
{
$result .= Settings::get('SITE_URL')."okapi/".$elements[0].'.html';
}
if (count($elements) > 1)
{
$result .= '#';
switch ($plugin_name) {
case 'methodargref':
$result .= 'arg_';
break;
case 'methodretref':
$result .= 'ret_';
break;
}
$result .= $elements[1];
}
return $result;
default:
throw new Exception("Unknown plugin: ".$input);
}

View File

@@ -1,4 +1,4 @@
<!--
<!--
This is the list of all geocache attributes supported by OKAPI. It should
include any attribute used by at least one of the Opencaching installations.
@@ -1342,12 +1342,19 @@ It also defines attribute names and descriptions in several languages.
<attr acode="A39" categories="de-time-and-seasons">
<groundspeak id="13" inc="true" name="Available at all times" />
<opencaching schema="http://www.opencaching.de/" id="38" />
<opencaching schema="http://www.opencaching.nl/" id="38" />
<lang id="en">
<name>Available 24/7</name>
<desc>
This cache can be found at any time of day or week.
</desc>
</lang>
<lang id="nl">
<name>24/7 beschikbaar</name>
<desc>
Deze cache kan 24/7 gedaan worden, zowel overdag als in de nacht.
</desc>
</lang>
<lang id="de">
<name>rund um die Uhr machbar</name>
<desc>
@@ -1371,6 +1378,7 @@ It also defines attribute names and descriptions in several languages.
<attr acode="A40" categories="de-time-and-seasons">
<groundspeak id="13" inc="false" name="Available at all times" />
<opencaching schema="http://www.opencaching.de/" id="39" />
<opencaching schema="http://www.opencaching.nl/" id="39" />
<lang id="en">
<name>Not 24/7</name>
<desc>
@@ -1387,6 +1395,13 @@ It also defines attribute names and descriptions in several languages.
dostępności powinny znajdować się w opisie skrzynki.
</desc>
</lang>
<lang id="nl">
<name>Niet 24/7 beschikbaar</name>
<desc>
Deze cache is niet alle tijden te doen. Zie de cachebeschrijving voor de details.
Dit kan bijvoorbeeld zijn in een gebied waar men alleen tussen zonsopgang of zonsondergang mag komen.
</desc>
</lang>
<lang id="de">
<name>nur zu bestimmten Uhrzeiten</name>
<desc>

View File

@@ -44,6 +44,8 @@ class WebService
if (!$images) $images = "all";
if (!in_array($images, array("none", "all", "spoilers", "nonspoilers")))
throw new InvalidParam('images');
$location_source = $request->get_parameter('location_source');
$location_change_prefix = $request->get_parameter('location_change_prefix');
# Start creating ZIP archive.
@@ -77,7 +79,9 @@ class WebService
'recommendations' => 'desc:count',
'latest_logs' => 'true',
'lpc' => 'all',
'my_notes' => ($request->token != null) ? "desc:text" : "none"
'my_notes' => ($request->token != null) ? "desc:text" : "none",
'location_source' => $location_source,
'location_change_prefix' => $location_change_prefix
)))->get_body());
# Then, include all the images.

View File

@@ -40,6 +40,14 @@
<li><b>nonspoilers</b> - only non-spoiler images will be included in the result.</li>
</ul>
</opt>
<opt name="location_source" default='default-coords'>
Same as in the <a href="%OKAPI:methodargref:services/caches/formatters/gpx#location_source%">
services/caches/formatters/gpx</a> method.
</opt>
<opt name="location_change_prefix" default="#">
Same as in the <a href="%OKAPI:methodargref:services/caches/formatters/gpx#location_change_prefix%">
services/caches/formatters/gpx</a> method.
</opt>
<returns>
<p>ZIP file. You should extract it's contents directly into the root
directory of your Garmin's internal memory storage.</p>

View File

@@ -37,6 +37,7 @@ class WebService
'Moving' => 'Unknown Cache',
'Math/Physics' => 'Unknown Cache',
'Drive-In' => 'Traditional Cache',
'Podcast' => 'Unknown Cache',
'Own' => 'Unknown Cache',
'Other' => 'Unknown Cache'
);
@@ -155,11 +156,30 @@ class WebService
$user_uuid = $request->get_parameter('user_uuid');
# location_source (part 1 of 2)
$location_source = $request->get_parameter('location_source');
if (!$location_source)
{
$location_source = 'default-coords';
}
# Make sure location_source has prefix alt_wpt:
if ($location_source != 'default-coords' && strncmp($location_source, 'alt_wpt:', 8) != 0)
{
throw new InvalidParam('location_source', '\''.$location_source.'\'');
}
# Make sure we have sufficient authorization
if ($location_source == 'alt_wpt:user-coords' && $request->token == null)
{
throw new BadRequest("Level 3 Authentication is required to access 'alt_wpt:user-coords'.");
}
# Which fields of the services/caches/geocaches method do we need?
$fields = 'code|name|location|date_created|url|type|status|size|size2|oxsize'.
'|difficulty|terrain|description|hint2|rating|owner|url|internal_id'.
'|protection_areas';
'|protection_areas|short_description';
if ($vars['images'] != 'none')
$fields .= "|images";
if (count($vars['attrs']) > 0)
@@ -168,7 +188,7 @@ class WebService
$fields .= "|trackables";
elseif ($vars['trackables'] == 'desc:count')
$fields .= "|trackables_count";
if ($vars['alt_wpts'] == 'true')
if ($vars['alt_wpts'] == 'true' || $location_source != 'default-coords')
$fields .= "|alt_wpts";
if ($vars['recommendations'] != 'none')
$fields .= "|recommendations|founds";
@@ -192,6 +212,17 @@ class WebService
)
);
# Get rid of invalid cache references.
$valid = array();
foreach ($vars['caches'] as $key => &$ref) {
if ($ref !== null) {
$valid[$key] = &$ref;
}
}
$vars['caches'] = &$valid;
unset($valid);
# Get all the other data need.
$vars['installation'] = OkapiServiceRunner::call(
@@ -238,10 +269,10 @@ class WebService
$attr_dict = AttrHelper::get_attrdict();
}
foreach ($vars['caches'] as &$cache)
foreach ($vars['caches'] as &$cache_ref)
{
$cache['gc_attrs'] = array();
foreach ($cache['attr_acodes'] as $acode)
$cache_ref['gc_attrs'] = array();
foreach ($cache_ref['attr_acodes'] as $acode)
{
$has_gc_equivs = false;
foreach ($vars['attr_index'][$acode]['gc_equivs'] as $gc)
@@ -251,7 +282,7 @@ class WebService
# - assigning the same GC ID to multiple A-Codes,
# - contradicting attributes in one OC listing, e.g. 24/4 + not 24/7.
$cache['gc_attrs'][$gc['id']] = $gc;
$cache_ref['gc_attrs'][$gc['id']] = $gc;
$has_gc_equivs = true;
}
if (!$has_gc_equivs && $vars['gc_ocde_attrs'])
@@ -264,7 +295,7 @@ class WebService
# IDs start at 106, so there is space for 40 new GS attributes.
$internal_id = $attr_dict[$acode]['internal_id'];
$cache['gc_attrs'][100 + $internal_id] = array(
$cache_ref['gc_attrs'][100 + $internal_id] = array(
'inc' => 1,
'name' => $ocde_attrnames[$internal_id][0]['name'],
);
@@ -302,6 +333,61 @@ class WebService
$vars['user_uuid_to_internal_id'] = &$dict;
unset($dict);
# location_source (part 2 of 2)
if ($location_source != 'default-coords')
{
$location_change_prefix = $request->get_parameter('location_change_prefix');
if (!$location_change_prefix) {
$location_change_prefix = '# ';
}
# lets find requested coords
foreach ($vars['caches'] as &$cache_ref)
{
foreach ($cache_ref['alt_wpts'] as $alt_wpt_key => $alt_wpt)
{
if ('alt_wpt:'.$alt_wpt['type'] == $location_source)
{
# Switch locations between primary wpt and alternate wpt.
# Also alter the cache name and make sure to append a proper
# notice.
$original_location = $cache_ref['location'];
$cache_ref['location'] = $alt_wpt['location'];
$cache_ref['name_2'] = $location_change_prefix.$cache_ref['name'];
if ($location_source == "alt_wpt:user-coords") {
# In case of "user-coords", replace the default warning with a custom-tailored one.
$cache_ref['warning_prefix'] = _(
"<b>Geocache coordinates have been changed.</b> They have been replaced with ".
"your own custom coordinates which you have provided for this geocache."
);
} else {
# Default warning
$cache_ref['warning_prefix'] = _(
"<b>Geocache coordinates have been changed.</b> Currently they ".
"point to one of the alternate waypoints originally described as:"
) . " " . $alt_wpt['description'];
}
# remove current alt waypoint
unset($cache_ref['alt_wpts'][$alt_wpt_key]);
# add original location as alternate
if ($vars['alt_wpts'])
{
$cache_ref['alt_wpts'][] = array(
'name' => $cache_ref['code'].'-DEFAULT-COORDS',
'location' => $original_location,
'type' => 'default-coords',
'type_name' => _("Original geocache location"),
'sym' => 'Block, Blue',
'description' => sprintf(_("Original (owner-supplied) location of the %s geocache"), $cache_ref['code']),
);
}
break;
}
}
}
}
$response = new OkapiHttpResponse();
$response->content_type = "application/gpx; charset=utf-8";
$response->content_disposition = 'attachment; filename="results.gpx"';

View File

@@ -192,6 +192,65 @@
will respond with HTTP 400 error.</li>
</ul>
</opt>
<opt name="location_source" default='default-coords'>
<p>If you supply a value, then it must be prefixed with <i>alt_wpt:</i>,
and should match one of alternate waypoint types documented in the
<a href="%OKAPI:methodretref:services/caches/geocache#alt_wpts%">alt_wpts</a>
field returned by <a href="%OKAPI:methodref:services/caches/geocache%">services/caches/geocache</a>
method. If the type doesn't match, it will be ignored.</p>
<p>By default, the <b>lat</b> and <b>lon</b> attributes of the <b>&lt;wpt&gt;</b> element
will return the default coordinates of the cache, as supplied by the owner of the cache.
This option allows you to replace these coordinates with other set of coordinates, loaded
from the <b>alt_wpts</b> field mentioned above.</p>
<p>This may have some advantages in some scenarios. For example, if your user
is driving a car, he might be more interested in the coordinates of the
nearest suitable parking spot than in the coordinates of the geocache itself.
If you set <b>location_source</b> to <b>alt_wpt:parking</b> then you'll be
pre-fetching parking locations (if provided) without the need of loading all
other <b>alternate waypoints</b> in your requests.</p>
<p>Other use case: setting this to <b>alt_wpt:user-coords</b> allows
personalized results in some OC installations.</p>
<ul>
<li>If the type provided doesn't match any alternate waypoints, the default
coordinates of the geocache will be used.</li>
<li>
<p>If the type matches exactly one alternate waypoint, then:</p>
<ul>
<li>The <b>lat</b> and <b>lon</b> attributes of the "primary"
<b>&lt;wpt&gt;</b> element will be replaced with the location of
the matched alternate waypoint,</li>
<li>The name of the geocache will be prefixed with the value suppiled in
<b><a href="%OKAPI:methodargref:#location_change_prefix%">location_change_prefix</a></b>
parameter,</li>
<li>The desription of the waypoint will be included in the
header of the cache description,</li>
<li>The matched alternate waypoint will be removed from the list
of alternate waypoins (in order to avoid duplicate locations),</li>
<li>Extra alternate waypoint will be created, with the original
location of the geocache.</li>
</ul>
</li>
<li>If the type provided matches multiple alternate waypoints, then
the first one will be chosen.</li>
</ul>
</opt>
<opt name="location_change_prefix" default="#">
<p>Prefix to be added to the geocache name, in case its location has been changed due to
the <b><a href="%OKAPI:methodargref:#location_source%">location_source</a></b> parameter
matching any of the alternate waypoint.</p>
</opt>
<returns>
<p>GPX file. All invalid cache codes will be skipped without any notice!</p>
</returns>

View File

@@ -23,19 +23,18 @@ http://www.gsak.net/xmlv1/5 http://www.gsak.net/xmlv1/5/gsak.xsd
<urlname><?= $vars['installation']['site_name'] ?></urlname>
<time><?= date('c') ?></time>
<? foreach ($vars['caches'] as $c) { ?>
<? if ($c == null) continue; /* This happens when there is an invalid code in cache_codes */ ?>
<? list($lat, $lon) = explode("|", $c['location']); ?>
<wpt lat="<?= $lat ?>" lon="<?= $lon ?>">
<time><?= $c['date_created'] ?></time>
<name><?= $c['code'] ?></name>
<desc><?= Okapi::xmlescape($c['name']) ?> <?= _("hidden by") ?> <?= Okapi::xmlescape($c['owner']['username']) ?> :: <?= ucfirst($c['type']) ?> Cache (<?= $c['difficulty'] ?>/<?= $c['terrain'] ?><? if ($c['size'] !== null) { echo "/".$c['size']; } else { echo "/X"; } ?>/<?= $c['rating'] ?>)</desc>
<desc><?= Okapi::xmlescape(isset($c['name_2']) ? $c['name_2'] : $c['name']) ?> <?= _("hidden by") ?> <?= Okapi::xmlescape($c['owner']['username']) ?> :: <?= ucfirst($c['type']) ?> Cache (<?= $c['difficulty'] ?>/<?= $c['terrain'] ?><? if ($c['size'] !== null) { echo "/".$c['size']; } else { echo "/X"; } ?>/<?= $c['rating'] ?>)</desc>
<url><?= $c['url'] ?></url>
<urlname><?= Okapi::xmlescape($c['name']) ?></urlname>
<sym><?= ($vars['mark_found'] && $c['is_found']) ? "Geocache Found" : "Geocache" ?></sym>
<type>Geocache|<?= $vars['cache_GPX_types'][$c['type']] ?></type>
<? if ($vars['ns_ground']) { /* Does user want us to include Groundspeak's <cache> element? */ ?>
<groundspeak:cache archived="<?= ($c['status'] == 'Archived') ? "True" : "False" ?>" available="<?= ($c['status'] == 'Available') ? "True" : "False" ?>" id="<?= $c['internal_id'] ?>" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
<groundspeak:name><?= Okapi::xmlescape($c['name']) ?></groundspeak:name>
<groundspeak:name><?= Okapi::xmlescape(isset($c['name_2']) ? $c['name_2'] : $c['name']) ?></groundspeak:name>
<groundspeak:placed_by><?= Okapi::xmlescape($c['owner']['username']) ?></groundspeak:placed_by>
<groundspeak:owner id="<?= $vars['user_uuid_to_internal_id'][$c['owner']['uuid']] ?>"><?= Okapi::xmlescape($c['owner']['username']) ?></groundspeak:owner>
<groundspeak:type><?= $vars['cache_GPX_types'][$c['type']] ?></groundspeak:type>
@@ -54,7 +53,13 @@ http://www.gsak.net/xmlv1/5 http://www.gsak.net/xmlv1/5/gsak.xsd
<? } ?>
<groundspeak:difficulty><?= $c['difficulty'] ?></groundspeak:difficulty>
<groundspeak:terrain><?= $c['terrain'] ?></groundspeak:terrain>
<? if ($c['short_description']) { ?>
<groundspeak:short_description html="False"><?= Okapi::xmlescape($c['short_description']) ?></groundspeak:short_description>
<? } ?>
<groundspeak:long_description html="True">
<? if (isset($c['warning_prefix'])) { ?>
&lt;p style='font-size: 120%'&gt;<?= Okapi::xmlescape($c['warning_prefix']) ?>&lt;/p&gt;
<? } ?>
&lt;p&gt;
&lt;a href="<?= $c['url'] ?>"&gt;<?= Okapi::xmlescape($c['name']) ?>&lt;/a&gt;
<?= _("hidden by") ?> &lt;a href='<?= $c['owner']['profile_url'] ?>'&gt;<?= Okapi::xmlescape($c['owner']['username']) ?>&lt;/a&gt;&lt;br/&gt;

View File

@@ -89,8 +89,10 @@
<li><b>names</b> - a dictionary (language code => plain-text string) of
names of the geocache (at this time, there will be only one language,
but this may change in future),</li>
<li><b>location</b> - location of the cache in the "lat|lon" format
(<i>lat</i> and <i>lon</i> are in full degrees with a dot as a decimal point),</li>
<li>
<b>location</b> - location of the cache in the "lat|lon" format
(<i>lat</i> and <i>lon</i> are in full degrees with a dot as a decimal point),
</li>
<li>
<p><b>type</b> - cache type. This might be <b>pretty much everything</b>,
but there are some predefined types that you might want to treat
@@ -241,6 +243,10 @@
<li><b>recommendations</b> - number of recommendations for this cache,</li>
<li><b>req_passwd</b> - boolean; states if this cache requires a password
in order to submit a "Found it" log entry,</li>
<li><b>short_description</b> - a plaintext string with a single line (very short)
description of the cache (kind of a "tagline text"),</li>
<li><b>short_descriptions</b> - a dictionary (language code =&gt;
plaintext string) of short cache descriptions,</li>
<li><b>description</b> - <a href='%OKAPI:docurl:html%'>HTML string</a>,
description of the cache,</li>
<li><b>descriptions</b> - a dictionary (language code =&gt;
@@ -321,26 +327,47 @@
cannot automatically determine this address.</li>
</ul>
</li>
<li>
<li id="ret_alt_wpts">
<p><b>alt_wpts</b> - list of alternate/additional waypoints associated
with this geocache. Each item is a dictionary of the following structure:</p>
<ul>
<li><b>name</b> - plain-text, short, unique "codename" for the waypoint,</li>
<li><b>location</b> - location of the waypoint in the "lat|lon" format
(<i>lat</i> and <i>lon</i> are in full degrees with a dot as a decimal point),</li>
<li><b>type</b> - string, unique identifier for the type of waypoint; one
of the following: <b>parking</b>, <b>path</b>, <b>stage</b>,
<b>physical-stage</b>, <b>virtual-stage</b>, <b>final</b>, <b>poi</b>, <b>other</b>;
more types may be added; unknown types should be treated as <b>other</b>,
<li>
<p><b>type</b> - string, unique identifier for the type of waypoint;
one of the following:</p>
<ul>
<li><b>parking</b>, <b>path</b>, <b>stage</b>, <b>physical-stage</b>,
<b>virtual-stage</b>, <b>final</b>, <b>poi</b>, <b>other</b> - used by
OC itself, for detailed descriptions of these you'll have to refer to
external Opencaching documenation,</li>
<li><b>user-coords</b> - extra coordinates supplied <i>by the user who
had found the cache</i> (NOT the owner of the cache), most probably
pointing to the final location of the cache (e.g. a quiz cache);
this type of waypoint is available only in some installations and only
if you're using Level 3 Authentication,</li>
<li>more types may be added at any moment; unknown types should be
treated as <b>other</b>.</li>
</ul>
</li>
<li><b>type_name</b> - string, the human-readable name of the waypoint type,
<li>
<b>type_name</b> - string, the human-readable name of the waypoint type,
e.g. "Parking area" or "Final location"; the language will be selected
based on the langpref argument,
</li>
<li>
<b>sym</b> - string, one of commonly recognized waypoint symbol
<p><b>sym</b> - string, one of commonly recognized waypoint symbol
names, originally introduced by Garmin in their devices and GPX
files (e.g. "Flag, Green" or "Parking Area"),
files (e.g. "Flag, Green" or "Parking Area").</p>
<p>These symbol codes are only suggestions. They are understood by
Garmin-related software and devices. If you don't know how to display such
symbols, you are welcome to use any symbol you'd like in your
application.</p>
</li>
<li><b>description</b> - plain-text longer description of the waypoint.</li>
</ul>

View File

@@ -35,7 +35,7 @@ class WebService
'last_modified', 'date_created', 'date_hidden', 'internal_id', 'is_watched',
'is_ignored', 'willattends', 'country', 'state', 'preview_image',
'trip_time', 'trip_distance', 'attribution_note','gc_code', 'hint2', 'hints2',
'protection_areas');
'protection_areas', 'short_description', 'short_descriptions');
public static function call(OkapiRequest $request)
{
@@ -74,6 +74,7 @@ class WebService
$fields_to_remove_later = array();
if (
in_array('description', $fields) || in_array('descriptions', $fields)
|| in_array('short_description', $fields) || in_array('short_descriptions', $fields)
|| in_array('hint', $fields) || in_array('hints', $fields)
|| in_array('hint2', $fields) || in_array('hints2', $fields)
|| in_array('attribution_note', $fields)
@@ -316,6 +317,8 @@ class WebService
case 'rating_votes': $entry['rating_votes'] = $row['votes'] + 0; break;
case 'recommendations': $entry['recommendations'] = $row['topratings'] + 0; break;
case 'req_passwd': $entry['req_passwd'] = $row['logpw'] ? true : false; break;
case 'short_description': /* handled separately */ break;
case 'short_descriptions': /* handled separately */ break;
case 'description': /* handled separately */ break;
case 'descriptions': /* handled separately */ break;
case 'hint': /* handled separately */ break;
@@ -468,23 +471,25 @@ class WebService
# Descriptions and hints.
if (in_array('description', $fields) || in_array('descriptions', $fields)
|| in_array('short_description', $fields) || in_array('short_descriptions', $fields)
|| in_array('hint', $fields) || in_array('hints', $fields)
|| in_array('hint2', $fields) || in_array('hints2', $fields))
{
# At first, we will fill all those 4 fields, even if user requested just one
# of them. We will chop off the remaining three at the end.
# At first, we will fill all those fields, even if user requested just one
# of them. We will chop off the unwanted ones at the end.
foreach ($results as &$result_ref)
{
$result_ref['descriptions'] = array();
$result_ref['hints'] = array();
$result_ref['hints2'] = array();
$result_ref['short_descriptions'] = new ArrayObject();
$result_ref['descriptions'] = new ArrayObject();
$result_ref['hints'] = new ArrayObject();
$result_ref['hints2'] = new ArrayObject();
}
# Get cache descriptions and hints.
$rs = Db::query("
select cache_id, language, `desc`, hint
select cache_id, language, `desc`, short_desc, hint
from cache_desc
where cache_id in ('".implode("','", array_map('mysql_real_escape_string', array_keys($cacheid2wptcode)))."')
");
@@ -510,6 +515,10 @@ class WebService
}
$results[$cache_code]['descriptions'][strtolower($row['language'])] = $tmp;
}
if ($row['short_desc'])
{
$results[$cache_code]['short_descriptions'][strtolower($row['language'])] = $row['short_desc'];
}
if ($row['hint'])
{
$results[$cache_code]['hints'][strtolower($row['language'])] = $row['hint'];
@@ -519,6 +528,7 @@ class WebService
}
foreach ($results as &$result_ref)
{
$result_ref['short_description'] = Okapi::pick_best_language($result_ref['short_descriptions'], $langpref);
$result_ref['description'] = Okapi::pick_best_language($result_ref['descriptions'], $langpref);
$result_ref['hint'] = Okapi::pick_best_language($result_ref['hints'], $langpref);
$result_ref['hint2'] = Okapi::pick_best_language($result_ref['hints2'], $langpref);
@@ -526,7 +536,10 @@ class WebService
# Remove unwanted fields.
foreach (array('description', 'descriptions', 'hint', 'hints', 'hint2', 'hints2') as $field)
foreach (array(
'short_description', 'short_descriptions', 'description', 'descriptions',
'hint', 'hints', 'hint2', 'hints2'
) as $field)
if (!in_array($field, $fields))
foreach ($results as &$result_ref)
unset($result_ref[$field]);
@@ -813,7 +826,7 @@ class WebService
where wp in ('".implode("','", array_map('mysql_real_escape_string', $cache_codes))."')
group by wp
");
$tr_counts = array();
$tr_counts = new ArrayObject();
while ($row = mysql_fetch_assoc($rs))
$tr_counts[$row['cache_code']] = $row['count'];
foreach ($results as $cache_code => &$result_ref)
@@ -958,6 +971,56 @@ class WebService
);
}
}
# Issue #298 - User coordinates implemented in oc.pl
# Issue #305 - User coordinates implemented in oc.de
if ($request->token != null)
{
# Query DB for user provided coordinates
if (Settings::get('OC_BRANCH') == 'oc.pl')
{
$cacheid2user_coords = Db::select_group_by('cache_id', "
select
cache_id, longitude, latitude
from cache_mod_cords
where
cache_id in ($cache_codes_escaped_and_imploded)
and user_id = '".mysql_real_escape_string($request->token->user_id)."'
");
} else {
# oc.de
$cacheid2user_coords = Db::select_group_by('cache_id', "
select
cache_id, longitude, latitude
from coordinates
where
cache_id in ($cache_codes_escaped_and_imploded)
and user_id = '".mysql_real_escape_string($request->token->user_id)."'
and type = 2
and longitude != 0
and latitude != 0
");
}
foreach ($cacheid2user_coords as $cache_id => $waypoints)
{
$cache_code = $cacheid2wptcode[$cache_id];
foreach ($waypoints as $row)
{
# there should be only one user waypoint per cache...
$results[$cache_code]['alt_wpts'][] = array(
'name' => $cache_code.'-USER-COORDS',
'location' => round($row['latitude'], 6)."|".round($row['longitude'], 6),
'type' => 'user-coords',
'type_name' => _("User location"),
'sym' => 'Block, Green',
'description' => sprintf(
_("Your own custom coordinates for the %s geocache"),
$cache_code
),
);
}
}
}
}
# Country and/or state.
@@ -1180,6 +1243,28 @@ class WebService
foreach ($cache_codes as $cache_code)
$ordered_results[$cache_code] = $results[$cache_code];
/* Handle OCPL's "access logs" feature. */
if (
(Settings::get('OC_BRANCH') == 'oc.pl')
&& Settings::get('OCPL_ENABLE_GEOCACHE_ACCESS_LOGS')
) {
$cache_ids = array_keys($cacheid2wptcode);
/* Log this event only if some specific fields were accessed. */
if (
in_array('location', $fields)
&& (count(array_intersect(array(
'hint', 'hints', 'hint2', 'hints2',
'description', 'descriptions'
), $fields)) > 0)
) {
require_once($GLOBALS['rootpath'].'okapi/lib/ocpl_access_logs.php');
\okapi\OCPLAccessLogs::log_geocache_access($request, $cache_ids);
}
}
return Okapi::formatted_response($request, $ordered_results);
}

View File

@@ -34,6 +34,9 @@
<opt name='log_fields' default='uuid|date|user|type|comment'>
Same as in the services/caches/geocache method.
</opt>
<opt name='my_location'>
Same as in the services/caches/geocache method.
</opt>
<opt name='user_uuid'>
Same as in the services/caches/geocache method.
</opt>

View File

@@ -66,7 +66,8 @@ class ReplicateListener
return;
}
$theirs = TileTree::generate_short_row($cache);
# Fetch our copy of the cache.
$ours = mysql_fetch_row(Db::query("
select cache_id, z21x, z21y, status, type, rating, flags
from okapi_tile_caches
@@ -74,6 +75,21 @@ class ReplicateListener
z=0
and cache_id = '".mysql_real_escape_string($cache['internal_id'])."'
"));
# Caches near the poles caused our computations to break here. We will
# ignore such caches!
list($lat, $lon) = explode("|", $cache['location']);
if ((floatval($lat) >= 89.99) || (floatval($lat) <= -89.99)) {
if ($ours) {
self::remove_geocache_from_cached_tiles($ours[0]);
}
return;
}
# Compute the new row for okapi_tile_caches. Compare with the old one.
$theirs = TileTree::generate_short_row($cache);
if (!$ours)
{
# Aaah, a new geocache! How nice... ;)

View File

@@ -154,6 +154,10 @@ class TileTree
foreach ($caches as $cache)
{
$row = self::generate_short_row($cache);
if (!$row) {
/* Some caches cannot be included, e.g. the ones near the poles. */
continue;
}
Db::execute("
replace into okapi_tile_caches (
z, x, y, cache_id, z21x, z21y, status, type, rating, flags
@@ -272,7 +276,12 @@ class TileTree
public static function generate_short_row($cache)
{
list($lat, $lon) = explode("|", $cache['location']);
try {
list($z21x, $z21y) = self::latlon_to_z21xy($lat, $lon);
} catch (Exception $e) {
/* E.g. division by zero, if the cache is placed at the north pole. */
return false;
}
$flags = 0;
if (($cache['founds'] > 6) && (($cache['recommendations'] / $cache['founds']) > 0.3))
$flags |= self::$FLAG_STAR;

View File

@@ -29,8 +29,9 @@ class WebService
public static function call(OkapiRequest $request)
{
$search_params = SearchAssistant::get_common_search_params($request);
$result = SearchAssistant::get_common_search_result($search_params);
$search_assistant = new SearchAssistant($request);
$search_assistant->prepare_common_search_params();
$result = $search_assistant->get_common_search_result();
return Okapi::formatted_response($request, $result);
}
}

View File

@@ -185,7 +185,7 @@
<p><b>Examples:</b></p>
<ul>
<li>to order by cache name use "order_by=name" or "order_by=+name",</li>
<li>to have the most recommended caches caches in front, use "order_by=-rcmds%",</li>
<li>to have the most recommended caches in front, use "order_by=-rcmds%",</li>
<li>multicolumn sorting is also allowed, ex. "order_by=-founds|name"</li>
</ul>
<p><b>Note:</b> Try to avoid executing separate OKAPI request every time you

View File

@@ -52,18 +52,23 @@ class WebService
# Construct SQL conditions for the specified bounding box.
$search_assistant = new SearchAssistant($request);
$search_assistant->prepare_common_search_params();
$search_assistant->prepare_location_search_params();
$where_conds = array();
$where_conds[] = "caches.latitude between '".mysql_real_escape_string($bbsouth)."' and '".mysql_real_escape_string($bbnorth)."'";
$where_conds[] = $search_assistant->get_latitude_expr()." between '".mysql_real_escape_string($bbsouth)."' and '".mysql_real_escape_string($bbnorth)."'";
if ($bbeast > $bbwest)
{
# Easy one.
$where_conds[] = "caches.longitude between '".mysql_real_escape_string($bbwest)."' and '".mysql_real_escape_string($bbeast)."'";
$where_conds[] = $search_assistant->get_longitude_expr()." between '".mysql_real_escape_string($bbwest)."' and '".mysql_real_escape_string($bbeast)."'";
}
else
{
# We'll have to assume that this box goes through the 180-degree meridian.
# For example, $bbwest = 179 and $bbeast = -179.
$where_conds[] = "(caches.longitude > '".mysql_real_escape_string($bbwest)."' or caches.longitude < '".mysql_real_escape_string($bbeast)."')";
$where_conds[] = "(".$search_assistant->get_longitude_expr()." > '".mysql_real_escape_string($bbwest)
."' or ".$search_assistant->get_longitude_expr()." < '".mysql_real_escape_string($bbeast)."')";
}
#
@@ -75,12 +80,14 @@ class WebService
$center_lat = ($bbsouth + $bbnorth) / 2.0;
$center_lon = ($bbwest + $bbeast) / 2.0;
$search_params = SearchAssistant::get_common_search_params($request);
$search_params = $search_assistant->get_search_params();
$search_params['where_conds'] = array_merge($where_conds, $search_params['where_conds']);
$search_params['order_by'][] = Okapi::get_distance_sql($center_lat, $center_lon,
"caches.latitude", "caches.longitude"); # not replaced; added to the end!
$search_assistant->get_latitude_expr(),
$search_assistant->get_longitude_expr()); # not replaced; added to the end!
$search_assistant->set_search_params($search_params);
$result = SearchAssistant::get_common_search_result($search_params);
$result = $search_assistant->get_common_search_result();
return Okapi::formatted_response($request, $result);
}

View File

@@ -26,6 +26,10 @@
western hemispheres accordingly). These are full degrees with a dot
as a decimal point (ex. "48.7|15.8|54|24.9").</p>
</req>
<opt name='location_source' default='default-coords'>
Same as in the <a href="%OKAPI:methodargref:services/caches/search/nearest#location_source%">
services/caches/search/nearest</a> method.
</opt>
<import-params method='services/caches/search/all'/>
<common-format-params/>
<returns>

View File

@@ -52,7 +52,13 @@ class WebService
# formula and combine it with the LIMIT clause to get the best results.
#
$distance_formula = Okapi::get_distance_sql($center_lat, $center_lon, "caches.latitude", "caches.longitude");
$search_assistant = new SearchAssistant($request);
$search_assistant->prepare_common_search_params();
$search_assistant->prepare_location_search_params();
$distance_formula = Okapi::get_distance_sql(
$center_lat, $center_lon,
$search_assistant->get_latitude_expr(), $search_assistant->get_longitude_expr()
);
# 'radius' parameter is optional. If not given, we'll have to calculate the
# distance for every cache in the database.
@@ -70,11 +76,12 @@ class WebService
$where_conds[] = "$distance_formula <= '".mysql_real_escape_string($radius)."'";
}
$search_params = SearchAssistant::get_common_search_params($request);
$search_params = $search_assistant->get_search_params();
$search_params['where_conds'] = array_merge($where_conds, $search_params['where_conds']);
$search_params['order_by'][] = $distance_formula; # not replaced; added to the end!
$search_assistant->set_search_params($search_params);
$result = SearchAssistant::get_common_search_result($search_params);
$result = $search_assistant->get_common_search_result();
if ($radius == null)
{
# 'more' is meaningless in this case, we'll remove it.

View File

@@ -21,6 +21,20 @@
distance is given <b>in kilometers</b> instead of meters
(it can contain a floating point though).</p>
</opt>
<opt name='location_source' default='default-coords'>
<p>In general, this parameter should take the same value as in the
<a href="%OKAPI:methodargref:services/caches/formatters/gpx#location_source%">
services/caches/formatters/gpx</a> method, but currently <u>only two values are
supported</u>: <b>default-coords</b> and <b>alt_wpt:user-coords</b>.</p>
<p>Allows you to search among alternate locations of the geocache,
instead of the default one. Particularily useful with <b>alt_wpt:user-coords</b>
alternate waypoint.</p>
<p>Please note, that if you plan on using this option in conjunction
with <b>search_and_retrieve</b> method, then you'd probably want to use
the same option in your <i>retr_method</i> too (if available).</p>
</opt>
<import-params method='services/caches/search/all'/>
<common-format-params/>
<returns>

View File

@@ -63,7 +63,9 @@ class WebService
# Search params.
$search_params = SearchAssistant::get_common_search_params($request);
$search_assistant = new SearchAssistant($request);
$search_assistant->prepare_common_search_params();
$search_params = $search_assistant->get_search_params();
$tables = array_merge(
array('caches'),
$search_params['extra_tables']

View File

@@ -15,10 +15,31 @@ use Exception;
class SearchAssistant
{
/**
* Load, parse and check common geocache search parameters from the
* given OKAPI request. Most cache search methods share a common set
* of filtering parameters recognized by this method. It returns
* a dictionary of the following structure:
* Current request issued by the client.
*/
private $request; /* @var OkapiRequest */
/**
* Initializes an object with a content of the client request.
* (The request should contain common geocache search parameters.)
*/
public function __construct(OkapiRequest $request)
{
$this->request = $request;
$this->longitude_expr = NULL;
$this->latitude_expr = NULL;
$this->location_extra_sql = NULL;
$this->search_params = NULL;
}
/**
* This member holds a dictionary, which is used to build SQL query. For details,
* see documentation of get_search_params() and prepare_common_search_params()
*/
private $search_params;
/**
* This function returns a dictionary of the following structure:
*
* - "where_conds" - list of additional WHERE conditions to be ANDed
* to the rest of your SQL query,
@@ -29,12 +50,43 @@ class SearchAssistant
* - "extra_tables" - extra tables to be included in the FROM clause.
* - "extra_joins" - extra join statements to be included
*
* Important: YOU HAVE TO make sure that all data returned by this function
* are properly sanitized for SQL queries! I.e. they cannot contain unescaped
* user-supplied data. All user-suppied data which is returned by this function
* MUST be escaped!
* The dictionary is initalized by the call to prepare_common_search_params(),
* and may be further altered before an actual SQL execution, performed usually
* by get_common_search_result().
*
* If you alter the results, make sure to save them back to this class by calling
* set_search_params().
*
* Important: YOU HAVE TO make sure that all options are properly sanitized
* for SQL queries! I.e. they cannot contain unescaped user-supplied data.
*/
public static function get_common_search_params(OkapiRequest $request)
public function get_search_params()
{
return $this->search_params;
}
/**
* Set search params, a dictionary of the structure described in get_search_params().
*
* Important: YOU HAVE TO make sure that all options are properly sanitized
* for SQL queries! I.e. they cannot contain unescaped user-supplied data.
*/
public function set_search_params($search_params)
{
$this->search_params = $search_params;
}
/**
* Load, parse and check common geocache search parameters (the ones
* described in services/caches/search/all method) from $this->request.
* Most cache search methods share a common set
* of filtering parameters recognized by this method. It initalizes
* search params, which can be further altered by calls to other methods
* of this class, or outside of this class by a call to get_search_params();
*
* This method doesn't return anything. See get_search_params method.
*/
public function prepare_common_search_params()
{
$where_conds = array('true');
$extra_tables = array();
@@ -79,7 +131,7 @@ class SearchAssistant
# type
#
if ($tmp = $request->get_parameter('type'))
if ($tmp = $this->request->get_parameter('type'))
{
$operator = "in";
if ($tmp[0] == '-')
@@ -110,7 +162,7 @@ class SearchAssistant
# size2
#
if ($tmp = $request->get_parameter('size2'))
if ($tmp = $this->request->get_parameter('size2'))
{
$operator = "in";
if ($tmp[0] == '-')
@@ -138,7 +190,7 @@ class SearchAssistant
# status - filter by status codes
#
$tmp = $request->get_parameter('status');
$tmp = $this->request->get_parameter('status');
if ($tmp == null) $tmp = "Available";
$codes = array();
foreach (explode("|", $tmp) as $name)
@@ -158,7 +210,7 @@ class SearchAssistant
# owner_uuid
#
if ($tmp = $request->get_parameter('owner_uuid'))
if ($tmp = $this->request->get_parameter('owner_uuid'))
{
$operator = "in";
if ($tmp[0] == '-')
@@ -169,7 +221,7 @@ class SearchAssistant
try
{
$users = OkapiServiceRunner::call("services/users/users", new OkapiInternalRequest(
$request->consumer, null, array('user_uuids' => $tmp, 'fields' => 'internal_id')));
$this->request->consumer, null, array('user_uuids' => $tmp, 'fields' => 'internal_id')));
}
catch (InvalidParam $e) # invalid uuid
{
@@ -187,7 +239,7 @@ class SearchAssistant
foreach (array('terrain', 'difficulty', 'size', 'rating') as $param_name)
{
if ($tmp = $request->get_parameter($param_name))
if ($tmp = $this->request->get_parameter($param_name))
{
if (!preg_match("/^[1-5]-[1-5](\|X)?$/", $tmp))
throw new InvalidParam($param_name, "'$tmp'");
@@ -261,7 +313,7 @@ class SearchAssistant
# min_rcmds
#
if ($tmp = $request->get_parameter('min_rcmds'))
if ($tmp = $this->request->get_parameter('min_rcmds'))
{
if ($tmp[strlen($tmp) - 1] == '%')
{
@@ -284,7 +336,7 @@ class SearchAssistant
# min_founds
#
if ($tmp = $request->get_parameter('min_founds'))
if ($tmp = $this->request->get_parameter('min_founds'))
{
if (!is_numeric($tmp))
throw new InvalidParam('min_founds', "'$tmp'");
@@ -296,7 +348,7 @@ class SearchAssistant
# may be '0' for FTF hunts
#
if (!is_null($tmp = $request->get_parameter('max_founds')))
if (!is_null($tmp = $this->request->get_parameter('max_founds')))
{
if (!is_numeric($tmp))
throw new InvalidParam('max_founds', "'$tmp'");
@@ -307,7 +359,7 @@ class SearchAssistant
# modified_since
#
if ($tmp = $request->get_parameter('modified_since'))
if ($tmp = $this->request->get_parameter('modified_since'))
{
$timestamp = strtotime($tmp);
if ($timestamp)
@@ -320,15 +372,15 @@ class SearchAssistant
# found_status
#
if ($tmp = $request->get_parameter('found_status'))
if ($tmp = $this->request->get_parameter('found_status'))
{
if ($request->token == null)
if ($this->request->token == null)
throw new InvalidParam('found_status', "Might be used only for requests signed with an Access Token.");
if (!in_array($tmp, array('found_only', 'notfound_only', 'either')))
throw new InvalidParam('found_status', "'$tmp'");
if ($tmp != 'either')
{
$found_cache_ids = self::get_found_cache_ids($request->token->user_id);
$found_cache_ids = self::get_found_cache_ids($this->request->token->user_id);
$operator = ($tmp == 'found_only') ? "in" : "not in";
$where_conds[] = "caches.cache_id $operator ('".implode("','", array_map('mysql_real_escape_string', $found_cache_ids))."')";
}
@@ -338,11 +390,11 @@ class SearchAssistant
# found_by
#
if ($tmp = $request->get_parameter('found_by'))
if ($tmp = $this->request->get_parameter('found_by'))
{
try {
$user = OkapiServiceRunner::call("services/users/user", new OkapiInternalRequest(
$request->consumer, null, array('user_uuid' => $tmp, 'fields' => 'internal_id')));
$this->request->consumer, null, array('user_uuid' => $tmp, 'fields' => 'internal_id')));
} catch (InvalidParam $e) { # invalid uuid
throw new InvalidParam('found_by', $e->whats_wrong_about_it);
}
@@ -354,11 +406,11 @@ class SearchAssistant
# not_found_by
#
if ($tmp = $request->get_parameter('not_found_by'))
if ($tmp = $this->request->get_parameter('not_found_by'))
{
try {
$user = OkapiServiceRunner::call("services/users/user", new OkapiInternalRequest(
$request->consumer, null, array('user_uuid' => $tmp, 'fields' => 'internal_id')));
$this->request->consumer, null, array('user_uuid' => $tmp, 'fields' => 'internal_id')));
} catch (InvalidParam $e) { # invalid uuid
throw new InvalidParam('not_found_by', $e->whats_wrong_about_it);
}
@@ -370,9 +422,9 @@ class SearchAssistant
# watched_only
#
if ($tmp = $request->get_parameter('watched_only'))
if ($tmp = $this->request->get_parameter('watched_only'))
{
if ($request->token == null)
if ($this->request->token == null)
throw new InvalidParam('watched_only', "Might be used only for requests signed with an Access Token.");
if (!in_array($tmp, array('true', 'false')))
throw new InvalidParam('watched_only', "'$tmp'");
@@ -381,7 +433,7 @@ class SearchAssistant
$watched_cache_ids = Db::select_column("
select cache_id
from cache_watches
where user_id = '".mysql_real_escape_string($request->token->user_id)."'
where user_id = '".mysql_real_escape_string($this->request->token->user_id)."'
");
$where_conds[] = "caches.cache_id in ('".implode("','", array_map('mysql_real_escape_string', $watched_cache_ids))."')";
}
@@ -391,9 +443,9 @@ class SearchAssistant
# exclude_ignored
#
if ($tmp = $request->get_parameter('exclude_ignored'))
if ($tmp = $this->request->get_parameter('exclude_ignored'))
{
if ($request->token == null)
if ($this->request->token == null)
throw new InvalidParam('exclude_ignored', "Might be used only for requests signed with an Access Token.");
if (!in_array($tmp, array('true', 'false')))
throw new InvalidParam('exclude_ignored', "'$tmp'");
@@ -401,7 +453,7 @@ class SearchAssistant
$ignored_cache_ids = Db::select_column("
select cache_id
from cache_ignore
where user_id = '".mysql_real_escape_string($request->token->user_id)."'
where user_id = '".mysql_real_escape_string($this->request->token->user_id)."'
");
$where_conds[] = "caches.cache_id not in ('".implode("','", array_map('mysql_real_escape_string', $ignored_cache_ids))."')";
}
@@ -411,21 +463,21 @@ class SearchAssistant
# exclude_my_own
#
if ($tmp = $request->get_parameter('exclude_my_own'))
if ($tmp = $this->request->get_parameter('exclude_my_own'))
{
if ($request->token == null)
if ($this->request->token == null)
throw new InvalidParam('exclude_my_own', "Might be used only for requests signed with an Access Token.");
if (!in_array($tmp, array('true', 'false')))
throw new InvalidParam('exclude_my_own', "'$tmp'");
if ($tmp == 'true')
$where_conds[] = "caches.user_id != '".mysql_real_escape_string($request->token->user_id)."'";
$where_conds[] = "caches.user_id != '".mysql_real_escape_string($this->request->token->user_id)."'";
}
#
# name
#
if ($tmp = $request->get_parameter('name'))
if ($tmp = $this->request->get_parameter('name'))
{
# WRTODO: Make this more user-friendly. See:
# http://code.google.com/p/opencaching-api/issues/detail?id=121
@@ -440,7 +492,7 @@ class SearchAssistant
# with_trackables_only
#
if ($tmp = $request->get_parameter('with_trackables_only'))
if ($tmp = $this->request->get_parameter('with_trackables_only'))
{
if (!in_array($tmp, array('true', 'false'), 1))
throw new InvalidParam('with_trackables_only', "'$tmp'");
@@ -459,7 +511,7 @@ class SearchAssistant
# ftf_hunter
#
if ($tmp = $request->get_parameter('ftf_hunter'))
if ($tmp = $this->request->get_parameter('ftf_hunter'))
{
if (!in_array($tmp, array('true', 'false'), 1))
throw new InvalidParam('not_yet_found_only', "'$tmp'");
@@ -473,7 +525,7 @@ class SearchAssistant
# set_and
#
if ($tmp = $request->get_parameter('set_and'))
if ($tmp = $this->request->get_parameter('set_and'))
{
# Check if the set exists.
@@ -493,14 +545,14 @@ class SearchAssistant
# limit
#
$limit = $request->get_parameter('limit');
$limit = $this->request->get_parameter('limit');
if ($limit == null) $limit = "100";
if (!is_numeric($limit))
throw new InvalidParam('limit', "'$limit'");
if ($limit < 1 || (($limit > 500) && (!$request->skip_limits)))
if ($limit < 1 || (($limit > 500) && (!$this->request->skip_limits)))
throw new InvalidParam(
'limit',
$request->skip_limits
$this->request->skip_limits
? "Cannot be lower than 1."
: "Has to be between 1 and 500."
);
@@ -509,16 +561,16 @@ class SearchAssistant
# offset
#
$offset = $request->get_parameter('offset');
$offset = $this->request->get_parameter('offset');
if ($offset == null) $offset = "0";
if (!is_numeric($offset))
throw new InvalidParam('offset', "'$offset'");
if (($offset + $limit > 500) && (!$request->skip_limits))
if (($offset + $limit > 500) && (!$this->request->skip_limits))
throw new BadRequest("The sum of offset and limit may not exceed 500.");
if ($offset < 0 || (($offset > 499) && (!$request->skip_limits)))
if ($offset < 0 || (($offset > 499) && (!$this->request->skip_limits)))
throw new InvalidParam(
'offset',
$request->skip_limits
$this->request->skip_limits
? "Cannot be lower than 0."
: "Has to be between 0 and 499."
);
@@ -528,7 +580,7 @@ class SearchAssistant
#
$order_clauses = array();
$order_by = $request->get_parameter('order_by');
$order_by = $this->request->get_parameter('order_by');
if ($order_by != null)
{
$order_by = explode('|', $order_by);
@@ -575,35 +627,33 @@ class SearchAssistant
'extra_joins' => $extra_joins,
);
return $ret_array;
if ($this->search_params === NULL)
{
$this->search_params = $ret_array;
} else {
$this->search_params = array_merge_recursive($this->search_params, $ret_array);
}
}
/**
* Search for caches using given conditions and options. Return
* an array in a "standard" format of array('results' => list of
* Search for caches using conditions and options stored in the instance
* of this class. These conditions are usually initialized by the call
* to prepare_common_search_params(), and may be further altered by the
* client of this call by calling get_search_params() and set_search_params().
*
* Returns an array in a "standard" format of array('results' => list of
* cache codes, 'more' => boolean). This method takes care of the
* 'more' variable in an appropriate way.
*
* The $options parameter include:
* - where_conds - list of additional WHERE conditions to be ANDed
* to the rest of your SQL query,
* - extra_tables - list of additional tables to be joined within
* the query,
* - order_by - list or SQL clauses to be used with ORDER BY,
* - limit - maximum number of cache codes to be returned.
*
* Important: YOU HAVE TO make sure that all options are properly sanitized
* for SQL queries! I.e. they cannot contain unescaped user-supplied data.
*/
public static function get_common_search_result($options)
public function get_common_search_result()
{
$tables = array_merge(
array('caches'),
$options['extra_tables']
$this->search_params['extra_tables']
);
$where_conds = array_merge(
array('caches.wp_oc is not null'),
$options['where_conds']
$this->search_params['where_conds']
);
# We need to pull limit+1 items, in order to properly determine the
@@ -612,13 +662,13 @@ class SearchAssistant
$cache_codes = Db::select_column("
select caches.wp_oc
from ".implode(", ", $tables)." ".
implode(" ", $options['extra_joins'])."
implode(" ", $this->search_params['extra_joins'])."
where ".implode(" and ", $where_conds)."
".((count($options['order_by']) > 0) ? "order by ".implode(", ", $options['order_by']) : "")."
limit ".($options['offset']).", ".($options['limit'] + 1).";
".((count($this->search_params['order_by']) > 0) ? "order by ".implode(", ", $this->search_params['order_by']) : "")."
limit ".($this->search_params['offset']).", ".($this->search_params['limit'] + 1).";
");
if (count($cache_codes) > $options['limit'])
if (count($cache_codes) > $this->search_params['limit'])
{
$more = true;
array_pop($cache_codes); # get rid of the one above the limit
@@ -633,6 +683,98 @@ class SearchAssistant
return $result;
}
# Issue #298 - user coordinates implemented in oc.pl
private $longitude_expr;
private $latitude_expr;
/**
* This method extends search params in case you would like to search
* using the geocache location, i.e. search for the geocaches nearest
* to the given location. When you search for such geocaches, you must
* use expressions returned by get_longitude_expr() and get_latitude_expr()
* to query for the actual location of geocaches.
*/
public function prepare_location_search_params()
{
$location_source = $this->request->get_parameter('location_source');
if (!$location_source)
$location_source = 'default-coords';
# Make sure location_source has prefix alt_wpt:
if ($location_source != 'default-coords' && strncmp($location_source, 'alt_wpt:', 8) != 0)
{
throw new InvalidParam('location_source', '\''.$location_source.'\'');
}
# Make sure we have sufficient authorization
if ($location_source == 'alt_wpt:user-coords' && $this->request->token == null)
{
throw new BadRequest("Level 3 Authentication is required to access 'alt_wpt:user-coords'.");
}
if ($location_source != 'alt_wpt:user-coords') {
# unsupported waypoint type - use default geocache coordinates
$location_source = 'default-coords';
}
if ($location_source == 'default-coords')
{
$this->longitude_expr = 'caches.longitude';
$this->latitude_expr = 'caches.latitude';
} else {
$extra_joins = null;
if (Settings::get('OC_BRANCH') == 'oc.pl')
{
$this->longitude_expr = 'ifnull(cache_mod_cords.longitude, caches.longitude)';
$this->latitude_expr = 'ifnull(cache_mod_cords.latitude, caches.latitude)';
$extra_joins = array("
left join cache_mod_cords
on cache_mod_cords.cache_id = caches.cache_id
and cache_mod_cords.user_id = '".mysql_real_escape_string($this->request->token->user_id)."'
");
} else {
# oc.de
$this->longitude_expr = 'ifnull(coordinates.longitude, caches.longitude)';
$this->latitude_expr = 'ifnull(coordinates.latitude, caches.latitude)';
$extra_joins = array("
left join coordinates
on coordinates.cache_id = caches.cache_id
and coordinates.user_id = '".mysql_real_escape_string($this->request->token->user_id)."'
and coordinates.type = 2
and coordinates.longitude != 0
and coordinates.latitude != 0
");
}
$location_extra_sql = array(
'extra_joins' => $extra_joins
);
if ($this->search_params === NULL)
{
$this->search_params = $location_extra_sql;
} else {
$this->search_params = array_merge_recursive($this->search_params, $location_extra_sql);
}
}
}
/**
* Returns the expression used as cache's longitude source. You may use this
* method only after prepare_search_params_for_location() invocation.
*/
public function get_longitude_expr()
{
return $this->longitude_expr;
}
/**
* Returns the expression used as cache's latitude source. You may use this
* method only after prepare_search_params_for_location() invocation.
*/
public function get_latitude_expr()
{
return $this->latitude_expr;
}
/**
* Get the list of cache IDs which were found by given user.
* Parameter needs to be *internal* user id, not uuid.

View File

@@ -67,6 +67,17 @@ class WebService
foreach ($log_uuids as $log_uuid)
$results[] = $logs[$log_uuid];
/* Handle OCPL's "access logs" feature. */
if (
(Settings::get('OC_BRANCH') == 'oc.pl')
&& Settings::get('OCPL_ENABLE_GEOCACHE_ACCESS_LOGS')
&& (count($log_uuids) > 0)
) {
require_once($GLOBALS['rootpath'].'okapi/lib/ocpl_access_logs.php');
\okapi\OCPLAccessLogs::log_geocache_access($request, $cache['internal_id']);
}
return Okapi::formatted_response($request, $results);
}
}

View File

@@ -209,7 +209,7 @@ class WebService
$opt['rootpath'] = $GLOBALS['rootpath'];
$opt['html_purifier'] = Settings::get('OCDE_HTML_PURIFIER_SETTINGS');
require_once $GLOBALS['rootpath'] . 'lib2/OcHTMLPurifier.class.php';
require_once($GLOBALS['rootpath'] . 'lib2/OcHTMLPurifier.class.php');
$purifier = new \OcHTMLPurifier($opt);
$formatted_comment = $purifier->purify($formatted_comment);
@@ -564,7 +564,7 @@ class WebService
update caches
set
founds = founds + 1,
last_found = greatest(last_found, from_unixtime('".mysql_real_escape_string($when)."'))
last_found = greatest(ifnull(last_found, 0), from_unixtime('".mysql_real_escape_string($when)."'))
where cache_id = '".mysql_real_escape_string($cache_internal_id)."'
");
}

View File

@@ -18,7 +18,9 @@
</opt>
<common-format-params/>
<returns>
<p>Log entries. A dictionary of the following format:</p>
<p>A list of log entries, ordered by descending date. Each entry is a
dictionary of the following format:</p>
<ul>
<li><b>uuid</b> - ID of the log entry,</li>
<li>
@@ -34,8 +36,10 @@
everything</b>, but there are some primary types (see logs/entry
method for more info).</p>
</li>
<li><b>comment</b> - <a href='%OKAPI:docurl:html%'>HTML string</a>, text entered
with the log entry.</li>
<li>
<b>comment</b> - <a href='%OKAPI:docurl:html%'>HTML string</a>, text entered
with the log entry.
</li>
</ul>
</returns>
</xml>

View File

@@ -2,8 +2,8 @@
<brief>Get the list of changes for your database</brief>
<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
<p>Get the list of changes to be <u>replayed on your own copy
of Opencaching database</u>. Use this method periodically (e.g. every 5 minutes) 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
@@ -15,10 +15,11 @@
<p>A couple of things for you to remember:</p>
<ul>
<li>You <b>must</b> update your database frequently for this method to work.
We don't keep the changelog indefinitelly. You must update at least once every week.</li>
<li>You <b>should not</b> update your database more frequently than once every
5 minutes. This won't do you any good, since we update the changelog only once
every 5 minutes anyway.</li>
We don't keep the changelog indefinitelly. You must update at least once a week!</li>
<li>You <b>should not</b> update your database more frequently than once per
5 minutes. This could kill our servers, and it wouldn't do you any good, since
we update the changelog only once every 5 minutes anyway.</li>
</ul>
<p>Let's assume that you already have a copy of OKAPI database, but it's
@@ -31,21 +32,27 @@
this, your database is up-to-date.</p>
<p>We use <b>revision</b> numbers to keep track of all the versions of the
database. Every time you update a database, you receive the <b>revision</b>
number along with it. You must keep this number carefully, because you need
database. Every time we update a database, the <b>revision</b> is increased.
You will also receive this number every time you fetch a changelog or a fulldump
of our database. You must keep this number carefully, because you need
it in order for us to generate a proper changelog for you next time you ask
for it.</p>
for it!</p>
<p>Example. This is a valid list of requests you should issue and their
<p><b>Example.</b> This is a valid list of requests you should issue and their
responses:</p>
<ul>
<li><b>fulldump</b> - you receive a fulldump of our database with the
revision number 238004. <b>You will call this method only once, never again.</b></li>
revision number 238004. <b>You will call this method only once</b> (to
initiate your copy of the database).</li>
<li><b>changelog</b>?since=238004 - OKAPI checks if there were any changes
recorded since revision 238004. It responds with the list of changes and the
new revision number 238017. You replay the changes on your database.</li>
<li>You wait for some time between requesting the changelog again.</li>
<li><b>changelog</b>?since=238017 - etc.</li>
<li>Upon your next update, you'll ask for <b>changelog</b>?since=238017, etc.</li>
</ul>
</desc>
<req name='since'>
@@ -88,7 +95,7 @@
</ul>
</li>
<li>
<p><b>fields</b> - a dictionary of fields associated with the object (present only
<p><b>data</b> - a dictionary of fields associated with the object (present only
if <b>change_type</b> equals <b>replace</b>).</p>
<ul>
<li>For <b>geocache</b> objects, this might be any subset of fields described

View File

@@ -7,57 +7,62 @@
<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
OKAPI's <b>replicate</b> module to achive this condition. The <b>changelog</b> method
OKAPI's <b>replicate</b> module to achive this state. 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>
<p><b>Important:</b> There is a remote possibility that this method MAY change in
a non-backward-compatible way or it might even get removed. We don't plan on doing
this, but we might be forced to (i.e. to prevent abuse).</p>
<p><b>Note:</b> The cache descriptions will be generated using the <b>attribution_append=static</b>
parameter (see the geocache method). Full attributions are not always suitable for replication,
since they may contain dates on some installations
(<a href='https://code.google.com/p/opencaching-api/issues/detail?id=178'>why?</a>).
To make sure that static attributions are enough, consult the local Data
Licence (the Sign Up page).</p>
<p>A couple of things for you to remember:</p>
<ul>
<li>Currently, this functionality is available <b>for developers only</b>,
NOT for the individual users. We don't want users to download a fresh snapshot of
<li>Currently, this method is available <b>for developers only</b>,
not for the individual users. We don't want users to download a fresh snapshot of
the entire database every time they want, this could kill our servers.
If you want to enable such features for your users, you can do it, but you
must use <b>your own server</b> for data traffic (especially, fulldump requests).</li>
must use <b>your own server</b> for serving fulldump requests. (You don't
have to use your server to relay changelog requests.)</li>
<li>Fulldump is a copy of the entire database. We generate such copy once every couple of
days. This copy if intended for you to start only, later you must use the changelog to
keep it up-to-date.</li>
days. This copy if intended for you to make a fresh start only. Later, you
must use the <b>changelog</b> method to keep your data up-to-date.</li>
<li>Every time our database is extended (new fields or new object types), and you want to
make use of these new fields, you are of course allowed to download a fulldump copy again.</li>
<li>There is no XMLMAP version of this file.</li>
<li>There is no XMLMAP version of this file. JSON only.</li>
</ul>
<p><b>Additional notes on data attribution:</b> Cache descriptions will be
generated using the <b>attribution_append=static</b> parameter (see the
geocache method). This is because the full attributions are not always suitable
for replication, since they may contain dynamically changing dates on some
installations (<a href='https://code.google.com/p/opencaching-api/issues/detail?id=178'>why?</a>).
To make sure that static attributions are enough, consult the local Data
Licence (the Sign Up page).</p>
</desc>
<returns>
<p>Archive with JSON-encoded files. File named <b>index.json</b> will contain a dictionary
of the following structure:</p>
<p>Compressed archive with JSON-encoded files. File named <b>index.json</b> will
contain a dictionary of the following structure:</p>
<ul>
<li><b>revision</b> - revision of the database snapshot contained in the archive,</li>
<li><b>data_files</b> - list of filenames which contain the changelog entries for
you to parse. Each file contains a JSON-encoded list of changelog entries, in format
described in the <b>changelog</b> method ("replace" only).</li>
<li><b>meta</b> - a dictionary of other meta data, not important.</li>
</ul>
<p>Note: We use TGZ or TBZ2 format to encode this archive:</p>
<ul>
<li><b>TGZ</b> archive (more commonly known as <b>.tar.gz</b> archive) is a TAR
<li><b>TGZ</b> archive (also known as <b>.tar.gz</b>) is a TAR
archive compressed with GZIP.</li>
<li><b>TBZ2</b> archive (more commonly known as <b>.tar.bz2</b> archive) is a TAR
<li><b>TBZ2</b> archive (also known as <b>.tar.bz2</b>) is a TAR
archive compressed with BZIP2.</li>
</ul>
<p>There are many tools available for handling these archives. In Linux, try "tar -xf filename".</p>
</returns>
</xml>

View File

@@ -19,7 +19,7 @@ use okapi\Settings;
class ReplicateCommon
{
private static $chunk_size = 50;
private static $logged_cache_fields = 'code|names|location|type|status|url|owner|founds|notfounds|size|size2|oxsize|difficulty|terrain|rating|rating_votes|recommendations|req_passwd|descriptions|hints|images|trackables_count|trackables|alt_wpts|last_found|last_modified|date_created|date_hidden';
private static $logged_cache_fields = 'code|names|location|type|status|url|owner|founds|notfounds|size|size2|oxsize|difficulty|terrain|rating|rating_votes|recommendations|req_passwd|descriptions|hints|images|trackables_count|trackables|alt_wpts|last_found|last_modified|date_created|date_hidden|attr_acodes|willattends|country|state|preview_image|trip_time|trip_distance|gc_code|hints2|protection_areas';
private static $logged_log_entry_fields = 'uuid|cache_code|date|user|type|was_recommended|comment';
/** Return current (greatest) changelog revision number. */
@@ -153,7 +153,9 @@ class ReplicateCommon
*
* Currently, only caches are checked (log entries are not).
*/
public static function verify_clog_consistency()
public static function verify_clog_consistency(
$force_all=false, $geocache_ignored_fields = null
)
{
set_time_limit(0);
ignore_user_abort(true);
@@ -162,11 +164,14 @@ class ReplicateCommon
# Such entries might have not been seen by the update_clog_table() yet
# (e.g. other long-running cronjob is preventing update_clog_table from
# running).
#
# If $force_all is true, then all caches will be verified. This is
# quite important when used in conjunction with ignored_fields.
$cache_codes = Db::select_column("
select wp_oc
from caches
where okapi_syncbase < date_add(now(), interval -1 day);
".($force_all ? "" : "where okapi_syncbase < date_add(now(), interval -1 day)")."
");
$cache_code_groups = Okapi::make_groups($cache_codes, 50);
unset($cache_codes);
@@ -188,6 +193,24 @@ class ReplicateCommon
continue;
$cache_code = $entry['object_key']['code'];
if (($entry['change_type'] == 'replace') && ($geocache_ignored_fields != null)) {
# We were called with a non-null ignored fields. Probably
# this call originated from the database update script
# and new fields have been added to the replicate module.
# We will ignore such new fields - this way no unnecessary
# clog entries will be created.
foreach ($geocache_ignored_fields as $field) {
unset($entry['data'][$field]);
}
if (count($entry['data']) == 0) {
# Skip this geocache. Nothing was changed here, only
# new fields have been added.
continue;
}
}
# We will story the first and the last entry in the $two_examples
# vars which is to be emailed to OKAPI developers.

View File

@@ -164,6 +164,14 @@ final class Settings
* Settings for the OCDE HTML purifier which is used by services/logs/submit.
*/
'OCDE_HTML_PURIFIER_SETTINGS' => array(),
/**
* This is a BETA feature, and it works on OCPL branch only (it
* requires some undocumented OCPL tables). This feature may be removed
* at any moment. OCPL admins temporarily use feature to track
* suspicious activity of some certain users.
*/
'OCPL_ENABLE_GEOCACHE_ACCESS_LOGS' => false,
);
/**
@@ -273,6 +281,6 @@ final class Settings
public static function describe_settings()
{
return print_r(self::$SETTINGS, true);
return Okapi::removeSensitiveData(print_r(self::$SETTINGS, true));
}
}

View File

@@ -42,21 +42,11 @@ a basic OAuth Console for OKAPI methods. It is an open-source project. You can
<h2 id='libraries'>Are there any client libraries?</h2>
<p>OKAPI <b>does not</b> require you to use any special libraries, usually you will want to
use OKAPI "as is", via basic HTTP requests and responses.</p>
<p>However, some third-party libraries exist and you can use them if you want. With proper
libraries, OKAPI might be easier to use. We give you the list of all libraries we know of.
It's your choice to decide which are "proper".</p>
<ul>
<li>If you're developing with .NET, you may want to check out
<a target='_blank' href='http://code.google.com/p/okapi-dotnet-client/'>.NET
client library</a> by Oliver Dietz.</li>
<li>(if you've developed your own library and would like to include it here,
post the details in a comment thread below)</li>
</ul>
<p>You should check with the author of the library before you use it, to make sure it is
up-to-date. If you believe it is not, then keep in mind that learning to use our REST
protocol might be the safest choice.</p>
<p>OKAPI <b>does not</b> require you to use any special libraries. You should use
OKAPI "as is", via basic HTTP requests and responses.</p>
<p>However, if you know of any useful third-party libraries, then let us know.
We may choose to post a link somewhere here.</p>
<div class='issue-comments' issue_id='96'></div>

View File

@@ -340,7 +340,11 @@ contain additional keys. Possible values of the <b>reason_stack</b> include:</p>
ask your user to fix the clock or use the provided extra keys to adjust
it yourself. Extra keys:</p>
<ul>
<li><b>yours</b> - timestamp you have supplied,</li>
<li>
<b>yours</b> - timestamp you have supplied (this used to be a
string, but now it is being casted to an integer, see
<a href='https://code.google.com/p/opencaching-api/issues/detail?id=314'>here</a>),
</li>
<li><b>ours</b> - timestamp on our server,</li>
<li><b>difference</b> - the difference (to be added to your clock),</li>
<li><b>threshold</b> - the maximum allowed difference.</li>

View File

@@ -70,8 +70,9 @@ $m = $vars['method'];
standard OAuth Consumer signing arguments:
<i>oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature,
oauth_signature_method, oauth_version</i>.
<b>Plus <?= $m['auth_options']['oauth_token'] ?></b> <i>oauth_token</i>
for Token authorization.
<? if ($m['auth_options']['min_auth_level'] == 3) { ?>
<b>Plus required</b> <i>oauth_token</i> for Token authorization.
<? } ?>
<? } ?>
</td>
</tr>

View File

@@ -17,6 +17,7 @@ use okapi\OkapiInternalRequest;
use okapi\Settings;
use okapi\OkapiLock;
use okapi\cronjobs\CronJobController;
use okapi\services\replicate\ReplicateCommon;
require_once($GLOBALS['rootpath']."okapi/cronjobs.php");
@@ -94,6 +95,20 @@ class View
{
self::out("Current OKAPI settings are:\n\n".Settings::describe_settings()."\n\n".
"Make sure they are correct, then append '?install=true' to your query.");
try
{
Db::select_value("select 1 from caches limit 1");
}
catch (Exception $e)
{
self::out(
"\n\n".
"IMPORTANT: If you're trying to install OKAPI on an empty database then\n".
"you will fail. OKAPI is not a standalone application, it is a plugin\n".
"for Opencaching sites. Please read this:\n\n".
"https://code.google.com/p/opencaching-api/issues/detail?id=299"
);
}
return;
}
elseif ($max_ver == $current_ver)
@@ -677,4 +692,17 @@ class View
private static function ver86() { Db::execute("alter table okapi_nonces change column `key` nonce_hash varchar(32) character set utf8 collate utf8_bin not null;"); }
private static function ver87() { Db::execute("alter table okapi_nonces add primary key (consumer_key, nonce_hash);"); }
private static function ver88() { Db::execute("alter table okapi_consumers add column admin tinyint not null default 0;"); }
private static function ver89()
{
# Ignore newly added replicate fields. This way we will avoid generating
# changelog entries for these fields.
require_once($GLOBALS['rootpath']."okapi/services/replicate/replicate_common.inc.php");
$new_geocache_fields = array(
'attr_acodes', 'willattends', 'country', 'state', 'preview_image',
'trip_time', 'trip_distance', 'gc_code', 'hints2', 'protection_areas'
);
ReplicateCommon::verify_clog_consistency(true, $new_geocache_fields);
}
}