docs and utils cleanup / update / lib2-ports

and added cache name trimming, see util2/cache_repairnames/repairnames.cpp
This commit is contained in:
following
2013-07-17 17:14:40 +02:00
parent 4a589e8872
commit 22e98f5e00
36 changed files with 880 additions and 1174 deletions

View File

@ -8,6 +8,9 @@ for Database changelog, see htdocs/doc/sql/db-changes.txt
Opencaching Network Implementation Version 2.0
Changes File
This list is incomplete.
27.08.2010 (Oliver)
- modified translation system
(see translation.php, "scan source files" added)

View File

@ -1,37 +0,0 @@
Opencaching Network Implementation Version 2.0
22 May 2007
Copyright (C) 2007 opencaching.de
cracklib Information
1) Install cracklib
Download and Install
http://sourceforge.net/projects/cracklib
Use the small wordlist shipped with the package.
2) Install php-extension
Downlad pecl-extension
http://pecl.php.net/get/crack-0.4.tgz
Extract the content
# cd into the source-directory
# phpize
# ./configure
# make
# copy crack.so to your php-extension directory
set php.ini
[Crack]
crack.default_dictionary = "/usr/local/share/cracklib/pw_dict"
Further reading:
http://www.php.net/manual/de/function.crack-check.php
http://www.phpbar.de/w/PECL
http://pecl.php.net/package/crack

View File

@ -1,141 +0,0 @@
<html>
<body>
<h1>Directory structure</h1>
<p><em>This documentation is outdated.</em></p>
<h2>Preface</h2>
<p>
The overall directory structure seems to be complex and redudant.
The reason for this is that we still have to support the directory structure of
previous source codes. Some of these directories can be removed in future
when the old source codes have been updated to use the current template
engine. Some other directories should be kept in future, because some
geocache listings or other website may reference to files inside that
directories. This document will first explain the currently intended directory
structure and after that explain the obsolete directories. You should only
use the new directory structure in new developments.<br />
<br />
All directories in this document will reference to trunk as base directory.
Other branches and tags should use the same directory structure.
</p>
<h2>Directories</h2>
<h3>code</h3>
<p>
All files that have to be uploaded to the webserver are contained in this
directory.
</p>
<h3>code/bin</h3>
<p>
Command line utilities for Opencaching administration and utlilities used
by the PHP code. This directory should only contain the binary itself. Config
files and libraries should be placed in the appropriate directory.
</p>
<h3>code/config</h3>
<p>
Contains configuration files. The source code is delivered with an default
configuration (settings-dist.inc.php). In the local webserver configuration
(settings.inc.php) only values have to be included that differ from the default
configuration. An example of this configuration is delivered with
(settings-sample.inc.php).
</p>
<h3>code/htdocs</h3>
<p>
This directory should be the document root of the apache configuration. Only
these files have to be accessible for web users.
</p>
<h3>code/lib</h3>
<p>
Contains Opencaching business logic files and classes.<br />
Subdirectories may be created for storing a set of classes that contain to
the same functionality like "search modules".
</p>
<h3>code/template</h3>
<p>
Smarty HTML templates.
</p>
<h3>code/upload</h3>
<p>
Directory containing all files that the users have uploaded. A seperate
structure of subdirectories may be created for each upload functionality
(e.g. GPX files or images).
</p>
<h3>code/webcache</h3>
<p>
Directory for caching files used to generate or speed up site processing.
Like compiled smarty files or caching of the menu structure.
</p>
<h3>documentation</h3>
<p>
See <a href="../index.html">documentation</a> for details.
</p>
<h3>resource</h3>
<p>
Contains files that were used to generate images and other "generated content".<br />
Subdirectory structure may be used where appropriate.
</p>
<h2>Obsolete directories</h2>
<p>
Existing sources have been copied to code/htdocs because in previous codes, there
was no strict seperation between "inside" and "ouside" the public accessbile root
directory of the web server.
</p>
<p>
There are 2 template engines used in the opencaching source code.<br />
The first one is a self-written template engine (refered as "old") and the
second one is smarty (refered as "new").<br />
You can determine what source code is used when you
look into the first code lines of the file. If the soruce file
includes "lib/common.inc.php" the old template system is used. If it includes
"lib2/web.inc.php", the new template engine is used.<br />
Directories ending with "2" belong to the new template engine. Directories
without a "2" at the end belong the the old template engine.
</p>
<h3>code/htdocs/cache</h3>
<h3>code/htdocs/cache2</h3>
<h3>code/htdocs/cache2/smarty/cache</h3>
<h3>code/htdocs/cache2/smarty/compiled</h3>
<h3>code/htdocs/cache2/translate</h3>
<h3>code/htdocs/config2</h3>
<h3>code/htdocs/doc</h3>
<h3>code/htdocs/doc/sql/static-data</h3>
<h3>code/htdocs/doc/sql/stored-proc</h3>
<h3>code/htdocs/doc/sql/tables</h3>
<h3>code/htdocs/doc2</h3>
<h3>code/htdocs/doc2/images</h3>
<h3>code/htdocs/download</h3>
<h3>code/htdocs/html</h3>
<h3>code/htdocs/images</h3>
<h3>code/htdocs/lang/de/ocstyle</h3>
<h3>code/htdocs/lang/de/ocstyle/email</h3>
<h3>code/htdocs/lang/de/ocstyle/images</h3>
<h3>code/htdocs/lang/de/ocstyle/js</h3>
<h3>code/htdocs/lang/de/ocstyle/lib</h3>
<h3>code/htdocs/lib</h3>
<h3>code/htdocs/lib2</h3>
<h3>code/htdocs/lib2/logic</h3>
<h3>code/htdocs/resource2/misc</h3>
<h3>code/htdocs/resource2/ocstyle</h3>
<h3>code/htdocs/resource2/tinymce</h3>
<h3>code/htdocs/statpics</h3>
<h3>code/htdocs/templates/mail</h3>
<h3>code/htdocs/templates/ocstyle</h3>
<h3>code/htdocs/templates/ocstyle/articles</h3>
<h3>code/htdocs/util</h3>
<h3>code/htdocs/util2</h3>
<h3>code/htdocs/xml</h3>
</body>
</html>

View File

@ -4,49 +4,42 @@
Rechteverwaltung
Rechte gelten jeweils f<EFBFBD>r alle zuordneten Objekte
Rechte gelten jeweils für alle zuordneten Objekte
z.B. Beschreibung und Bilder.
F<EFBFBD>r Caches
Für Caches
Jeder Besitzer ADMIN_USER
Anzeigen *1 X X
Anlegen X
Bearbeiten X *2
L<EFBFBD>schen *3
Löschen
*1 wenn Status 1-3
*2 Status <20>ndern
GC-Wegpunkt <20>ndern
Beschreibung mit Fixtext ersetzen (Urheberrechtsverletzung)
Bild mit Fixbild ersetzen (Urheberrechtsverletzung)
Erzeugt auch E-Mail an den Owner
*3 Zusammen mit Logs, Beschreibung und Bildern
Erzeugt auch E-Mail an den Owner
*2 Status ändern
F<EFBFBD>r Cachelogs
Jeder Log-Besitzer Cache-Besitzer ADMIN_USER
Anzeigen *1 *1 X X
Anlegen X X X X
Bearbeiten X
L<EFBFBD>schen X *2 *2
*1 wenn Cache-Status 1-3
*2 Mit L<>schkommentar der an den Owner geschickt wird
F<EFBFBD>r Beschreibungen und Bilder
Für Cachebeschreibungen und Bilder
Jeder Besitzer ADMIN_USER
Anzeigen *1 X X
Anlegen X
Bearbeiten
L<EFBFBD>schen X
Bearbeiten X
Löschen X
*1 wenn Cache-Status 1-3
Für Cachelogs
Jeder Log-Besitzer Cache-Besitzer ADMIN_USER
Anzeigen *1 *1 X X
Anlegen X X X *4
Bearbeiten X *2
Löschen X *3
*1 wenn Cache-Status 1-3 (suboptiomal beim Log-Besitzer)
*2 geplant: Spoierflag setzen (siehe Todo #97)
*3 mit Löschkommentar der an den Owner geschickt wird
*4 mit OC-Team-Flag beim Abarbeiten einer Cachemeldung

View File

@ -1,38 +0,0 @@
<html>
<body>
<h1>Opencaching source code documentation</h1>
<p>
Documentation is grouped into the following main parts:<br />
<br />
<ul>
<li>License</li>
<li>Administraton</li>
<li>Database</li>
<li>Code</li>
<li>API</li>
</ul>
If you are interested in writing 3rd party applications, you
only need to know the licensing and API documentation.<br />
However, some knowledge of the database schema may be heplfull.<br />
<br />
Before reading other documents, you may want to inform youself about
the <a href="directories.html">directory structure</a>.<br />
</p>
<h2>License</h2>
<p>
<a href="license.txt">License</a>
</p>
<h2>Administraton</h2>
<h2>Database</h2>
<h2>Code</h2>
<a href="repository.html">Repository usage</a><br />
<a href="directories.html">Directory structure</a><br />
<h2>API</h2>
</body>
</html>

View File

@ -47,11 +47,11 @@
You need to configure each slave database in the configuration see settings-dist.inc.php
for available options.
3.2 util2/replication_monitor/replication_monitor.sh
3.2 local/prodsys/replication_monitor.sh
This script updates a timestamp in the database every 10 seconds.
This timestamp will be replicated to each slave and can therefore
detect in a reliable way what time lack is in the binary log.
detect in a reliable way what time lag is in the binary log.
See remarks in the script how to install and use it.
@ -64,7 +64,7 @@
The DB user requires privilege "REPLICATION CLIENT". If you require SSL
replication, this may be a security risk.
3.4 util2/replication_monitor/purge_master_logs.php
3.4 local/prodsys/purge_master_logs.php
This script purges old binary logs that are no more required by any slave.
@ -111,8 +111,12 @@
5.2 Scripts using slave servers
getNew.class.php -> 404.php, index.php
logpics.inc.php -> index.php, myhome.php, newlogpics.php, viewcache.php
map2.php
newcaches.php
newcachesrest.php
newlogs.php
search.php
search1.php
tops.php

View File

@ -1,41 +0,0 @@
<html>
<body>
<h1>Repository usage</h1>
<h2>SVN update</h2>
<p>
When doing an SVN update watch for changes in the following files:
<ul>
<li>code/config/*</li>
<li>code/htdocs/config2/settings-dist.inc.php</li>
<li>code/htdocs/doc/sql/*</li>
<li>code/htdocs/lib/settings-dist.inc.php</li>
<li>code/htdocs/documentation/*</li>
</ul>
In most cases you have to review the changes and update your configuration
or database. The update is done manually.
<ul>
<li>Changes in the setting files may have to be modified in the local config file.</li>
<li>
Changes in SQL table definitions have to be installed in the database via
phpmyadmin. If there is a new table SQL file, you can create the new column
or modify the existing column.<br />
<br />
If data.sql changes, you have to execute it with mysql binary
<pre>cat data.sql | mysql -uroot -p &lt;database&gt;</pre>
If maintain.php changes, you have to execute it with you webbrowser.<br />
<br />
</li>
<li>
Changes in the documentation should be reviewed, of course.
</li>
</ul>
</p>
<h2>SVN commit</h2>
<p>
Commit your changes to the dev branch when you have finished the developlment.<br />
When these changes have been tested, they will be merged into the trunk.
</p>
</body>
</html>

9
htdocs/api/ping.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$opt['rootpath'] = '../';
require($opt['rootpath'] . 'lib2/web.inc.php');
header('Content-type: text/html; charset=utf-8');
echo sql_value("SELECT NOW()","");
?>

View File

@ -101,7 +101,7 @@ function getWaypoints($cacheid)
}
//here we read all used information from the form if submitted, otherwise from DB
$cache_name = isset($_POST['name']) ? $_POST['name'] : $cache_record['name']; // Ocprop
$cache_name = trim(isset($_POST['name']) ? $_POST['name'] : $cache_record['name']); // Ocprop
$cache_type = isset($_POST['type']) ? $_POST['type'] : $cache_record['type'];
if (!isset($_POST['size']))
{
@ -220,10 +220,9 @@ function getWaypoints($cacheid)
// name
$name_not_ok = false;
if(isset($_POST['name']))
if($cache_name == "")
{
if($_POST['name'] == "")
$name_not_ok = true;
$name_not_ok = true;
}
if (isset($_POST['latNS']))

View File

@ -119,7 +119,7 @@
tpl_set_var('lat_min', htmlspecialchars($lat_min, ENT_COMPAT, 'UTF-8'));
//name
$name = isset($_POST['name']) ? $_POST['name'] : ''; // Ocprop
$name = isset($_POST['name']) ? trim($_POST['name']) : ''; // Ocprop
tpl_set_var('name', htmlspecialchars($name, ENT_COMPAT, 'UTF-8'));
//shortdesc

View File

@ -1197,9 +1197,7 @@
}
else // by name
{
// Some names start with spaces ...
// caches.name is not indexed, so ltrimming won't cost performance.
$sql .= 'LTRIM(`caches`.`name`) ASC';
$sql .= '`caches`.`name` ASC';
}
// range of output

View File

@ -1,4 +0,0 @@
AuthUserFile /path/to/passwdfile/.htpasswd
AuthName "OC-Admin"
AuthType Basic
require valid-user

View File

@ -1,20 +0,0 @@
<html>
<head>
<title>Caches archivieren</title>
</head>
<frameset cols="173,*">
<frame name="list" scrolling="yes" noresize target="Inhalt" src="list.php">
<frameset rows="60,*">
<frame name="settings" target="Hauptframe" src="top.php">
<frame name="viewcache" src="about:blank">
</frameset>
<noframes>
<body>
<p>Diese Seite verwendet Frames. Frames werden von Ihrem Browser aber nicht
unterst<73>tzt.</p>
</body>
</noframes>
</frameset>
</html>

View File

@ -1,41 +0,0 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
$rootpath = '../../';
header('Content-type: text/html; charset=utf-8');
require_once($rootpath . 'lib/common.inc.php');
$sUser = isset($_REQUEST['user']) ? $_REQUEST['user'] : '';
?>
<html>
<head>
<script type="text/javascript">
<!--
function select(wp)
{
parent.frames['settings'].location.href = '<?php echo $absolute_server_URI; ?>util/archive/top.php?wp=' + wp;
}
//-->
</script>
</head>
<body>
<form>
<input type="text" name="user" size="10" value="<?php echo htmlspecialchars($sUser); ?>" />
<input type="submit" value="OK" />
</form>
<?php
$rsCaches = sql("SELECT DISTINCT `caches`.`wp_oc` FROM `caches` INNER JOIN `cache_logs` ON `caches`.`cache_id`=`cache_logs`.`cache_id` INNER JOIN `user` ON `cache_logs`.`user_id`=`user`.`user_id` WHERE `caches`.`status` IN (1,2) AND `cache_logs`.`type`=3 AND `user`.`username`='&1' ORDER BY `cache_logs`.`date` DESC, `caches`.`cache_id`", $sUser);
while ($rCache = sql_fetch_assoc($rsCaches))
{
echo '<a href="javascript:select(\'' . $rCache['wp_oc'] . '\')">' . $rCache['wp_oc'] . '<br />';
}
mysql_free_result($rsCaches);
?>
</body>
</html>

View File

@ -1,33 +0,0 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
$rootpath = '../../';
header('Content-type: text/html; charset=utf-8');
require_once($rootpath . 'lib/common.inc.php');
$wp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
if (isset($_REQUEST['post']))
{
sql("UPDATE `caches` SET `status`=3 WHERE `wp_oc`='&1'", $wp);
}
?>
<html>
<head>
<script type="text/javascript">
<!--
function load(wp)
{
parent.frames['viewcache'].location.href = '<?php echo $absolute_server_URI; ?>viewcache.php?popup=y&wp=' + wp;
}
//-->
</script>
</head>
<body onload="load('<?php echo $wp; ?>')">
<a href="top.php?post=1&wp=<?php echo $wp; ?>">Archivieren</a>
</body>
</html>

View File

@ -1,59 +0,0 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
$rootpath = '../../';
require($rootpath . 'lib/clicompatbase.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
// zeichen die nicht am beginn eines Caches sein dürfen
$evils[] = " ";
$evils[] = "\n";
$evils[] = "\r";
$rs = sql("SELECT `cache_id`, `name` FROM `caches` WHERE `name`<'\"' ORDER BY `name` ASC");
while ($r = sql_fetch_array($rs))
{
$name = $r['name'];
$bFound = true;
while ($bFound == true)
{
$bFound = false;
for ($j = 0; $j < count($evils); $j++)
{
if (mb_substr($name, 0, 1) == $evils[$j])
{
$name = mb_substr($name, 1);
$bFound = true;
}
}
}
if ($name != '')
{
if ($name != $r['name'])
{
echo "Changed name to: " . $name . "\n";
sql("UPDATE `caches` SET `name`='&1' WHERE `cache_id`=&2", $name, $r['cache_id']);
}
}
else
echo 'new name would be empty, not changing' . "\n";
}
sql_free_result($rs);
?>

View File

@ -1,4 +0,0 @@
AuthUserFile /path/to/passwdfile/.htpasswd
AuthName "OC-Admin"
AuthType Basic
require valid-user

View File

@ -1,182 +0,0 @@
<?php
/***************************************************************************
./util/deletecache/cache.php
-------------------
begin : November 17 2005
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Unicode Reminder メモ
Script zum vollständigen entfernen von Caches.
Schutz über htpasswd!
***************************************************************************/
$rootpath = '../../';
header('Content-type: text/html; charset=utf-8');
require($rootpath . 'lib/common.inc.php');
require($rootpath . 'lib/eventhandler.inc.php');
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if ($action == 'delete')
{
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0;
$commit = isset($_REQUEST['commit']) ? $_REQUEST['commit'] : 0;
if ($commit != 1) die('Kein Commit!');
$rs = sql("SELECT COUNT(*) `c` FROM `caches` WHERE `cache_id`='&1'", $cacheid);
$r = sql_fetch_assoc($rs);
if ($r['c'] == 0) die('Cache nicht vorhanden');
mysql_free_result($rs);
// Bilder
$rs = sql("SELECT * FROM `pictures` WHERE `object_id`='&1' AND `object_type`=2", $cacheid);
while ($r = sql_fetch_assoc($rs))
{
$logbackup['pictures'][] = $r;
// Bild löschen und in removed_objects
sql("DELETE FROM `pictures` WHERE `id`='&1' LIMIT 1", $r['id']);
}
// Logeinträge
$rs = sql("SELECT * FROM `cache_logs` WHERE `cache_id`='&1'", $cacheid);
while ($r = sql_fetch_assoc($rs))
{
// Bilder - Logeinträge
$rsLogPics = sql("SELECT * FROM `pictures` WHERE `object_id`='&1' AND object_type=1", $r['id']);
while ($rLogPics = sql_fetch_assoc($rsLogPics))
{
$r['pictures'][] = $rLogPics;
// Bild löschen und in removed_objects
sql("DELETE FROM `pictures` WHERE `id`='&1' LIMIT 1", $rLogPics['id']);
}
$logbackup['logs'][] = $r;
sql("DELETE FROM `cache_logs` WHERE `id`='&1' LIMIT 1", $r['id']);
}
// Aufruf-Records
$rs = sql("SELECT * FROM `cache_visits` WHERE `cache_id`='&1'", $cacheid);
while ($r = sql_fetch_assoc($rs))
{
$logbackup['visits'][] = $r;
}
sql("DELETE FROM `cache_visits` WHERE `cache_id`='&1'", $cacheid);
// Beschreibungen
$rs = sql("SELECT * FROM `cache_desc` WHERE `cache_id`='&1'", $cacheid);
while ($r = sql_fetch_assoc($rs))
{
$logbackup['desc'][] = $r;
sql("DELETE FROM `cache_desc` WHERE `id`='&1' LIMIT 1", $r['id']);
}
// Cache
$rs = sql("SELECT * FROM `caches` WHERE `cache_id`='&1' LIMIT 1", $cacheid);
while ($r = sql_fetch_assoc($rs))
{
$logbackup['caches'][] = $r;
sql("DELETE FROM `caches` WHERE `cache_id`='&1' LIMIT 1", $r['cache_id']);
// send event to delete statpic
event_change_statpic($r['user_id']);
}
echo 'Cache gelöscht';
// logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
logentry('approving', 4, 0, $cacheid, 0, 'Totaly removed Cache ' . $cacheid, $logbackup);
exit;
}
else if ($action == 'showcache')
{
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0;
$rs = sql("SELECT `caches`.`cache_id` `cacheid`, `caches`.`name` `name`, `cache_status`.`de` `status`, `caches`.`longitude` `longitude`, `caches`.`latitude` `latitude` FROM `caches`, `cache_status` WHERE `caches`.`status`=`cache_status`.`id` AND `caches`.`cache_id`='&1' LIMIT 1", $cacheid);
if (mysql_num_rows($rs) != 0)
{
$r = sql_fetch_assoc($rs);
mysql_free_result($rs);
?>
<html>
<body>
<form action="cache.php" method="get">
</form>
<table>
<?php
echo '<tr><td>Name:</td><td><a href="../../viewcache.php?cacheid=' . urlencode($r['cacheid']) . '">' . htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8') . '</a></td></tr>';
echo '<tr><td>Status:</td><td>' . htmlspecialchars($r['status'], ENT_COMPAT, 'UTF-8') . '</td></tr>';
$rsDescs = sql("SELECT COUNT(*) `count` FROM `cache_desc` WHERE `cache_id`='&1'", $r['cacheid']);
$rDescs = sql_fetch_array($rsDescs);
mysql_free_result($rsDescs);
echo '<tr><td>Beschreibungen:</td><td>' . htmlspecialchars($rDescs['count'], ENT_COMPAT, 'UTF-8') . '</td></tr>';
$rsVisits = sql("SELECT COUNT(*) `count` FROM `cache_visits` WHERE `cache_id`='&1'", $r['cacheid']);
$rVisits = sql_fetch_array($rsVisits);
mysql_free_result($rsVisits);
echo '<tr><td>Aufruf-Records:</td><td>' . htmlspecialchars($rVisits['count'], ENT_COMPAT, 'UTF-8') . '</td></tr>';
$rsLogs = sql("SELECT COUNT(*) `count` FROM `cache_logs` WHERE `cache_id`='&1'", $r['cacheid']);
$rLogs = sql_fetch_array($rsLogs);
mysql_free_result($rsLogs);
echo '<tr><td>Logeinträge:</td><td>' . htmlspecialchars($rLogs['count'], ENT_COMPAT, 'UTF-8') . '</td></tr>';
$rsPictures = sql("SELECT COUNT(*) `count` FROM `pictures` WHERE `object_id`='&1' AND object_type=2", $r['cacheid']);
$rPictures = sql_fetch_array($rsPictures);
mysql_free_result($rsPictures);
echo '<tr><td>Bilder:</td><td>' . htmlspecialchars($rPictures['count'], ENT_COMPAT, 'UTF-8') . '</td></tr>';
echo '<tr>
<td>&nbsp;</td>
<td>
<form action="cache.php" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="cacheid" value="' . $r['cacheid'] . '" />
<input type="checkbox" id="commit" name="commit" value="1" /><label for="commit">wirklich?</label><br />
<input type="submit" value="Löschen" />
</form>
</td>
</tr>';
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
// nach alternativem cache suchen
$rsSecond = sql("SELECT `caches`.`cache_id` `cacheid`, `caches`.`name` `name`, `cache_status`.`de` `status` FROM `caches`, `cache_status` WHERE `caches`.`status`=`cache_status`.`id` AND `caches`.`longitude`='&1' AND `caches`.`latitude`='&2' AND `caches`.`cache_id` != '&3'", $r['longitude'], $r['latitude'], $r['cacheid']);
while ($rSecond = sql_fetch_assoc($rsSecond))
{
echo '<tr><td>Doppellisting:</td><td><a href="../../viewcache.php?cacheid=' . urlencode($rSecond['cacheid']) . '">' . htmlspecialchars($rSecond['name'], ENT_COMPAT, 'UTF-8') . '</a></td><tr>';
echo '<tr><td>Status:</td><td>' . $rSecond['status'] . '</td><tr>';
}
mysql_free_result($rsSecond);
?>
</table>
</body>
</html>
<?php
exit;
}
}
?>
<html>
<body>
<form action="cache.php" method="get">
<input type="hidden" name="action" value="showcache" />
Cacheid <input type="text" name="cacheid" size="8" />
<input type="submit" value="Auswählen" />
</form>
</body>
</html>

View File

@ -1,137 +0,0 @@
<?php
/***************************************************************************
./util/deletecache/cache.php
-------------------
begin : June 28 2006
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Unicode Reminder メモ
Script zum vollständigen entfernen von Benutzern.
Schutz über htpasswd!
***************************************************************************/
$rootpath = '../../';
header('Content-type: text/html; charset=utf-8');
require($rootpath . 'lib/common.inc.php');
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if ($action == 'delete')
{
$username = isset($_REQUEST['username']) ? $_REQUEST['username'] : 0;
$commit = isset($_REQUEST['commit']) ? $_REQUEST['commit'] : 0;
if ($commit != 1) die('Kein Commit!');
$rsUser = sql("SELECT `user_id` FROM `user` WHERE `username`='&1'", $username);
if (mysql_num_rows($rsUser) != 1) die(mysql_num_rows($rsUser) . ' Benutzer gefunden');
$rUser = sql_fetch_array($rsUser);
$userid = $rUser['user_id'];
sql_free_result($rsUser);
if (sqlValue("SELECT COUNT(*) FROM `caches` WHERE `user_id`='" . sql_escape($userid) . "'", 0) > 0)
die('Es sind noch Caches vorhanden! <a href="../../search.php?searchto=searchbyowner&showresult=1&expert=0&output=HTML&sort=bydistance&f_userowner=0&f_userfound=0&f_inactive=0&f_ignored=0&owner=' . urlencode($username) . '">Suchen</a>');
// pictures
$rs = sql("SELECT `pictures`.`id`, `pictures`.`url` FROM `pictures` INNER JOIN `cache_logs` ON `pictures`.`object_type`=1 AND `pictures`.`object_id`=`cache_logs`.`id` WHERE `cache_logs`.`user_id`='&1'", $userid);
while ($r = sql_fetch_assoc($rs))
{
$filename = $r['url'];
while (mb_strpos($filename, '/') !== false)
$filename = mb_substr($filename, mb_strpos($filename, '/') + 1);
if (is_file($picdir . '/' . $filename))
{
unlink($picdir . '/' . $filename);
echo $filename . "<br>";
}
sql("DELETE FROM `pictures` WHERE `id`='&1'", $r['id']);
}
// statpic
if (is_file($rootpath . 'images/statpics/statpic' . $userid . '.jpg'))
unlink($rootpath . 'images/statpics/statpic' . $userid . '.jpg');
// queries
sql("DELETE FROM `queries` WHERE `user_id`=&1", $userid);
// watches_notified
sql("DELETE FROM `watches_notified` WHERE `user_id`=&1", $userid);
// cache_logs
$rs = sql("SELECT `id`, `cache_id`, `type` FROM `cache_logs` WHERE `user_id`=&1", $userid);
while ($r = sql_fetch_assoc($rs))
{
sql("DELETE FROM `cache_logs` WHERE `id`=&1", $r['id']);
}
// user
sql("DELETE FROM `user` WHERE `user_id`=&1", $userid);
echo 'Benutzer gelöscht';
exit;
}
else if ($action == 'showuser')
{
$username = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';
$rs = sql("SELECT `user`.`user_id`, `user`.`username`, `user`.`email`, `user`.`activation_code`, `user`.`is_active_flag`, `stat_user`.`hidden`, `stat_user`.`found`, `stat_user`.`note`, `stat_user`.`notfound` FROM `user` LEFT JOIN `stat_user` ON `user`.`user_id`=`stat_user`.`user_id` WHERE (`user`.`username`='&1' OR `user`.`email`='&1') LIMIT 1", $username);
if (mysql_num_rows($rs) != 0)
{
$r = sql_fetch_assoc($rs);
sql_free_result($rs);
?>
<html>
<body>
<form action="cache.php" method="get">
</form>
<table>
<?php
echo '<tr><td>Name:</td><td><a href="../../viewprofile.php?userid=' . urlencode($r['user_id']) . '">' . htmlspecialchars($r['username'], ENT_COMPAT, 'UTF-8') . '</a></td></tr>';
echo '<tr><td>EMail:</td><td>' . $r['email'] . '</td></tr>';
echo '<tr><td>Aktivierungscode:</td><td>' . $r['activation_code'] . '</td></tr>';
echo '<tr><td>Letzter Login:</td><td>' . sqlValue("SELECT MAX(`last_login`) FROM `sys_sessions` WHERE `user_id`='" . sql_escape($r['user_id']) . "'", '0') . '</td></tr>';
echo '<tr><td>Aktiv:</td><td>' . $r['is_active_flag'] . '</td></tr>';
echo '<tr><td>Versteckt:</td><td>' . ($r['hidden']+0) . '</td></tr>';
echo '<tr><td>Logeinträge:</td><td>' . ($r['found'] + $r['note'] + $r['notfound']) . '</td></tr>';
echo '<tr>
<td>&nbsp;</td>
<td>
<form action="user.php" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="username" value="' . $r['username'] . '" />
<input type="checkbox" id="commit" name="commit" value="1" /><label for="commit">wirklich?</label><br />
<input type="submit" value="Löschen" />
</form>
</td>
</tr>';
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
?>
</table>
</body>
</html>
<?php
exit;
}
}
?>
<html>
<body>
<form action="user.php" method="get">
<input type="hidden" name="action" value="showuser" />
Benutzername <input type="text" name="username" size="20" />
<input type="submit" value="Auswählen" />
</form>
</body>
</html>

View File

@ -1,4 +0,0 @@
<FilesMatch "*">
Order Deny,Allow
Deny from All
</FilesMatch>

Binary file not shown.

View File

@ -0,0 +1,3 @@
This DUPLICATE of util2/google-earth has to be retained,
because it can be referenced from anywhere else and local
copyies of opencaching.kml may exist.

View File

@ -1,333 +1,5 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
Unicode Reminder メモ
***************************************************************************/
// BBOX=2.38443,45.9322,20.7053,55.0289
require '../../util2/google-earth/caches.php';
$opt['rootpath'] = '../../';
header('Content-type: text/html; charset=utf-8');
require($opt['rootpath'] . 'lib2/web.inc.php');
$bbox = isset($_REQUEST['BBOX']) ? $_REQUEST['BBOX'] : '0,0,0,0';
$abox = mb_split(',', $bbox);
if (count($abox) != 4) exit;
if (!is_numeric($abox[0])) exit;
if (!is_numeric($abox[1])) exit;
if (!is_numeric($abox[2])) exit;
if (!is_numeric($abox[3])) exit;
$lat_from = $abox[1];
$lon_from = $abox[0];
$lat_to = $abox[3];
$lon_to = $abox[2];
/*
kml processing
*/
$kmlLine =
'
<Placemark>
<description><![CDATA[<a href="{urlbase}viewcache.php?cacheid={cacheid}">Beschreibung ansehen</a><br>Von {username}<br>&nbsp;<br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>Art: {type}<br>Gr&ouml;&szlig;e: {size}</td></tr><tr><td colspan="2">Schwierigkeit: {difficulty} von 5.0<br>Gel&auml;nde: {terrain} von 5.0</td></tr></table>]]></description>
<name>{name}</name>
<LookAt>
<longitude>{lon}</longitude>
<latitude>{lat}</latitude>
<range>5000</range>
<tilt>0</tilt>
<heading>3</heading>
</LookAt>
<styleUrl>#{icon}</styleUrl>
<Point>
<coordinates>{lon},{lat},0</coordinates>
</Point>
</Placemark>
';
$kmlHead =
'<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<Style id="tradi">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/tradi.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="multi">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/multi.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="myst">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/myst.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="math">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/math.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="drivein">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/drivein.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="virtual">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/virtual.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="webcam">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/webcam.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="event">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/event.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="moving">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/moving.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="unknown">
<IconStyle>
<Icon>
<href>{urlbase}resource2/misc/google-earth/unknown.png</href>
</Icon>
</IconStyle>
</Style>
<Folder>
<name>Geocaches (Opencaching)</name>
<open>0</open>
';
$kmlFoot = '
</Folder>
</Document>
</kml>';
$kmlTimeFormat = 'Y-m-d\TH:i:s\Z';
// header("Content-type: application/vnd.google-earth.kml");
// header("Content-Disposition: attachment; filename=ge.kml");
echo mb_ereg_replace('{urlbase}', xmlentities($opt['page']['absolute_url']), $kmlHead);
if ((abs($lon_from - $lon_to) > 2) || (abs($lat_from - $lat_to) > 2))
{
echoZoomIn($lon_from, $lon_to, $lat_from, $lat_to);
}
else
{
$rs = sql("SELECT `caches`.`cache_id` AS `cacheid`, `caches`.`longitude` AS `longitude`, `caches`.`latitude` AS `latitude`, `caches`.`type` AS `type`, `caches`.`date_hidden` AS `date_hidden`, `caches`.`name` AS `name`, `cache_type`.`de` AS `typedesc`, `cache_size`.`de` AS `sizedesc`, `caches`.`terrain` AS `terrain`, `caches`.`difficulty` AS `difficulty`, `user`.`username` AS `username`
FROM `caches`
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
WHERE `caches`.`status`=1 AND
`caches`.`longitude`>='&1' AND
`caches`.`longitude`<='&2' AND
`caches`.`latitude`>='&3' AND
`caches`.`latitude`<='&4'",
$lon_from, $lon_to, $lat_from, $lat_to);
$nCount = 0;
while ($r = sql_fetch_array($rs))
{
$nCount = $nCount + 1;
$thisline = $kmlLine;
// icon suchen
switch ($r['type'])
{
case 2:
$icon = 'tradi';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/traditional.gif" alt="Normaler Cache" title="Normaler Cache" />';
break;
case 3:
$icon = 'multi';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/multi.gif" alt="Multicache" title="Multicache" />';
break;
case 4:
$icon = 'virtual';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/virtual.gif" alt="virtueller Cache" title="virtueller Cache" />';
break;
case 5:
$icon = 'webcam';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/webcam.gif" alt="Webcam Cache" title="Webcam Cache" />';
break;
case 6:
$icon = 'event';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/event.gif" alt="Event Cache" title="Event Cache" />';
break;
case 7:
$icon = 'myst';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/mystery.gif" alt="Event Cache" title="Event Cache" />';
break;
case 8:
$icon = 'math';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/mathe.gif" alt="Event Cache" title="Event Cache" />';
break;
case 9:
$icon = 'moving';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/moving.gif" alt="Event Cache" title="Event Cache" />';
break;
case 10:
$icon = 'drivein';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/drivein.gif" alt="Event Cache" title="Event Cache" />';
break;
default:
$icon = 'unknown';
$typeimgurl = '<img src="{urlbase}lang/de/ocstyle/images/cache/unknown.gif" alt="unbekannter Cachetyp" title="unbekannter Cachetyp" />';
break;
}
$thisline = mb_ereg_replace('{icon}', $icon, $thisline);
$thisline = mb_ereg_replace('{typeimgurl}', $typeimgurl, $thisline);
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', $lon, $thisline);
$time = date($kmlTimeFormat, strtotime($r['date_hidden']));
$thisline = mb_ereg_replace('{time}', $time, $thisline);
$thisline = mb_ereg_replace('{name}', xmlentities($r['name']), $thisline);
if (($r['status'] == 2) || ($r['status'] == 3))
{
if ($r['status'] == 2)
$thisline = mb_ereg_replace('{archivedflag}', 'Momentan nicht verf&uuml;gbar', $thisline);
else
$thisline = mb_ereg_replace('{archivedflag}', 'Archiviert!, ', $thisline);
}
else
$thisline = mb_ereg_replace('{archivedflag}', '', $thisline);
$thisline = mb_ereg_replace('{type}', xmlentities($r['typedesc']), $thisline);
$thisline = mb_ereg_replace('{size}', xmlentities($r['sizedesc']), $thisline);
$difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
$thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline);
$terrain = sprintf('%01.1f', $r['terrain'] / 2);
$thisline = mb_ereg_replace('{terrain}', $terrain, $thisline);
$time = date($kmlTimeFormat, strtotime($r['date_hidden']));
$thisline = mb_ereg_replace('{time}', $time, $thisline);
$thisline = mb_ereg_replace('{username}', xmlentities($r['username']), $thisline);
$thisline = mb_ereg_replace('{cacheid}', xmlentities($r['cacheid']), $thisline);
$thisline = mb_ereg_replace('{urlbase}', xmlentities($opt['page']['absolute_url']), $thisline);
echo $thisline;
}
sql_free_result($rs);
}
echo $kmlFoot;
exit;
function echoZoomIn($lon_from, $lon_to, $lat_from, $lat_to)
{
$nColumnsCount = 60;
$sZoomIn =
'
####### ####### ####### # #
# # # # # ## ##
# # # # # # # # #
# # # # # # # #
# # # # # # #
# # # # # # #
####### ####### ####### # #
### # #
# ## #
# # # #
# # # #
# # # #
# # ##
### # #
';
// prepare lines
$sZoomIn = str_replace("\r", "", $sZoomIn);
$sLines = split("\n", $sZoomIn);
for ($i = 0; $i < count($sLines); $i++)
$sLines[$i] = str_pad($sLines[$i], ($nColumnsCount-1), ' ');
$nDegreePerLine = ($lat_to - $lat_from) / count($sLines);
$nDegreePerColumn = ($lon_to - $lon_from) / $nColumnsCount;
for ($nLine = 0; $nLine < count($sLines); $nLine++)
{
for ($nColumn = 0; $nColumn < $nColumnsCount; $nColumn++)
{
if (substr($sLines[$nLine], $nColumn, 1) == '#')
{
$nLat = $lat_to - $nDegreePerLine * $nLine;
$nLon = $lon_from + $nDegreePerColumn * $nColumn;
echo '
<Placemark>
<description><![CDATA[You have to zoom in to see the Geocaches]]></description>
<name></name>
<LookAt>
<longitude>' . $nLon . '</longitude>
<latitude>' . $nLat . '</latitude>
<range>5000</range>
<tilt>0</tilt>
<heading>3</heading>
</LookAt>
<Point>
<coordinates>' . $nLon . ',' . $nLat . ',0</coordinates>
</Point>
</Placemark>
';
}
}
}
}
?>
?>

View File

@ -11,7 +11,7 @@
<NetworkLink>
<name>Opencaching</name>
<Url>
<href>http://www.opencaching.de/util/google-earth/caches.php</href>
<href>http://www.opencaching.de/util2/google-earth/caches.php</href>
<viewRefreshTime>1</viewRefreshTime>
<viewRefreshMode>onStop</viewRefreshMode>
</Url>

View File

@ -1,4 +0,0 @@
<FilesMatch "*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

@ -1,32 +0,0 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
* For license information see doc/license.txt
*
Unicode Reminder メモ
***************************************************************************/
$rootpath = '../../';
require_once($rootpath . 'lib/settings.inc.php');
require_once($rootpath . 'lib/clicompatbase.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
$i = 0;
$rs = sql('SELECT `cache_id` FROM `caches`');
while ($r = sql_fetch_array($rs))
{
setCacheDefaultDescLang($r['cache_id']);
$i++;
if (($i % 25) == 0) echo $i . ' Caches bearbeitet' . "\n";
}
mysql_free_result($rs);
?>

View File

@ -1,11 +0,0 @@
<?php
$rootpath = '../';
header('Content-type: text/html; charset=utf-8');
require('../lib/common.inc.php');
$rs = mysql_query('SELECT NOW()', $dblink);
$r = mysql_fetch_array($rs);
echo $r[0];
?>

View File

@ -1,14 +0,0 @@
<?php
$rootpath = '../../';
header('Content-type: text/html; charset=utf-8');
require('../../lib/common.inc.php');
$n = 1;
$rs = sql('SELECT `user`.`username`, `stat_user`.`found` FROM `stat_user` INNER JOIN `user` on `stat_user`.`user_id`=`user`.`user_id` ORDER BY `stat_user`.`found` DESC LIMIT 100');
while ($r = sql_fetch_assoc($rs))
{
echo $n . ' ' . $r['username'] . ': ' . $r['found'] . "\n";
$n++;
}
mysql_free_result($rs);
?>

View File

@ -0,0 +1,28 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
*
* OC versions < 3.0.9 allowed entering spaces befor and after cache names.
* This tool reparis these names. It should no longer be neeeded from
* version 9 on, as newcache.php and editcache.php now trim the names.
***************************************************************************/
$opt['rootpath'] = '../../';
require($opt['rootpath'] . 'lib2/cli.inc.php');
$rs = sql("SELECT `cache_id`, `name` FROM `caches` WHERE `name`<'\"' ORDER BY `name` ASC");
while ($r = sql_fetch_array($rs))
{
$name = trim($r['name']);
if ($name != $r['name'] && $name != "")
{
echo "ID " . $r['cache_id'] . ": trimmed cache name to '" . $name . "'\n";
sql("UPDATE `caches` SET `name`='&1' WHERE `cache_id`=&2", $name, $r['cache_id']);
}
}
sql_free_result($rs);
?>

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Allow,Deny
Allow from All
</FilesMatch>

View File

@ -1,2 +0,0 @@
This directory contains files which will reside outside the code directory tree
on a production system.

2
local/prodsys/README Normal file
View File

@ -0,0 +1,2 @@
This directory contains files which usually will reside outside
the code directory tree on a production system.

View File

@ -0,0 +1,769 @@
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>opencaching/code/htdocs/util2/replication_monitor/replication_monitor.sh at master · OpencachingTeam/opencaching</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png" />
<link rel="logo" type="image/svg" href="https://github-media-downloads.s3.amazonaws.com/github-logo.svg" />
<meta property="og:image" content="https://github.global.ssl.fastly.net/images/modules/logos_page/Octocat.png">
<meta name="hostname" content="fe2.rs.github.com">
<link rel="assets" href="https://github.global.ssl.fastly.net/">
<link rel="xhr-socket" href="/_sockets" />
<meta name="msapplication-TileImage" content="/windows-tile.png" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="selected-link" value="repo_source" data-pjax-transient />
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="1614754" name="octolytics-actor-id" /><meta content="following5" name="octolytics-actor-login" /><meta content="0b4acbd8b6317894272d1314424a8efac82d14846f4d4ee3c94acb517aa67425" name="octolytics-actor-hash" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta content="authenticity_token" name="csrf-param" />
<meta content="F+5hJFVmaB3SwkSQOneahOL6SIlkge2FflyW+5qaCdI=" name="csrf-token" />
<link href="https://github.global.ssl.fastly.net/assets/github-75fcd9a168acc3491e0da5267b38eaac11244b8f.css" media="all" rel="stylesheet" type="text/css" />
<link href="https://github.global.ssl.fastly.net/assets/github2-cb6181999056f35a857fc48b05b6f4ed11bb140c.css" media="all" rel="stylesheet" type="text/css" />
<script src="https://github.global.ssl.fastly.net/assets/frameworks-e8054ad804a1cf9e9849130fee5a4a5487b663ed.js" type="text/javascript"></script>
<script src="https://github.global.ssl.fastly.net/assets/github-d7ead42bca9fc0409f5a3ce41a7bac05e9347ab2.js" type="text/javascript"></script>
<meta http-equiv="x-pjax-version" content="187a4452e0ea22b079d562cf557c8f0f">
<link data-pjax-transient rel='permalink' href='/OpencachingTeam/opencaching/blob/57423c74ca8b23317f553e7e63ac840794518f4b/code/htdocs/util2/replication_monitor/replication_monitor.sh'>
<meta property="og:title" content="opencaching"/>
<meta property="og:type" content="githubog:gitrepository"/>
<meta property="og:url" content="https://github.com/OpencachingTeam/opencaching"/>
<meta property="og:image" content="https://github.global.ssl.fastly.net/images/gravatars/gravatar-user-420.png"/>
<meta property="og:site_name" content="GitHub"/>
<meta property="og:description" content="The source code for the opencaching nodes"/>
<meta name="description" content="The source code for the opencaching nodes" />
<meta content="761569" name="octolytics-dimension-user_id" /><meta content="OpencachingTeam" name="octolytics-dimension-user_login" /><meta content="1687072" name="octolytics-dimension-repository_id" /><meta content="OpencachingTeam/opencaching" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="true" name="octolytics-dimension-repository_is_fork" /><meta content="1226132" name="octolytics-dimension-repository_parent_id" /><meta content="totsubo/se2de-merge" name="octolytics-dimension-repository_parent_nwo" /><meta content="1226132" name="octolytics-dimension-repository_network_root_id" /><meta content="totsubo/se2de-merge" name="octolytics-dimension-repository_network_root_nwo" />
<link href="https://github.com/OpencachingTeam/opencaching/commits/master.atom" rel="alternate" title="Recent Commits to opencaching:master" type="application/atom+xml" />
</head>
<body class="logged_in page-blob windows vis-public fork env-production ">
<div class="wrapper">
<div class="header header-logged-in true">
<div class="container clearfix">
<a class="header-logo-invertocat" href="https://github.com/">
<span class="mega-octicon octicon-mark-github"></span>
</a>
<div class="divider-vertical"></div>
<a href="/notifications" class="notification-indicator tooltipped downwards" title="You have unread notifications">
<span class="mail-status unread"></span>
</a>
<div class="divider-vertical"></div>
<div class="command-bar js-command-bar in-repository">
<form accept-charset="UTF-8" action="/search" class="command-bar-form" id="top_search_form" method="get">
<input type="text" data-hotkey=" s" name="q" id="js-command-bar-field" placeholder="Search or type a command" tabindex="1" autocapitalize="off"
data-username="following5"
data-repo="OpencachingTeam/opencaching"
data-branch="master"
data-sha="a539cb77636e0c1d1e1db75c226d3c7826a4468c"
>
<input type="hidden" name="nwo" value="OpencachingTeam/opencaching" />
<div class="select-menu js-menu-container js-select-menu search-context-select-menu">
<span class="minibutton select-menu-button js-menu-target">
<span class="js-select-button">This repository</span>
</span>
<div class="select-menu-modal-holder js-menu-content js-navigation-container">
<div class="select-menu-modal">
<div class="select-menu-item js-navigation-item js-this-repository-navigation-item selected">
<span class="select-menu-item-icon octicon octicon-check"></span>
<input type="radio" class="js-search-this-repository" name="search_target" value="repository" checked="checked" />
<div class="select-menu-item-text js-select-button-text">This repository</div>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item js-all-repositories-navigation-item">
<span class="select-menu-item-icon octicon octicon-check"></span>
<input type="radio" name="search_target" value="global" />
<div class="select-menu-item-text js-select-button-text">All repositories</div>
</div> <!-- /.select-menu-item -->
</div>
</div>
</div>
<span class="octicon help tooltipped downwards" title="Show command bar help">
<span class="octicon octicon-question"></span>
</span>
<input type="hidden" name="ref" value="cmdform">
</form>
<ul class="top-nav">
<li class="explore"><a href="/explore">Explore</a></li>
<li><a href="https://gist.github.com">Gist</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="https://help.github.com">Help</a></li>
</ul>
</div>
<ul id="user-links">
<li>
<a href="/following5" class="name">
<img height="20" src="https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="20" /> following5
</a>
</li>
<li>
<a href="/new" id="new_repo" class="tooltipped downwards" title="Create a new repo" aria-label="Create a new repo">
<span class="octicon octicon-repo-create"></span>
</a>
</li>
<li>
<a href="/settings/profile" id="account_settings"
class="tooltipped downwards"
aria-label="Account settings "
title="Account settings ">
<span class="octicon octicon-tools"></span>
</a>
</li>
<li>
<a class="tooltipped downwards" href="/logout" data-method="post" id="logout" title="Sign out" aria-label="Sign out">
<span class="octicon octicon-log-out"></span>
</a>
</li>
</ul>
<div class="js-new-dropdown-contents hidden">
<ul class="dropdown-menu">
<li>
<a href="/new"><span class="octicon octicon-repo-create"></span> New repository</a>
</li>
<li>
<a href="/organizations/new"><span class="octicon octicon-organization"></span> New organization</a>
</li>
<li class="section-title">
<span title="OpencachingTeam/opencaching">This repository</span>
</li>
<li>
<a href="/OpencachingTeam/opencaching/issues/new"><span class="octicon octicon-issue-opened"></span> New issue</a>
</li>
</ul>
</div>
</div>
</div>
<div class="site" itemscope itemtype="http://schema.org/WebPage">
<div class="pagehead repohead instapaper_ignore readability-menu">
<div class="container">
<ul class="pagehead-actions">
<li class="subscription">
<form accept-charset="UTF-8" action="/notifications/subscribe" class="js-social-container" data-autosubmit="true" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="F+5hJFVmaB3SwkSQOneahOL6SIlkge2FflyW+5qaCdI=" /></div> <input id="repository_id" name="repository_id" type="hidden" value="1687072" />
<div class="select-menu js-menu-container js-select-menu">
<a class="social-count js-social-count" href="/OpencachingTeam/opencaching/watchers">
3
</a>
<span class="minibutton select-menu-button with-count js-menu-target">
<span class="js-select-button">
<span class="octicon octicon-eye-watch"></span>
Watch
</span>
</span>
<div class="select-menu-modal-holder">
<div class="select-menu-modal subscription-menu-modal js-menu-content">
<div class="select-menu-header">
<span class="select-menu-title">Notification status</span>
<span class="octicon octicon-remove-close js-menu-close"></span>
</div> <!-- /.select-menu-header -->
<div class="select-menu-list js-navigation-container">
<div class="select-menu-item js-navigation-item selected">
<span class="select-menu-item-icon octicon octicon-check"></span>
<div class="select-menu-item-text">
<input checked="checked" id="do_included" name="do" type="radio" value="included" />
<h4>Not watching</h4>
<span class="description">You only receive notifications for discussions in which you participate or are @mentioned.</span>
<span class="js-select-button-text hidden-select-button-text">
<span class="octicon octicon-eye-watch"></span>
Watch
</span>
</div>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon octicon-check"></span>
<div class="select-menu-item-text">
<input id="do_subscribed" name="do" type="radio" value="subscribed" />
<h4>Watching</h4>
<span class="description">You receive notifications for all discussions in this repository.</span>
<span class="js-select-button-text hidden-select-button-text">
<span class="octicon octicon-eye-unwatch"></span>
Unwatch
</span>
</div>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<div class="select-menu-item-text">
<input id="do_ignore" name="do" type="radio" value="ignore" />
<h4>Ignoring</h4>
<span class="description">You do not receive any notifications for discussions in this repository.</span>
<span class="js-select-button-text hidden-select-button-text">
<span class="octicon octicon-mute"></span>
Stop ignoring
</span>
</div>
</div> <!-- /.select-menu-item -->
</div> <!-- /.select-menu-list -->
</div> <!-- /.select-menu-modal -->
</div> <!-- /.select-menu-modal-holder -->
</div> <!-- /.select-menu -->
</form>
</li>
<li>
<div class="js-toggler-container js-social-container starring-container ">
<a href="/OpencachingTeam/opencaching/unstar" class="minibutton with-count js-toggler-target star-button starred upwards" title="Unstar this repo" data-remote="true" data-method="post" rel="nofollow">
<span class="octicon octicon-star-delete"></span><span class="text">Unstar</span>
</a>
<a href="/OpencachingTeam/opencaching/star" class="minibutton with-count js-toggler-target star-button unstarred upwards " title="Star this repo" data-remote="true" data-method="post" rel="nofollow">
<span class="octicon octicon-star"></span><span class="text">Star</span>
</a>
<a class="social-count js-social-count" href="/OpencachingTeam/opencaching/stargazers">8</a>
</div>
</li>
<li>
<a href="/OpencachingTeam/opencaching/fork" class="minibutton with-count js-toggler-target fork-button lighter upwards" title="Fork this repo" rel="facebox nofollow">
<span class="octicon octicon-git-branch-create"></span><span class="text">Fork</span>
</a>
<a href="/OpencachingTeam/opencaching/network" class="social-count">6</a>
</li>
</ul>
<h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public">
<span class="repo-label"><span>public</span></span>
<span class="mega-octicon octicon-repo-forked"></span>
<span class="author">
<a href="/OpencachingTeam" class="url fn" itemprop="url" rel="author"><span itemprop="title">OpencachingTeam</span></a></span
><span class="repohead-name-divider">/</span><strong
><a href="/OpencachingTeam/opencaching" class="js-current-repository js-repo-home-link">opencaching</a></strong>
<span class="page-context-loader">
<img alt="Octocat-spinner-32" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</span>
<span class="fork-flag">
<span class="text">forked from <a href="/totsubo/se2de-merge">totsubo/se2de-merge</a></span>
</span>
</h1>
</div><!-- /.container -->
</div><!-- /.repohead -->
<div class="container">
<div class="repository-with-sidebar repo-container
">
<div class="repository-sidebar">
<div class="repo-nav repo-nav-full js-repository-container-pjax js-octicon-loaders">
<div class="repo-nav-contents">
<ul class="repo-menu">
<li class="tooltipped leftwards" title="Code">
<a href="/OpencachingTeam/opencaching" aria-label="Code" class="js-selected-navigation-item selected" data-gotokey="c" data-pjax="true" data-selected-links="repo_source repo_downloads repo_commits repo_tags repo_branches /OpencachingTeam/opencaching">
<span class="octicon octicon-code"></span> <span class="full-word">Code</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
<li class="tooltipped leftwards" title="Issues">
<a href="/OpencachingTeam/opencaching/issues" aria-label="Issues" class="js-selected-navigation-item js-disable-pjax" data-gotokey="i" data-selected-links="repo_issues /OpencachingTeam/opencaching/issues">
<span class="octicon octicon-issue-opened"></span> <span class="full-word">Issues</span>
<span class='counter'>2</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
<li class="tooltipped leftwards" title="Pull Requests"><a href="/OpencachingTeam/opencaching/pulls" aria-label="Pull Requests" class="js-selected-navigation-item js-disable-pjax" data-gotokey="p" data-selected-links="repo_pulls /OpencachingTeam/opencaching/pulls">
<span class="octicon octicon-git-pull-request"></span> <span class="full-word">Pull Requests</span>
<span class='counter'>0</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
<li class="tooltipped leftwards" title="Wiki">
<a href="/OpencachingTeam/opencaching/wiki" aria-label="Wiki" class="js-selected-navigation-item " data-pjax="true" data-selected-links="repo_wiki /OpencachingTeam/opencaching/wiki">
<span class="octicon octicon-book"></span> <span class="full-word">Wiki</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
</ul>
<div class="repo-menu-separator"></div>
<ul class="repo-menu">
<li class="tooltipped leftwards" title="Pulse">
<a href="/OpencachingTeam/opencaching/pulse" aria-label="Pulse" class="js-selected-navigation-item " data-pjax="true" data-selected-links="pulse /OpencachingTeam/opencaching/pulse">
<span class="octicon octicon-pulse"></span> <span class="full-word">Pulse</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
<li class="tooltipped leftwards" title="Graphs">
<a href="/OpencachingTeam/opencaching/graphs" aria-label="Graphs" class="js-selected-navigation-item " data-pjax="true" data-selected-links="repo_graphs repo_contributors /OpencachingTeam/opencaching/graphs">
<span class="octicon octicon-graph"></span> <span class="full-word">Graphs</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
<li class="tooltipped leftwards" title="Network">
<a href="/OpencachingTeam/opencaching/network" aria-label="Network" class="js-selected-navigation-item js-disable-pjax" data-selected-links="repo_network /OpencachingTeam/opencaching/network">
<span class="octicon octicon-git-branch"></span> <span class="full-word">Network</span>
<img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif" width="16" />
</a> </li>
</ul>
</div>
</div>
<div class="only-with-full-nav">
<div class="clone-url open"
data-protocol-type="http"
data-url="/users/set_protocol?protocol_selector=http&amp;protocol_type=clone">
<h3><strong>HTTPS</strong> clone URL</h3>
<input type="text" class="clone js-url-field"
value="https://github.com/OpencachingTeam/opencaching.git" readonly="readonly">
<span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/OpencachingTeam/opencaching.git" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
</div>
<div class="clone-url "
data-protocol-type="ssh"
data-url="/users/set_protocol?protocol_selector=ssh&amp;protocol_type=clone">
<h3><strong>SSH</strong> clone URL</h3>
<input type="text" class="clone js-url-field"
value="git@github.com:OpencachingTeam/opencaching.git" readonly="readonly">
<span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="git@github.com:OpencachingTeam/opencaching.git" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
</div>
<div class="clone-url "
data-protocol-type="subversion"
data-url="/users/set_protocol?protocol_selector=subversion&amp;protocol_type=clone">
<h3><strong>Subversion</strong> checkout URL</h3>
<input type="text" class="clone js-url-field"
value="https://github.com/OpencachingTeam/opencaching" readonly="readonly">
<span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/OpencachingTeam/opencaching" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
</div>
<p class="clone-options">You can clone with
<a href="#" class="js-clone-selector" data-protocol="http">HTTPS</a>,
<a href="#" class="js-clone-selector" data-protocol="ssh">SSH</a>,
<a href="#" class="js-clone-selector" data-protocol="subversion">Subversion</a>,
and <a href="https://help.github.com/articles/which-remote-url-should-i-use">other methods.</a>
</p>
<a href="http://windows.github.com" class="minibutton sidebar-button">
<span class="octicon octicon-device-desktop"></span>
Clone in Desktop
</a>
<a href="/OpencachingTeam/opencaching/archive/master.zip"
class="minibutton sidebar-button"
title="Download this repository as a zip file"
rel="nofollow">
<span class="octicon octicon-cloud-download"></span>
Download ZIP
</a>
</div>
</div>
<div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container>
<!-- blob contrib key: blob_contributors:v21:564950e0aa04adc5258a6960294e171c -->
<!-- blob contrib frag key: views10/v8/blob_contributors:v21:564950e0aa04adc5258a6960294e171c -->
<p title="This is a placeholder element" class="js-history-link-replace hidden"></p>
<a href="/OpencachingTeam/opencaching/find/master" data-pjax data-hotkey="t" style="display:none">Show File Finder</a>
<div class="file-navigation">
<div class="select-menu js-menu-container js-select-menu" >
<span class="minibutton select-menu-button js-menu-target" data-hotkey="w"
data-master-branch="master"
data-ref="master">
<span class="octicon octicon-git-branch"></span>
<i>branch:</i>
<span class="js-select-button">master</span>
</span>
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax>
<div class="select-menu-modal">
<div class="select-menu-header">
<span class="select-menu-title">Switch branches/tags</span>
<span class="octicon octicon-remove-close js-menu-close"></span>
</div> <!-- /.select-menu-header -->
<div class="select-menu-filters">
<div class="select-menu-text-filter">
<input type="text" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
</div>
<div class="select-menu-tabs">
<ul>
<li class="select-menu-tab">
<a href="#" data-tab-filter="branches" class="js-select-menu-tab">Branches</a>
</li>
<li class="select-menu-tab">
<a href="#" data-tab-filter="tags" class="js-select-menu-tab">Tags</a>
</li>
</ul>
</div><!-- /.select-menu-tabs -->
</div><!-- /.select-menu-filters -->
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
<div class="select-menu-item js-navigation-item selected">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/master/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="master" rel="nofollow" title="master">master</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocde_updates/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocde_updates" rel="nofollow" title="ocde_updates">ocde_updates</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocdegpx/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocdegpx" rel="nofollow" title="ocdegpx">ocdegpx</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocdetemplates/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocdetemplates" rel="nofollow" title="ocdetemplates">ocdetemplates</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocdetest/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocdetest" rel="nofollow" title="ocdetest">ocdetest</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocsedev/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocsedev" rel="nofollow" title="ocsedev">ocsedev</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/ocseprod/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="ocseprod" rel="nofollow" title="ocseprod">ocseprod</a>
</div> <!-- /.select-menu-item -->
<div class="select-menu-item js-navigation-item ">
<span class="select-menu-item-icon octicon octicon-check"></span>
<a href="/OpencachingTeam/opencaching/blob/rootpath/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="rootpath" rel="nofollow" title="rootpath">rootpath</a>
</div> <!-- /.select-menu-item -->
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div> <!-- /.select-menu-list -->
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div> <!-- /.select-menu-list -->
</div> <!-- /.select-menu-modal -->
</div> <!-- /.select-menu-modal-holder -->
</div> <!-- /.select-menu -->
<div class="breadcrumb">
<span class='repo-root js-repo-root'><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OpencachingTeam/opencaching" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">opencaching</span></a></span></span><span class="separator"> / </span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OpencachingTeam/opencaching/tree/master/code" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">code</span></a></span><span class="separator"> / </span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OpencachingTeam/opencaching/tree/master/code/htdocs" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">htdocs</span></a></span><span class="separator"> / </span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OpencachingTeam/opencaching/tree/master/code/htdocs/util2" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">util2</span></a></span><span class="separator"> / </span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OpencachingTeam/opencaching/tree/master/code/htdocs/util2/replication_monitor" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">replication_monitor</span></a></span><span class="separator"> / </span><strong class="final-path">replication_monitor.sh</strong> <span class="js-zeroclipboard minibutton zeroclipboard-button" data-clipboard-text="code/htdocs/util2/replication_monitor/replication_monitor.sh" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span>
</div>
</div>
<div class="commit file-history-tease">
<img class="main-avatar" height="24" src="https://secure.gravatar.com/avatar/b3609286d56a88ce59bfec29a5aae9c2?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" />
<span class="author"><a href="/totsubo" rel="author">totsubo</a></span>
<time class="js-relative-date" datetime="2011-01-06T03:44:30-08:00" title="2011-01-06 03:44:30">January 06, 2011</time>
<div class="commit-title">
<a href="/OpencachingTeam/opencaching/commit/74432eb287a70279c4f601ee9345e971b099dd9f" class="message" data-pjax="true">Initial import</a>
</div>
<div class="participation">
<p class="quickstat"><a href="#blob_contributors_box" rel="facebox"><strong>1</strong> contributor</a></p>
</div>
<div id="blob_contributors_box" style="display:none">
<h2 class="facebox-header">Users who have contributed to this file</h2>
<ul class="facebox-user-list">
<li class="facebox-user-list-item">
<img height="24" src="https://secure.gravatar.com/avatar/b3609286d56a88ce59bfec29a5aae9c2?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" />
<a href="/totsubo">totsubo</a>
</li>
</ul>
</div>
</div>
<div id="files" class="bubble">
<div class="file">
<div class="meta">
<div class="info">
<span class="icon"><b class="octicon octicon-file-text"></b></span>
<span class="mode" title="File Mode">file</span>
<span>45 lines (40 sloc)</span>
<span>1.248 kb</span>
</div>
<div class="actions">
<div class="button-group">
<a class="minibutton tooltipped leftwards"
title="Clicking this button will automatically fork this project so you can edit the file"
href="/OpencachingTeam/opencaching/edit/master/code/htdocs/util2/replication_monitor/replication_monitor.sh"
data-method="post" rel="nofollow">Edit</a>
<a href="/OpencachingTeam/opencaching/raw/master/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="button minibutton " id="raw-url">Raw</a>
<a href="/OpencachingTeam/opencaching/blame/master/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="button minibutton ">Blame</a>
<a href="/OpencachingTeam/opencaching/commits/master/code/htdocs/util2/replication_monitor/replication_monitor.sh" class="button minibutton " rel="nofollow">History</a>
</div><!-- /.button-group -->
<a class="minibutton danger empty-icon tooltipped downwards"
href="/OpencachingTeam/opencaching/delete/master/code/htdocs/util2/replication_monitor/replication_monitor.sh"
title="Fork this project and delete file" data-method="post" rel="nofollow">
Delete
</a>
</div><!-- /.actions -->
</div>
<div class="blob-wrapper data type-shell js-blob-data">
<table class="file-code file-diff">
<tr class="file-code-line">
<td class="blob-line-nums">
<span id="L1" rel="#L1">1</span>
<span id="L2" rel="#L2">2</span>
<span id="L3" rel="#L3">3</span>
<span id="L4" rel="#L4">4</span>
<span id="L5" rel="#L5">5</span>
<span id="L6" rel="#L6">6</span>
<span id="L7" rel="#L7">7</span>
<span id="L8" rel="#L8">8</span>
<span id="L9" rel="#L9">9</span>
<span id="L10" rel="#L10">10</span>
<span id="L11" rel="#L11">11</span>
<span id="L12" rel="#L12">12</span>
<span id="L13" rel="#L13">13</span>
<span id="L14" rel="#L14">14</span>
<span id="L15" rel="#L15">15</span>
<span id="L16" rel="#L16">16</span>
<span id="L17" rel="#L17">17</span>
<span id="L18" rel="#L18">18</span>
<span id="L19" rel="#L19">19</span>
<span id="L20" rel="#L20">20</span>
<span id="L21" rel="#L21">21</span>
<span id="L22" rel="#L22">22</span>
<span id="L23" rel="#L23">23</span>
<span id="L24" rel="#L24">24</span>
<span id="L25" rel="#L25">25</span>
<span id="L26" rel="#L26">26</span>
<span id="L27" rel="#L27">27</span>
<span id="L28" rel="#L28">28</span>
<span id="L29" rel="#L29">29</span>
<span id="L30" rel="#L30">30</span>
<span id="L31" rel="#L31">31</span>
<span id="L32" rel="#L32">32</span>
<span id="L33" rel="#L33">33</span>
<span id="L34" rel="#L34">34</span>
<span id="L35" rel="#L35">35</span>
<span id="L36" rel="#L36">36</span>
<span id="L37" rel="#L37">37</span>
<span id="L38" rel="#L38">38</span>
<span id="L39" rel="#L39">39</span>
<span id="L40" rel="#L40">40</span>
<span id="L41" rel="#L41">41</span>
<span id="L42" rel="#L42">42</span>
<span id="L43" rel="#L43">43</span>
<span id="L44" rel="#L44">44</span>
</td>
<td class="blob-line-code">
<div class="highlight"><pre><div class='line' id='LC1'><span class="c">#!/bin/bash</span></div><div class='line' id='LC2'><span class="c">#</span></div><div class='line' id='LC3'><span class="c"># Opencaching replication monitor bash script</span></div><div class='line' id='LC4'><span class="c">#</span></div><div class='line' id='LC5'><span class="c"># This script writes every 10 seconds the current timestamp to</span></div><div class='line' id='LC6'><span class="c"># table sys_repl_timestamp. This enables the cron-module </span></div><div class='line' id='LC7'><span class="c"># repliaction_monitor to check if the mysql replication slave(s) is up to </span></div><div class='line' id='LC8'><span class="c"># date and online.</span></div><div class='line' id='LC9'><span class="c">#</span></div><div class='line' id='LC10'><span class="c"># You should place this bash script outside the PHP configured </span></div><div class='line' id='LC11'><span class="c"># open_basedir restriction and place a cronjob entry that</span></div><div class='line' id='LC12'><span class="c"># executes every 5 minutes or place it in rc.3 or rc.5</span></div><div class='line' id='LC13'><span class="c"># (run this script on the master database server, not on any slave!)</span></div><div class='line' id='LC14'><span class="c">#</span></div><div class='line' id='LC15'><span class="c"># If you setup a cronjob call it with parameter &quot;-q&quot; to prevent</span></div><div class='line' id='LC16'><span class="c"># output of running-message.</span></div><div class='line' id='LC17'><span class="c">#</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'><span class="c"># begin of configuration</span></div><div class='line' id='LC20'><span class="nv">PIDFILE</span><span class="o">=</span>/var/run/oc_replication_monitor.pid</div><div class='line' id='LC21'><span class="nv">DBHOST</span><span class="o">=</span>oc</div><div class='line' id='LC22'><span class="nv">DBNAME</span><span class="o">=</span>oc</div><div class='line' id='LC23'><span class="nv">DBUSER</span><span class="o">=</span>oc</div><div class='line' id='LC24'><span class="nv">DBPASSWORD</span><span class="o">=</span>oc</div><div class='line' id='LC25'><span class="c"># end of configuration</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><span class="k">if</span> <span class="o">[</span> -f <span class="nv">$PIDFILE</span> <span class="o">]</span>; <span class="k">then</span></div><div class='line' id='LC28'><span class="k"> if</span> <span class="o">[</span> -d /proc/<span class="sb">`</span>cat <span class="nv">$PIDFILE</span><span class="sb">`</span> <span class="o">]</span>; <span class="k">then</span></div><div class='line' id='LC29'><span class="k"> if</span> <span class="o">(</span>readlink /proc/<span class="sb">`</span>cat <span class="nv">$PIDFILE</span><span class="sb">`</span>/exe | grep -q /bin/bash<span class="o">)</span>; <span class="k">then</span></div><div class='line' id='LC30'><span class="k"> if</span> <span class="o">[</span> <span class="s2">&quot;$1&quot;</span> !<span class="o">=</span> <span class="s2">&quot;-q&quot;</span> <span class="o">]</span>; <span class="k">then</span></div><div class='line' id='LC31'><span class="k"> </span><span class="nb">echo</span> <span class="s2">&quot;replication_monitor running with pid `cat $PIDFILE`, exiting&quot;</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">fi</span></div><div class='line' id='LC33'><span class="k"> </span><span class="nb">exit</span></div><div class='line' id='LC34'><span class="nb"> </span><span class="k">fi</span></div><div class='line' id='LC35'><span class="k"> fi</span></div><div class='line' id='LC36'><span class="k">fi</span></div><div class='line' id='LC37'><br/></div><div class='line' id='LC38'><span class="nb">echo</span> <span class="nv">$$</span> &gt; <span class="nv">$PIDFILE</span></div><div class='line' id='LC39'><br/></div><div class='line' id='LC40'><span class="k">while</span> <span class="o">[</span> 1 <span class="o">]</span></div><div class='line' id='LC41'><span class="k">do</span></div><div class='line' id='LC42'><span class="k"> </span>mysql -h<span class="nv">$DBHOST</span> -u<span class="nv">$DBUSER</span> -p<span class="nv">$DBPASSWORD</span> <span class="nv">$DBNAME</span> --execute<span class="o">=</span><span class="s2">&quot;INSERT INTO sys_repl_timestamp (id, data) VALUES (1, NOW()) ON DUPLICATE KEY UPDATE data=NOW();&quot;</span></div><div class='line' id='LC43'>&nbsp;&nbsp;sleep 10</div><div class='line' id='LC44'><span class="k">done</span></div></pre></div>
</td>
</tr>
</table>
</div>
</div>
</div>
<a href="#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" class="js-jump-to-line" style="display:none">Jump to Line</a>
<div id="jump-to-line" style="display:none">
<form accept-charset="UTF-8" class="js-jump-to-line-form">
<input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" autofocus>
<button type="submit" class="button">Go</button>
</form>
</div>
</div>
</div>
</div><!-- /.repo-container -->
<div class="modal-backdrop"></div>
</div>
</div><!-- /.site -->
</div><!-- /.wrapper -->
<div class="container">
<div class="site-footer">
<ul class="site-footer-links right">
<li><a href="https://status.github.com/">Status</a></li>
<li><a href="http://developer.github.com">API</a></li>
<li><a href="http://training.github.com">Training</a></li>
<li><a href="http://shop.github.com">Shop</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/about">About</a></li>
</ul>
<a href="/">
<span class="mega-octicon octicon-mark-github"></span>
</a>
<ul class="site-footer-links">
<li>&copy; 2013 <span title="0.11380s from fe2.rs.github.com">GitHub</span>, Inc.</li>
<li><a href="/site/terms">Terms</a></li>
<li><a href="/site/privacy">Privacy</a></li>
<li><a href="/security">Security</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div><!-- /.site-footer -->
</div><!-- /.container -->
<div class="fullscreen-overlay js-fullscreen-overlay" id="fullscreen_overlay">
<div class="fullscreen-container js-fullscreen-container">
<div class="textarea-wrap">
<textarea name="fullscreen-contents" id="fullscreen-contents" class="js-fullscreen-contents" placeholder="" data-suggester="fullscreen_suggester"></textarea>
<div class="suggester-container">
<div class="suggester fullscreen-suggester js-navigation-container" id="fullscreen_suggester"
data-url="/OpencachingTeam/opencaching/suggestions/commit">
</div>
</div>
</div>
</div>
<div class="fullscreen-sidebar">
<a href="#" class="exit-fullscreen js-exit-fullscreen tooltipped leftwards" title="Exit Zen Mode">
<span class="mega-octicon octicon-screen-normal"></span>
</a>
<a href="#" class="theme-switcher js-theme-switcher tooltipped leftwards"
title="Switch themes">
<span class="octicon octicon-color-mode"></span>
</a>
</div>
</div>
<div id="ajax-error-message" class="flash flash-error">
<span class="octicon octicon-alert"></span>
<a href="#" class="octicon octicon-remove-close close ajax-error-dismiss"></a>
Something went wrong with that request. Please try again.
</div>
</body>
</html>

26
local/stat/newimages.php Normal file
View File

@ -0,0 +1,26 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
// list of new images
chdir ("../..");
require('lib2/web.inc.php');
if (!isset($_REQUEST['since']))
exit;
$since = $_REQUEST['since'];
$rs = sql("SELECT url FROM pictures
WHERE date_created >= '2013' AND date_created >= '&1'
ORDER BY date_created",
$since);
while ($pic = sql_fetch_assoc($rs))
echo $pic['url'] . "\n";
mysql_free_result($rs);
?>