Merge branch 'stable'
This commit is contained in:
commit
61e684d970
@ -30,6 +30,7 @@
|
||||
if ($record['admin'] & ADMIN_MAINTAINANCE) $rights[] = "dbmaint";
|
||||
if ($record['admin'] & ADMIN_USER) $rights[] = "user/caches";
|
||||
if ($record['admin'] & ADMIN_NEWS) $rights[] = "newsapprove";
|
||||
if ($record['admin'] & ADMIN_RESTORE) $rights[] = "vand.restore";
|
||||
if ($record['admin'] & 128) $rights[] = "root";
|
||||
$admin['rights'] = implode(", ", $rights);
|
||||
$admins[] = $admin;
|
||||
|
@ -128,6 +128,8 @@ function searchUser()
|
||||
$r['hidden'] = sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1'", 0, $r['user_id']);
|
||||
$r['hidden_active'] = sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1' AND `status`=1", 0, $r['user_id']);
|
||||
$r['logentries'] = sql_value("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1'", 0, $r['user_id']);
|
||||
$r['deleted_logentries'] = sql_value("SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`='&1'", 0, $r['user_id']);
|
||||
$r['reports'] = sql_value("SELECT COUNT(*) FROM `cache_reports` WHERE `userid`='&1'", 0, $r['user_id']);
|
||||
|
||||
$r['last_known_login'] = sql_value("SELECT MAX(`last_login`) FROM `sys_sessions` WHERE `user_id`='&1'", 0, $r['user_id']);
|
||||
|
||||
|
@ -76,6 +76,7 @@
|
||||
*
|
||||
*/
|
||||
$opt['page']['absolute_url'] = $dev_baseurl;
|
||||
$opt['page']['develsystem'] = true;
|
||||
$opt['mail']['from'] = 'root';
|
||||
$opt['mail']['subject'] = '[local.opencaching.de] ';
|
||||
|
||||
|
@ -179,6 +179,7 @@
|
||||
$opt['page']['showdonations'] = false; // Show donations button
|
||||
|
||||
$opt['page']['absolute_url'] = 'http://devel.opencaching.de/'; // may be overwritten by $opt['domain'][...]['uri']
|
||||
$opt['page']['develsystem'] = false;
|
||||
|
||||
/* maximum number of failed logins per hour before that IP address is blocked
|
||||
* (used to prevent brute-force-attacks)
|
||||
|
@ -884,7 +884,7 @@ INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustrin
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('63', 'MNU_MYPROFILE_ADOPT', 'Adoptions', '827', 'Adoptions', '827', '0', 'adoptcache.php', '1', '9', '8', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('64', 'MNU_CACHES_ADOPT', 'Adoptions', '827', 'Adoptions', '827', '0', 'adoptcache.php', '0', '10', '9', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('65', 'MNU_ADMIN_USER', 'Manage User', '859', 'Manage User', '859', '0', 'adminuser.php', '1', '12', '4', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('66', 'MNU_ADMIN_NEWS', 'News approve', '873', 'News approve', '873', '1', 'newsapprove.php', '1', '12', '5', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('66', 'MNU_ADMIN_NEWS', 'News approve', '873', 'News approve', '873', '1', 'newsapprove.php', '1', '12', '6', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('67', 'MNU_START_DONATE', 'Donations', '900', 'Donations', '900', '0', 'articles.php?page=donations', '1', '1', '7', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('68', 'MNU_START_TOS', 'Terms of use', '906', 'Terms of use', '906', '0', 'articles.php?page=impressum#tos', '1', '1', '10', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('69', 'MNU_START_TEAM', 'Our Team', '907', 'Our Team', '907', '0', 'articles.php?page=team', '1', '1', '8', '', '1', NULL);
|
||||
@ -893,10 +893,11 @@ INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustrin
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('86', 'MNU_START_CHANGELOG', 'Changelog', '1797', 'Changelog', '1797', '0', 'articles.php?page=changelog', '0', '0', '10', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('87', 'MNU_START_OPERATOR', 'Operator Association', '1798', 'Operator Association', '1798', '0', 'articles.php?page=verein', '1', '1', '9', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('88', 'MNU_VERIFY_EMAIL', 'Verify e-mail address', '1824', 'Verify e-mail address', '1824', '0', 'verifyemail.php', '0', '0', '0', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('89', 'MNU_ADMIN_ADMINS', 'Admins', '1831', 'Admins', '1831', '1', 'admins.php', '1', '12', '6', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('89', 'MNU_ADMIN_ADMINS', 'Admins', '1831', 'Admins', '1831', '1', 'admins.php', '1', '12', '7', '', '0', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('90', 'MNU_START_NEWLOGPICS', 'Picture gallery', '1940', 'Picture gallery', '1940', '0', 'newlogpics.php', '1', '7', '7', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('91', 'MNU_START_OPENCACHING', 'About Opencaching', '1963', 'About Opencaching', '1963', '0', '!http://wiki.opencaching.de/index.php/Opencaching.de', '1', '1', '2', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('92', 'MNU_MYPROFILE_PUBLIC', 'Public profile', '1952', 'Public profile', '1952', '0', 'viewprofile.php', '1', '9', '2', '', '1', NULL);
|
||||
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('93', 'MNU_ADMIN_RESTORE', 'Vandalism', '1880', 'Vandalism', '1880', '0', 'restorecaches.php', '1', '12', '5', '', '0', NULL);
|
||||
|
||||
-- Table sys_trans
|
||||
SET NAMES 'utf8';
|
||||
@ -1698,7 +1699,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('818', 'doc/sql/
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('819', 'Sorry, the Geocache is locked and can not be viewed.', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('821', 'Locked, visible', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('822', 'Locked, invisible', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('823', 'Last modified:', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('823', 'Last modified', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('826', '=== Please select ===', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('827', 'Adoptions', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('828', 'Date', '2010-08-28 11:48:04');
|
||||
@ -1959,7 +1960,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1448', 'delete
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1450', 'Your HTML code will be changed again by a special filter. This is nacessary to avoid dangerous HTML-tags, such as \<script\>. A list of allowed HTML tags can be find <a href=\"http://www.opencaching.de/articles.php?page=htmltags\">here</a>.', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1451', 'Please do not use any images that are hosted on geocaching.com. Upload your fotos instead on our server as well.', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1452', 'Encrypted note:', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1453', 'Do you really want to delete the description of your cache \"{cachename}\"', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1453', 'Do you really want to delete this description of your cache \"{cachename}\"', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1454', 'Yes, delete cache description', '2010-09-07 20:19:08');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1455', 'Submit cache', '2010-09-07 20:19:09');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1456', 'Format:\ DD-MM-YYYY', '2010-09-07 20:19:09');
|
||||
@ -2349,6 +2350,43 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1875', 'You mus
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1876', 'Map data \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1877', 'tiles provided by <a href=\"http://www.mapquest.com/\" target=\"_blank\">MapQuest</a>', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1878', 'Map data \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> and <a href=\"http://www.thunderforest.com/opencyclemap/\" target=\"_blank\">OpenCycleMap</a> contributors', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1879', 'Cache reports', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1880', 'Vandalism', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1881', 'Revert Vandalism', '2013-03-03 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1882', 'User \'%1\' is unknown', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1883', '%1 has not listed any caches', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1884', 'Restore cache listings of %1', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1885', 'User \'%1\' is not disabled. You can view recorded changes, but not revert them.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1886', 'You did not select any caches.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1887', 'No saved data is available for these caches.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1888', 'You must select a date.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1889', 'Use your browser\'s \'back\' button to try again.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1890', 'You must choosse the listing elements to be restored.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1891', 'You did not say that you are sure.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1892', 'Please select the listings to restore', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1893', 'modified', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1894', 'The user changed one or more of these caches today, therefore you cannot revert changes. This can be done not before tomorrow.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1895', 'none', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1896', 'Go on', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1897', 'to the date selection', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1898', 'Please select the date from which on all changes are to be reverted.<br />The listing will be reset to the contents it had on that day at 00:00:00.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1900', 'Changes', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1901', 'Warning: If you revert any owner-made listing changes of <em>today</em>, your revert will be final. It cannot be corrected / undone afterwards. Only reverts of coords \& country, logs and pictures will be logged in this case, so all other changes will not be comprehensible. Therefore <span style=\"text-decoration:underline\">it is strongly recommended to revert vandalism not before the next day!</span>', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1902', 'coordinates and country', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1903', 'name, settings, attributes and hide-date', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1904', 'GC/NC waypoints', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1905', 'description(s) incl. pictures', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1906', 'logs incl. pictures', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1907', 'nothing', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1908', 'Excluded from restore: cache status, OConly attribute, additional waypoints, log password, preview picture status', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1909', 'simulate', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1910', 'You are root admin and can override the warnings. Take care!', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1911', 'The following cache listings would have been reset to the state before %1', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1912', 'The following cache listings have been reset to the state before %', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1913', 'Restore', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1914', '_all', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1915', 'deleted', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1916', 'archived', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1918', 'Please use the spoiler mark also for log pictures, to prevent that they appear on log gallery pages.', '2013-02-23 19:00:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1919', 'New log pictures', '2013-02-23 19:00:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1920', 'D', '2013-03-03 00:00:00');
|
||||
@ -5370,7 +5408,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('819', 'DE', 'Entschuldigung, der Geocache wurde gesperrt und kann nicht angezeigt werden.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('821', 'DE', 'Gesperrt', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('822', 'DE', 'Gesperrt, versteckt', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'DE', 'Zuletzt geändert:', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'DE', 'Zuletzt geändert', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('826', 'DE', '=== Bitte auswählen ===', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('827', 'DE', 'Adoptieren', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('828', 'DE', 'Datum', '2010-08-28 11:48:07');
|
||||
@ -5631,7 +5669,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1450', 'DE', 'Dein HTML-Code wird nochmals durch einen speziellen Filter verändert. Dies ist notwendig, um gefährliche HTML-Tages wie z.B. \<script\> zu filtern. Eine Liste mit erlaubten HTML-Tags findest du <a href=\"http://www.opencaching.de/articles.php?page=htmltags\">hier</a>.', '2010-09-11 02:45:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1451', 'DE', 'Bitte verwende keine Bilder, die auf geocaching.com gehostet sind. Lade sie statt dessen auch auf unseren Server.', '2010-09-10 23:28:13');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1452', 'DE', 'Verschlüsselter Hinweis:', '2010-09-10 23:27:58');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1453', 'DE', 'Möchtest du wirklich die Beschreibung deines Caches \"{cachename}\" löschen?', '2010-09-11 02:40:12');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1453', 'DE', 'Möchtest du wirklich diese Beschreibung deines Cache \"{cachename}\" löschen?', '2010-09-11 02:40:12');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1454', 'DE', 'Ja, Cachebeschreibung l\öschen', '2010-09-10 23:26:27');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1455', 'DE', 'Cache\ senden', '2010-09-10 23:26:19');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1456', 'DE', 'Format:\ TT-MM-JJJJ', '2010-09-10 23:26:02');
|
||||
@ -6019,6 +6057,43 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1876', 'DE', 'Kartendaten \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a>-Mitwirkende', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1877', 'DE', 'Kacheln bereitgestellt von <a href=\"http://www.mapquest.com/\" target=\"_blank\">MapQuest</a>', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1878', 'DE', 'Kartendaten \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a>- und <a href=\"http://www.thunderforest.com/opencyclemap/\" target=\"_blank\">OpenCycleMap</a>-Mitwirkende', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1879', 'DE', 'Cachemeldungen', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1880', 'DE', 'Vandalismus', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1881', 'DE', 'Vandalismus zurücksetzen', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1882', 'DE', 'Benutzer \'%1\' is unbekannt', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1883', 'DE', '%1 hat keine Caches veröffentlicht', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1884', 'DE', 'Cache-Listings von %1 wiederherstellen', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1885', 'DE', 'Der Benutzer \'%1\' is nicht deaktiviert. Du kannst aufgezeichnete Änderungen für seine Caches sehen, aber nicht zurücksetzen.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1886', 'DE', 'Du hast keine Caches ausgewählt.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1887', 'DE', 'Für diese Caches sind keine aufgezeichneten Daten verfügbar.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1888', 'DE', 'Du musst ein Datum wählen.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1889', 'DE', 'Verwende den \'Zurück\'-Knopf deines Browsers, um es noch einmal zu versuchen.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1890', 'DE', 'Du must auswählen, welche Teile der Listings wiederhergestellt werden sollen.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1891', 'DE', 'Du hast nicht bestätigt, dass du sicher bist.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1892', 'DE', 'Bitte wähle die wiederherzustellenden Listings', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1893', 'DE', 'geändert', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1894', 'DE', 'Der Benutzer hat einen oder mehrere dieser Caches erst heute geändert. Du kannst die Änderungen frühestens morgen zurücksetzen.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1895', 'DE', 'keine', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1896', 'DE', 'Weiter ...', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1897', 'DE', 'zur Datumsauswahl', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1898', 'DE', 'Bitte wähle das Datum aus, ab dem alle Änderungen rückgängig gemacht werden sollen.<br />Das Listing wird auf den Stand zurückgesetzt, den es an diesem Tag um 00:00 Uhr hatte.', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1900', 'DE', 'Änderungen', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1901', 'DE', 'Warnung: Wenn du vom Owner <em>heute</em> vorgenommene Änderungen zurücksetzt, wird dies endgültig sein. Es kann nachher nicht mehr korrigiert bzw. rückgängig gemacht werden. Nur Änderungen an Koordinaten, Land, Logs und Bildern werden dabei aufgezeichnet, sodass alle anderen Zurücksetzungen nicht mehr nachvollziehbar sind. Daher <span style=\"text-decoration:underline\">sollte Vandalismus frühestens am nachfolgenden Tag zurückgesetzt werden!</span>', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1902', 'DE', 'Koordinaten und Land', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1903', 'DE', 'Name, Eigenschaften, Attribute und Versteckdatum', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1904', 'DE', 'GC/NC-Wegpunkte', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1905', 'DE', 'Beschreibung(en) inkl. Bildern', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1906', 'DE', 'Logs inkl. Bildern', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1907', 'DE', 'Nichts', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1908', 'DE', 'Von der Wiederherstellung ausgenommen: Cachestatus, OConly-Attribut, zusätzliche Wegpunkte, Logpasswort, Vorschaubild-Markierung', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1909', 'DE', 'simulieren', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1910', 'DE', 'Du bist Root-Admin und kannst daher die Warnungen übergehen. Sei vorsichtig!', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1911', 'DE', 'Die folgenden Listings wären auf den Stand vor %1 zurückgesetzt worden', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1912', 'DE', 'Die folgenden Listings wurden auf den Stand vor %1 zurückgesetzt', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1913', 'DE', 'Wiederherstellen', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1914', 'DE', 'Alles', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1915', 'DE', 'gelöscht', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1916', 'DE', 'archiviert', '2013-03-08 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1918', 'DE', 'Bitte verwende diese Markierung auch für Logbilder, damit sie nicht auf den Log-Galerieseiten erscheinen.', '2013-02-19 05:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1919', 'DE', 'Neue Logbilder', '2013-02-19 05:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1920', 'DE', 'D', '2012-10-11 00:00:00');
|
||||
@ -6859,7 +6934,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('819', 'EN', 'Sorry, this geocache is locked and cannot be viewed.', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('821', 'EN', 'Locked, visible', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('822', 'EN', 'Locked, invisible', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'EN', 'Last modified:', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'EN', 'Last modified', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('826', 'EN', '=== Please select ===', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('827', 'EN', 'Adoptions', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('828', 'EN', 'Date', '2010-08-28 11:48:08');
|
||||
@ -6953,7 +7028,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1063', 'EN', 'Page creation', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1097', 'EN', 'D/T', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1100', 'EN', '.gpx', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1123', 'EN', 'Cachename', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1123', 'EN', 'Cache\ name', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1141', 'EN', 'N', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1142', 'EN', 'S', '2010-08-28 11:48:08');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1143', 'EN', 'E', '2010-08-28 11:48:08');
|
||||
@ -7120,7 +7195,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1450', 'EN', 'Your HTML code will be changed again by a special filter. This is nacessary to avoid dangerous HTML-tags, such as \<script\>. A list of allowed HTML tags can be find <a href=\"http://www.opencaching.de/articles.php?page=htmltags\">here</a>.', '2010-09-10 23:29:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1451', 'EN', 'Please do not use any images that are hosted on geocaching.com. Upload your fotos instead on our server as well.', '2010-09-10 23:28:13');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1452', 'EN', 'Encrypted note:', '2010-09-10 23:28:04');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1453', 'EN', 'Do you really want to delete the description of your cache \"{cachename}\"', '2010-09-10 23:26:47');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1453', 'EN', 'Do you really want to delete this description of your cache \"{cachename}\"', '2010-09-10 23:26:47');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1454', 'EN', 'Yes, delete cache description', '2010-09-10 23:26:27');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1455', 'EN', 'Submit cache', '2010-09-10 23:26:19');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1456', 'EN', 'Format: DD-MM-YYYY', '2010-09-10 23:26:10');
|
||||
@ -7510,6 +7585,9 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1876', 'EN', 'Map data \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1877', 'EN', 'tiles provided by <a href=\"http://www.mapquest.com/\" target=\"_blank\">MapQuest</a>', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1878', 'EN', 'Map data \© <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> and <a href=\"http://www.thunderforest.com/opencyclemap/\" target=\"_blank\">OpenCycleMap</a> contributors', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1879', 'EN', 'Cache reports', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1880', 'EN', 'Vandalism', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1881', 'EN', 'Revert Vandalism', '2012-10-11 00:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1918', 'EN', 'Please use the spoiler mark also for log pictures, to prevent that they appear on log gallery pages.', '2013-02-19 05:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1919', 'EN', 'New log pictures', '2013-02-19 05:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1920', 'EN', 'D', '2012-10-11 00:00:00');
|
||||
@ -8350,7 +8428,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('819', 'ES', 'Lo sentimos, este geocache está cerrado y no se puede ver.', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('821', 'ES', 'Cerrado, visible', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('822', 'ES', 'Cerrado, invisible', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'ES', 'Última modificación:', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'ES', 'Última modificación', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('826', 'ES', '=== Por favor selecciona ===', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('827', 'ES', 'Adopciones', '2010-12-09 00:17:59');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('828', 'ES', 'Data', '2010-12-09 00:17:59');
|
||||
@ -9920,7 +9998,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('819', 'IT', 'Spiacente, la geocache è chiusa e non può essere vista.', '2010-09-01 23:49:32');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('821', 'IT', 'Chiusa, visibile', '2010-09-01 23:49:32');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('822', 'IT', 'Chiusa, invisibile', '2010-08-31 20:06:24');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'IT', 'Ultima modifica:', '2010-09-01 23:49:32');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'IT', 'Ultima modifica', '2010-09-01 23:49:32');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('826', 'IT', '=== Per favore seleziona ===', '2010-08-31 20:06:24');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('827', 'IT', 'Adozioni', '2010-09-01 23:49:32');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('828', 'IT', 'Data', '2010-08-31 20:06:24');
|
||||
@ -11366,7 +11444,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('819', 'NL', 'Sorry, da cache is geblokkerd en kan niet bekeken worden.', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('821', 'NL', 'Geblokkeerd, zichtbaar', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('822', 'NL', 'Geblokkerd, nietzichtbaar', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'NL', 'Laatste verandering:', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('823', 'NL', 'Laatste verandering', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('827', 'NL', 'Adopteren', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('828', 'NL', 'Datum', '2011-02-04 19:50:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('829', 'NL', 'Ja, ik heb de <a href=\"articles.php?page=impressum#tos\">gebruikersovereenkomst</a> van Opencaching.nl gelezen en accepteren', '2011-02-04 19:50:07');
|
||||
|
4
htdocs/images/uploads/deleted/.htaccess
Normal file
4
htdocs/images/uploads/deleted/.htaccess
Normal file
@ -0,0 +1,4 @@
|
||||
<FilesMatch ".*">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
</FilesMatch>
|
@ -20,6 +20,6 @@
|
||||
|
||||
****************************************************************************/
|
||||
?>
|
||||
<h1>{t}delete this cache-description{/t}</h1>
|
||||
<p>{t}Do you really want to delete the description of your cache "{cachename}"{/t}</p>
|
||||
<h1>{t}delete this cache-description{/t} ({desclang_name})</h1>
|
||||
<p>{t}Do you really want to delete this description of your cache "{cachename}"{/t}</p>
|
||||
<p><a href="removedesc.php?cacheid={cacheid_urlencode}&desclang={desclang_urlencode}&commit=1">{t}Yes, delete cache description{/t}</a></p>
|
@ -441,16 +441,19 @@
|
||||
|
||||
function sql_error()
|
||||
{
|
||||
global $debug_page;
|
||||
global $sql_errormail;
|
||||
global $emailheaders;
|
||||
global $absolute_server_URI;
|
||||
global $interface_output;
|
||||
global $dberrormsg;
|
||||
|
||||
$msql_error = mysql_errno() . ": " . mysql_error();
|
||||
|
||||
if ($sql_errormail != '')
|
||||
{
|
||||
// sendout email
|
||||
$email_content = mysql_errno() . ": " . mysql_error();
|
||||
$email_content = $msql_error;
|
||||
$email_content .= "\n--------------------\n";
|
||||
$email_content .= print_r(debug_backtrace(), true);
|
||||
mb_send_mail($sql_errormail, 'sql_error: ' . $absolute_server_URI, $email_content, $emailheaders);
|
||||
@ -459,13 +462,14 @@
|
||||
if ($interface_output == 'html')
|
||||
{
|
||||
// display errorpage
|
||||
tpl_errorMsg('sql_error', $dberrormsg);
|
||||
tpl_errorMsg('sql_error', $dberrormsg . ($debug_page ? "<br />" . $msql_error : ""));
|
||||
exit;
|
||||
}
|
||||
else if ($interface_output == 'plain')
|
||||
{
|
||||
echo "\n";
|
||||
echo 'sql_error' . "\n";
|
||||
if ($debug_page) echo $msql_error . "\n";
|
||||
echo '---------' . "\n";
|
||||
echo print_r(debug_backtrace(), true) . "\n";
|
||||
exit;
|
||||
|
@ -201,7 +201,7 @@
|
||||
else if ((substr($sql, $sqlpos - $arglength - 1, 1) == '`') && (substr($sql, $sqlpos + 1, 1) == '`'))
|
||||
$filtered_sql .= sql_escape_backtick($args[$arg]);
|
||||
else
|
||||
sql_error();
|
||||
sql_error($sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -258,7 +258,7 @@
|
||||
$filtered_sql .= '`';
|
||||
}
|
||||
else
|
||||
sql_error();
|
||||
sql_error($sql);
|
||||
|
||||
$sqlpos = $nextarg + $arglength + 1;
|
||||
}
|
||||
@ -302,7 +302,7 @@
|
||||
$result = $sqldebugger->execute($filtered_sql, $dblink, ($dblink===$db['dblink_slave']), $db['slave_server']);
|
||||
if ($result === false)
|
||||
{
|
||||
sql_error();
|
||||
sql_error($filtered_sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -318,7 +318,7 @@
|
||||
$result = @mysql_query($filtered_sql, $dblink);
|
||||
if ($result === false)
|
||||
{
|
||||
sql_error();
|
||||
sql_error($filtered_sql);
|
||||
}
|
||||
|
||||
if ($opt['db']['warn']['time'] > 0)
|
||||
@ -876,7 +876,7 @@
|
||||
$db['dblink_slave'] = false;
|
||||
}
|
||||
|
||||
function sql_error()
|
||||
function sql_error($sqlstatement="")
|
||||
{
|
||||
global $tpl, $opt, $db;
|
||||
global $bSmartyNoTranslate;
|
||||
@ -888,6 +888,8 @@
|
||||
|
||||
$errno = mysql_errno();
|
||||
$error = mysql_error();
|
||||
if ($sqlstatement != "")
|
||||
$error .= "\n\nSQL statement: " . $sqlstatement;
|
||||
|
||||
if ($db['connected'] == false)
|
||||
$bSmartyNoTranslate = true;
|
||||
@ -902,7 +904,7 @@
|
||||
$mail->name = 'sql_error';
|
||||
|
||||
$mail->assign('errno', $errno);
|
||||
$mail->assign('error', $error);
|
||||
$mail->assign('error', str_replace("\n","\r\n",$error));
|
||||
$mail->assign('trace', print_r(debug_backtrace(), true));
|
||||
|
||||
$mail->send();
|
||||
@ -914,14 +916,14 @@
|
||||
if (isset($tpl))
|
||||
{
|
||||
if ($opt['db']['error']['display'] == true)
|
||||
$tpl->error('MySQL error' . ' (' . $errno . '): ' . $error);
|
||||
$tpl->error('MySQL error (' . $errno . '): ' . $error);
|
||||
else
|
||||
$tpl->error('A database command could not be performed.');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($opt['db']['error']['display'] == true)
|
||||
die('<html><body>' . htmlspecialchars('MySQL error (' .$errno . '): ' . $error) . '</body></html>');
|
||||
die('<html><body>' . htmlspecialchars('MySQL error (' .$errno . '): ' . str_replace("\n,","<br />", $error)) . '</body></html>');
|
||||
else
|
||||
die('<html><body>A database command could not be performed</body></html>');
|
||||
}
|
||||
|
@ -146,7 +146,6 @@ class cachelog
|
||||
{
|
||||
return $this->reCacheLog->setValue('text_htmledit', $value);
|
||||
}
|
||||
|
||||
function getUUID()
|
||||
{
|
||||
return $this->reCacheLog->getValue('uuid');
|
||||
@ -168,6 +167,15 @@ class cachelog
|
||||
return $this->reCacheLog->setValue('node', $value);
|
||||
}
|
||||
|
||||
function getOwnerNotified()
|
||||
{
|
||||
return $this->reCacheLog->getValue('owner_notified') != 0;
|
||||
}
|
||||
function setOwnerNotified($value)
|
||||
{
|
||||
return $this->reCacheLog->setValue('owner_notified', $value ? 1 : 0);
|
||||
}
|
||||
|
||||
function getAnyChanged()
|
||||
{
|
||||
return $this->reCacheLog->getAnyChanged();
|
||||
@ -177,7 +185,18 @@ class cachelog
|
||||
function save()
|
||||
{
|
||||
sql_slave_exclude();
|
||||
return $this->reCacheLog->save();
|
||||
$saved = $this->reCacheLog->save();
|
||||
if ($saved && $this->nLogId == ID_NEW)
|
||||
$this->nLogId = $this->reCacheLog->getValue('id');
|
||||
return $saved;
|
||||
}
|
||||
|
||||
function updatePictureStat()
|
||||
{
|
||||
sql("UPDATE `cache_logs` SET `picture` =
|
||||
(SELECT COUNT(*) FROM `pictures` WHERE `object_type`=1 AND `object_id`='&1')
|
||||
WHERE `id`= '&1'",
|
||||
$this->getLogId());
|
||||
}
|
||||
|
||||
function allowView()
|
||||
|
@ -33,6 +33,7 @@
|
||||
define('ADMIN_MAINTAINANCE', 2); // check table etc.
|
||||
define('ADMIN_USER', 4); // drop users, caches etc.
|
||||
define('ADMIN_NEWS', 8); // approve news entries
|
||||
define('ADMIN_RESTORE', 16); // restore vandalized listings
|
||||
define('ADMIN_ROOT', 128 | 127); // root + all previous rights
|
||||
|
||||
define('ATTRIB_SELECTED', 1);
|
||||
|
@ -93,7 +93,7 @@ class picture
|
||||
return false;
|
||||
|
||||
$sExtension = mb_strtolower(substr($sFilename, strrpos($sFilename, '.') + 1));
|
||||
|
||||
|
||||
if (strpos(';' . $opt['logic']['pictures']['extensions'] . ';', ';' . $sExtension . ';') !== false)
|
||||
return true;
|
||||
else
|
||||
@ -108,13 +108,15 @@ class picture
|
||||
return;
|
||||
if (strpos($sFilename, '.') === false)
|
||||
return;
|
||||
|
||||
$sExtension = mb_strtolower(substr($sFilename, strrpos($sFilename, '.') + 1));
|
||||
$this->sFileExtension = $sExtension;
|
||||
|
||||
$sUUID = $this->getUUID();
|
||||
|
||||
$this->sFileExtension = $sExtension;
|
||||
$this->setUrl($opt['logic']['pictures']['url'] . $sUUID . '.' . $sExtension);
|
||||
//$this->setThumbUrl($opt['logic']['pictures']['thumb_url'] . substr($sUUID, 0, 1) . '/' . substr($sUUID, 1, 1) . '/' . $sUUID . '.' . $sExtension);
|
||||
|
||||
$this->bFilenamesSet = true;
|
||||
}
|
||||
|
||||
@ -123,17 +125,51 @@ class picture
|
||||
return $this->nPictureId;
|
||||
}
|
||||
|
||||
function delete()
|
||||
private function setArchiveFlag($bRestoring, $original_id=0)
|
||||
{
|
||||
global $opt;
|
||||
global $login;
|
||||
|
||||
// delete record, image and thumb
|
||||
@unlink($this->getFilename());
|
||||
@unlink($this->getThumbFilename());
|
||||
// This function determines if an insert, update oder deletion at pictures table
|
||||
// ist to be recorded for vandalism recovery, depending on WHO OR WHY the
|
||||
// operation is done. Other conditions, depending on the data, are handled
|
||||
// by triggers.
|
||||
//
|
||||
// Data is passed by ugly global DB variables, so try call this function as
|
||||
// close before the targetet DB operation as possible.
|
||||
|
||||
sql("DELETE FROM `pictures` WHERE `id`='&1'", $this->nPictureId);
|
||||
if ($this->getObjectType() == 1)
|
||||
{
|
||||
/*
|
||||
$owner_id = sql_value("SELECT `user_id` FROM `caches` WHERE `cache_id`=
|
||||
IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`='&1'),
|
||||
(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`='&1'))",
|
||||
0, $this->getObjectId());
|
||||
*/
|
||||
$logger_id = sql_value("SELECT
|
||||
IFNULL((SELECT `user_id` FROM `cache_logs` WHERE `id`='&1'),
|
||||
(SELECT `user_id` FROM `cache_logs_archived` WHERE `id`='&1'))",
|
||||
0, $this->getObjectId());
|
||||
|
||||
return true;
|
||||
$archive = ($bRestoring || $login->userid != $logger_id);
|
||||
}
|
||||
else
|
||||
$archive = true;
|
||||
|
||||
sql("SET @archive_picop=" . ($archive ? "TRUE" : "FALSE"));
|
||||
sql_slave("SET @archive_picop=" . ($archive ? "TRUE" : "FALSE"));
|
||||
|
||||
sql("SET @original_picid='&1'", $original_id);
|
||||
sql_slave("SET @original_picid='&1'", $original_id);
|
||||
|
||||
// @archive_picop and @original_picid are evaluated by trigger functions
|
||||
}
|
||||
|
||||
private function resetArchiveFlag()
|
||||
{
|
||||
sql("SET @archive_picop=FALSE");
|
||||
sql("SET @original_picid=0");
|
||||
sql_slave("SET @archive_picop=FALSE");
|
||||
sql_slave("SET @original_picid=0");
|
||||
}
|
||||
|
||||
function getUrl()
|
||||
@ -179,6 +215,14 @@ class picture
|
||||
{
|
||||
return $this->rePicture->setValue('local', $value ? 1 : 0);
|
||||
}
|
||||
function getUnknownFormat()
|
||||
{
|
||||
return $this->rePicture->getValue('unknown_format')!=0;
|
||||
}
|
||||
function setUnknownFormat($value)
|
||||
{
|
||||
return $this->rePicture->setValue('unknown_format', $value ? 1 : 0);
|
||||
}
|
||||
function getDisplay()
|
||||
{
|
||||
return $this->rePicture->getValue('display')!=0;
|
||||
@ -197,18 +241,18 @@ class picture
|
||||
}
|
||||
function getFilename()
|
||||
{
|
||||
// works intendently before bFilenameSet == true !
|
||||
global $opt;
|
||||
|
||||
if (mb_substr($opt['logic']['pictures']['dir'], -1, 1) != '/')
|
||||
$opt['logic']['pictures']['dir'] .= '/';
|
||||
|
||||
$uuid = $this->getUUID();
|
||||
$url = $this->getUrl();
|
||||
$fna = mb_split('\\.', $url);
|
||||
$extension = mb_strtolower($fna[count($fna) - 1]);
|
||||
|
||||
return $opt['logic']['pictures']['dir'] . $uuid . '.' . $extension;
|
||||
$fna = mb_split('\\/', $url);
|
||||
|
||||
return $opt['logic']['pictures']['dir'] . end($fna);
|
||||
}
|
||||
|
||||
function getThumbFilename()
|
||||
{
|
||||
global $opt;
|
||||
@ -216,16 +260,16 @@ class picture
|
||||
if (mb_substr($opt['logic']['pictures']['thumb_dir'], -1, 1) != '/')
|
||||
$opt['logic']['pictures']['thumb_dir'] .= '/';
|
||||
|
||||
$uuid = $this->getUUID();
|
||||
$url = $this->getUrl();
|
||||
$fna = mb_split('\\.', $url);
|
||||
$extension = mb_strtolower($fna[count($fna) - 1]);
|
||||
$fna = mb_split('\\/', $url);
|
||||
$filename = end($fna);
|
||||
|
||||
$dir1 = mb_strtoupper(mb_substr($uuid, 0, 1));
|
||||
$dir2 = mb_strtoupper(mb_substr($uuid, 1, 1));
|
||||
$dir1 = mb_strtoupper(mb_substr($filename, 0, 1));
|
||||
$dir2 = mb_strtoupper(mb_substr($filename, 1, 1));
|
||||
|
||||
return $opt['logic']['pictures']['thumb_dir'] . $dir1 . '/' . $dir2 . '/' . $uuid . '.' . $extension;
|
||||
return $opt['logic']['pictures']['thumb_dir'] . $dir1 . '/' . $dir2 . '/' . $filename;
|
||||
}
|
||||
|
||||
function getLogId()
|
||||
{
|
||||
if ($this->getObjectType() == OBJECT_CACHELOG)
|
||||
@ -311,13 +355,29 @@ class picture
|
||||
return $this->rePicture->getAnyChanged();
|
||||
}
|
||||
|
||||
// return if successfull (with insert)
|
||||
function save()
|
||||
// return true if successful (with insert)
|
||||
function save($restore=false, $original_id=0, $original_url="")
|
||||
{
|
||||
$undelete = ($original_id != 0);
|
||||
|
||||
if ($undelete)
|
||||
if ($this->bFilenamesSet == true)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
// restore picture file
|
||||
$this->setUrl($original_url); // set the url, so that we can
|
||||
$filename = $this->getFilename(); // .. retreive the file path+name
|
||||
$this->setFilenames($filename); // now set url(s) from the new uuid
|
||||
@rename($this->deleted_filename($filename), $this->getFilename());
|
||||
}
|
||||
|
||||
if ($this->bFilenamesSet == false)
|
||||
return false;
|
||||
|
||||
$this->setArchiveFlag($restore, $original_id);
|
||||
$bRetVal = $this->rePicture->save();
|
||||
$this->resetArchiveFlag();
|
||||
|
||||
if ($bRetVal)
|
||||
{
|
||||
@ -331,6 +391,43 @@ class picture
|
||||
return $bRetVal;
|
||||
}
|
||||
|
||||
function delete($restore=false)
|
||||
{
|
||||
// see also removelog.php, 'remove log pictures'
|
||||
|
||||
global $opt;
|
||||
|
||||
// delete record, image and thumb
|
||||
$this->setArchiveFlag($restore);
|
||||
sql("DELETE FROM `pictures` WHERE `id`='&1'", $this->nPictureId);
|
||||
$this->resetArchiveFlag();
|
||||
|
||||
// archive picture if picture record has been archived
|
||||
if (sql_value("SELECT `id` FROM `pictures_modified` WHERE `id`='&1'",
|
||||
0, $this->getPictureId()) != 0)
|
||||
{
|
||||
$filename = $this->getFilename();
|
||||
@rename($filename, $this->deleted_filename($filename));
|
||||
}
|
||||
else
|
||||
@unlink($filename);
|
||||
|
||||
@unlink($this->getThumbFilename());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function deleted_filename($filename)
|
||||
{
|
||||
$fna = mb_split('\\/',$filename);
|
||||
$fna[] = end($fna);
|
||||
$fna[count($fna)-2] = 'deleted';
|
||||
$dp = "";
|
||||
foreach ($fna as $fp)
|
||||
$dp .= "/" . $fp;
|
||||
return substr($dp,1);
|
||||
}
|
||||
|
||||
function allowEdit()
|
||||
{
|
||||
global $login;
|
||||
|
@ -880,6 +880,9 @@ class user
|
||||
sql_free_result($rsp);
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// discard achived logs' texts
|
||||
sql("UPDATE `cache_logs_archived` SET `text`='' WHERE `user_id`='&1'", $this->getUserId());
|
||||
|
||||
// success
|
||||
return true;
|
||||
@ -1130,13 +1133,12 @@ class user
|
||||
if ($login->userid != $this->nUserId && ($login->admin & ADMIN_USER) != ADMIN_USER)
|
||||
return false;
|
||||
|
||||
if (sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1'", 0, $this->nUserId) > 0)
|
||||
return false;
|
||||
|
||||
if (sql_value("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1'", 0, $this->nUserId) > 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return
|
||||
sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1'", 0, $this->nUserId)
|
||||
+ sql_value("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1'", 0, $this->nUserId)
|
||||
+ sql_value("SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`='&1'", 0, $this->nUserId)
|
||||
+ sql_value("SELECT COUNT(*) FROM `cache_reports` WHERE `userid`='&1'", 0, $this->nUserId)
|
||||
== 0;
|
||||
}
|
||||
|
||||
function delete()
|
||||
@ -1160,13 +1162,7 @@ class user
|
||||
serialize($backup));
|
||||
|
||||
sql("DELETE FROM `user` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `cache_adoption` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `cache_ignore` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `cache_rating` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `cache_watches` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `stat_user` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `user_options` WHERE `user_id`='&1'", $this->nUserId);
|
||||
sql("DELETE FROM `watches_waiting` WHERE `user_id`='&1'", $this->nUserId);
|
||||
// all data in depending tables is cleared via trigger
|
||||
|
||||
$this->reload();
|
||||
|
||||
|
@ -71,24 +71,25 @@
|
||||
if ($log_record['allow_user_view'] != 1 && $log_record['cache_owner_id'] != $usr['userid'])
|
||||
exit;
|
||||
|
||||
//cache-owner or log-owner
|
||||
// deleted allowed by cache-owner or log-owner
|
||||
if (($log_record['log_user_id'] == $usr['userid']) || ($log_record['cache_owner_id'] == $usr['userid']))
|
||||
{
|
||||
//Daten lesen
|
||||
$commit = isset($_REQUEST['commit']) ? $_REQUEST['commit'] : 0;
|
||||
|
||||
//we are the logger
|
||||
if ($log_record['log_user_id'] == $usr['userid'])
|
||||
$ownlog = ($log_record['log_user_id'] == $usr['userid']);
|
||||
if ($ownlog)
|
||||
{
|
||||
// we are the log-owner
|
||||
$tplname = 'removelog_logowner';
|
||||
}
|
||||
else
|
||||
{
|
||||
// we are the cache-owner
|
||||
$tplname = 'removelog_cacheowner';
|
||||
|
||||
if ($commit == 1)
|
||||
{
|
||||
//send email to logowner schicken
|
||||
//send email to logowner
|
||||
$email_content = read_file($stylepath . '/email/removed_log.email');
|
||||
|
||||
$message = isset($_POST['logowner_message']) ? $_POST['logowner_message'] : '';
|
||||
@ -120,10 +121,54 @@
|
||||
|
||||
if ($commit == 1)
|
||||
{
|
||||
// move to archive
|
||||
sql("INSERT IGNORE INTO `cache_logs_archived` SELECT *, NOW() AS `deletion_date`, '&2' AS `deleted_by`, 0 AS `restored_by` FROM `cache_logs` WHERE `cache_logs`.`id`='&1' LIMIT 1", $log_id, $usr['userid']);
|
||||
// remove log pictures
|
||||
// see also picture.class.php: delete()
|
||||
require('lib2/const.inc.php');
|
||||
require('config2/settings.inc.php');
|
||||
|
||||
// TO DO: remove log pictures
|
||||
$rs = sql("SELECT `id`, `url` FROM `pictures`
|
||||
WHERE `object_type`=1 AND `object_id`='&1'",
|
||||
$log_id);
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
if (!$ownlog)
|
||||
sql("SET @archive_picop=TRUE");
|
||||
else
|
||||
sql("SET @archive_picop=FALSE");
|
||||
|
||||
sql("DELETE FROM `pictures` WHERE `id`='&1'", $r['id']);
|
||||
$archived = (sqlValue("SELECT `id` FROM `pictures_modified` WHERE `id`=" . $r['id'], 0) > 0);
|
||||
$fna = mb_split('\\/', $r['url']);
|
||||
$filename = end($fna);
|
||||
if (mb_substr($opt['logic']['pictures']['dir'], -1, 1) != '/')
|
||||
$path = $opt['logic']['pictures']['dir'] . "/";
|
||||
else
|
||||
$path = $opt['logic']['pictures']['dir'];
|
||||
|
||||
if ($archived)
|
||||
@rename($path . $filename, $path . "deleted/" . $filename);
|
||||
else
|
||||
@unlink($path . $filename);
|
||||
|
||||
$path .= mb_strtoupper(mb_substr($filename, 0, 1)) . '/' .
|
||||
mb_strtoupper(mb_substr($filename, 1, 1)) . '/';
|
||||
@unlink($path . $filename); // Thumb
|
||||
|
||||
/* lib2 code would be ...
|
||||
$rs = sql("SELECT `id` FROM `pictures` WHERE `object_type`=1 AND `object_id`='&1'", $log_id);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$pic = new picture($rs['id']);
|
||||
$pic->delete();
|
||||
}
|
||||
sql_free_result($rs);
|
||||
*/
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// move to archive, even if own log (uuids are used for OKAPI replication)
|
||||
sql("INSERT IGNORE INTO `cache_logs_archived` SELECT *, NOW() AS `deletion_date`, '&2' AS `deleted_by`, 0 AS `restored_by` FROM `cache_logs` WHERE `cache_logs`.`id`='&1' LIMIT 1", $log_id, $usr['userid']);
|
||||
|
||||
// remove log entry
|
||||
sql("DELETE FROM `cache_logs` WHERE `cache_logs`.`id`='&1' LIMIT 1", $log_id);
|
||||
|
969
htdocs/restorecaches.php
Normal file
969
htdocs/restorecaches.php
Normal file
@ -0,0 +1,969 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* For license information see doc/license.txt
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
*
|
||||
* TODO:
|
||||
* - limit / clean up archive
|
||||
* - do not archive anything with is not from our node
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
The following tables are monitored. On changes the OLD data is recorded
|
||||
(except for cache_coordinates and cache_countries, where the NEW data is recorded
|
||||
for historical reasons; I = on insert, U = on update, D = on delete;
|
||||
further explanations below:
|
||||
recording limited # max.
|
||||
data table archive tables ops recorded by date per cache one p.d.
|
||||
---------- -------------- --- ----------- ---------- -------- --------
|
||||
- caches cache_coordinates IU trigger datetime yes no
|
||||
- cache_countries IU trigger datetime yes no
|
||||
c caches_modified U trigger date yes yes
|
||||
c cache_attributes cache_attr._modified I D trigger date yes yes
|
||||
c cache_desc cache_desc_modified IUD trigger date yes yes
|
||||
x cache_logs cache_logs_archived D removelog datetime no no
|
||||
x cache_logs_restored I* here datetime no no
|
||||
pictures pictures_modified IUD trigger datetime no no
|
||||
|
||||
* only insertions on restore
|
||||
|
||||
(Additional waypoints in table 'coordinates' are currently not monitored. Archiving
|
||||
and restoring waypoints would be as complex as log entries and is not important at
|
||||
vandalism-restore.)
|
||||
|
||||
The whole mechanism heavily relies on autoincrement IDs being unique on one system
|
||||
and NEVER be reused after record deletion. DON'T EVEN THINK ABOUT TRUNCATING AND
|
||||
RENUMBERING ANY OF THE ABOVE 'DATA TABLES' UNDER ANY CIRCUMSTANCES! Use bigint IDs
|
||||
if you worry about how to store your 3 billion logs.
|
||||
|
||||
Special fields used for recovery are:
|
||||
- date_modified in all tables except for logs.deletion_date and coords/countries.date_created:
|
||||
the date when the change took place and was recorded
|
||||
- deleted_by in cache_logs_archived: thee user_id who deleted the data
|
||||
(to determine if it can be vandalism by cache owner);
|
||||
- restored_by in all tables except for cache_logs_*: the restoring admin's user id (or 0)
|
||||
- operation in pictures_modified: I/U/D for a recorded insert/delete/update
|
||||
- was_set in attributes_modified: 1 if the attribute was set before the change
|
||||
- original_id in cache_logs_restored and pictures_modified: the original id of restored
|
||||
objects, needed to maintain archive integrity
|
||||
|
||||
Insertion of a new record is flagged by:
|
||||
- caches_attributes_modified: was_set = 0
|
||||
- cache_desc_modified: desc = null
|
||||
- pictures_modified: operation = 'I'
|
||||
- cache_logs_restored: presence of data record (only for restored logs)
|
||||
|
||||
uuids are not recorded (except for cache_logs_archived, which is used elsewhere).
|
||||
Restored records are just copies of the old records, not the old records themselves,
|
||||
so they receive new uuids!
|
||||
The old records stay untouched and deleted in the archives for further reference!
|
||||
|
||||
To save log space, the following is NOT recorded:
|
||||
- changes on any data which
|
||||
- need not to be restored (e.g. cache status),
|
||||
- is recreated on restore (e.g. uuids) or
|
||||
- can be restored by other means (e.g. statistics, thumbnails)
|
||||
- additional changes on the same dataset on the same day for caches_modified,
|
||||
cache_desc_modified and cache_attributes_modified. They are blocked by unique
|
||||
indexes which include the date_modified (no time there!).
|
||||
- operations on the same day when the cache was created
|
||||
- operations on own logs, including pictures: own logs are excempt from vandalism-restore
|
||||
- cache attribs, desc and picture changes on the same day when the record was created
|
||||
|
||||
On coordinates and countries every change is recorded for XML interface reasons.
|
||||
On logs and pictures, every change must be recorded, because recognizing multiple restores
|
||||
of the same record would not be feasible.
|
||||
|
||||
On or after restore, the following is automatically fixed:
|
||||
- caches.desc_languages und .default_desclang
|
||||
- by cache_desc triggers
|
||||
- cache_location - by high-frequency cache_location cronjob (per last_modified)
|
||||
- cache_npa_areas - by cache_npa_areas cronjob (per modify-trigger -> need_npa_recalc)
|
||||
- stat_caches - by cache_logs triggers
|
||||
- stat_cache_logs - by cache_logs triggers
|
||||
- cache_logs.picture - by picture triggers
|
||||
- pic thumbnails - by thumbs.php (per thumb_last_generated default value)
|
||||
|
||||
There is no special treatment of changes by restore operations, so they are recorded
|
||||
and revertible, too, if not done on the same day as the vandalism.
|
||||
|
||||
The table listing_restored keeps track of the admins who and when restored listings.
|
||||
|
||||
Code updates:
|
||||
When adding fields to caches, cache_attributes, cache_desc, cache_logs or pictures
|
||||
which are not filled automatically by triggers or cronjobs, those fields must be added
|
||||
to the archive-and-restore mechanism, i.e.
|
||||
|
||||
- to the corresponding lib2/logic classes (currently used only for logs and pics,
|
||||
but anyway ...)
|
||||
- to maintain.php (archiving triggers; use INSERT IGNORE for all recording)
|
||||
- to restorecaches.php (functions get_archive_data and restore_caches),
|
||||
- to the *_modified tables and
|
||||
- eventually to restorecaches.tpl (step 4).
|
||||
|
||||
While the restore mechanism itself is robust against database extensions and will not
|
||||
crash when fields are added, the archives would grow incomplete and so would be the
|
||||
restored listings. Also, CC-ND license at OC.de requires listings to be published
|
||||
unchanged, so all-or-nothing-restore per listing is desireable.
|
||||
|
||||
When adding new TABLES for new listing-related data which can be vandalized, decide if -
|
||||
preferrably - max. one recorded change per day is (a) sufficient or (b) not. It is
|
||||
sufficient if the number of records inserted for one cache is limited by some property
|
||||
(like attribute types oder languages). It is insufficient if there can be an arbitrary
|
||||
number of records (like logs and pictures).
|
||||
for (a)
|
||||
- define date_modified field as 'date'
|
||||
- define an unique index on parent id, date_modified and the limiting property/ies
|
||||
(e.g. see caches_attributes_modified 'cache_id' index)
|
||||
- use INSERT ... ON DUPLICATE UPDATE ... on restore
|
||||
for (b)
|
||||
- define date_modified field as 'datetime'
|
||||
- truncate date_modified in get_archive_data() to the date, i.e. left 10 chars
|
||||
- order ascending by (full) date_modified in get_archive_data()
|
||||
- define an 'original_id' field and implement a mechanism like get_current_picid()
|
||||
to take care of changing ids and original_ids
|
||||
- use the corresponding parent table's mechanism for parent ids when restoring
|
||||
deleted records, if the parent table is also an arbitrary-number table
|
||||
(see call to get_current_logid() when restoring deleted pictures)
|
||||
- for index definitions see e.g. cache_logs_restored
|
||||
|
||||
If you can't handle these requirements, don't add the new fields/tables.
|
||||
|
||||
*/
|
||||
|
||||
require('./lib2/web.inc.php');
|
||||
require_once('./lib2/logic/labels.inc.php');
|
||||
require_once('./lib2/logic/cache.class.php');
|
||||
require_once('./lib2/logic/cachelog.class.php');
|
||||
require_once('./lib2/logic/coordinate.class.php');
|
||||
require_once('./lib2/logic/picture.class.php');
|
||||
|
||||
$tpl->name = 'restorecaches';
|
||||
$tpl->menuitem = MNU_ADMIN_RESTORE;
|
||||
$tpl->assign('error','');
|
||||
$tpl->assign('step',0);
|
||||
|
||||
$login->verify();
|
||||
if ($login->userid == 0)
|
||||
$tpl->redirect_login();
|
||||
|
||||
if (!$login->hasAdminPriv(ADMIN_RESTORE))
|
||||
$tpl->error(ERROR_NO_ACCESS);
|
||||
|
||||
// params
|
||||
if (isset($_REQUEST['finduser']) && isset($_REQUEST['username']))
|
||||
{
|
||||
// STEP 2: verify username
|
||||
|
||||
$tpl->assign('step',1);
|
||||
$tpl->assign('username', $_REQUEST['username']);
|
||||
$rs = sql("SELECT `user_id`, `username`, `is_active_flag` FROM `user` WHERE `username`='&1'", $_REQUEST['username']);
|
||||
$r = sql_fetch_assoc($rs);
|
||||
sql_free_result($rs);
|
||||
if ($r == false)
|
||||
{
|
||||
$tpl->assign('error', 'userunknown');
|
||||
$tpl->display();
|
||||
}
|
||||
$tpl->assign('username', $r['username']);
|
||||
|
||||
// get cache set for this user
|
||||
$user_id = $r['user_id'];
|
||||
$rs = sql("SELECT `cache_id`,`wp_oc`,`name`,`latitude`,`longitude`,
|
||||
LEFT(`listing_last_modified`,10) AS `last_modified`,
|
||||
(SELECT COUNT(*) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=`caches`.`cache_id`) AS `logs`
|
||||
FROM `caches`
|
||||
WHERE `user_id`='&1'", $user_id);
|
||||
$caches = array();
|
||||
while ($rCache = sql_fetch_assoc($rs))
|
||||
{
|
||||
$coord = new coordinate($rCache['latitude'], $rCache['longitude']);
|
||||
$rCache['coordinates'] = $coord->getDecimalMinutes();
|
||||
$rCache['data'] = get_archive_data(array($rCache['cache_id']));
|
||||
if (count($rCache['data']))
|
||||
{
|
||||
$keys = array_keys($rCache['data']);
|
||||
$rCache['date'] = $keys[0];
|
||||
}
|
||||
$caches[] = $rCache;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
if (count($caches) == 0)
|
||||
$tpl->assign('error','nocaches');
|
||||
else
|
||||
{
|
||||
// STEP 3: select caches to restore
|
||||
$tpl->assign('step', 3);
|
||||
$tpl->assign('aCaches',$caches);
|
||||
$tpl->assign('disabled', $r['is_active_flag'] == 0);
|
||||
}
|
||||
}
|
||||
else if (isset($_REQUEST['username']) && isset($_REQUEST['caches']))
|
||||
{
|
||||
// STEP 4: select date
|
||||
|
||||
$tpl->assign('step',4);
|
||||
$tpl->assign('username',$_REQUEST['username']);
|
||||
$tpl->assign('disabled', sql_value("SELECT NOT `is_active_flag` FROM `user` WHERE `username`='&1'", 0, $_REQUEST['username']));
|
||||
|
||||
$cacheids = array();
|
||||
foreach ($_REQUEST as $param => $value)
|
||||
if (substr($param,0,6) == 'cache_')
|
||||
$cacheids[] = substr($param,6);
|
||||
|
||||
if (count($cacheids) == 0)
|
||||
{
|
||||
$tpl->assign('error','nocaches');
|
||||
$tpl->display();
|
||||
}
|
||||
|
||||
$dates = get_archive_data($cacheids);
|
||||
if (count($dates) == 0)
|
||||
{
|
||||
$tpl->assign('error','nodata');
|
||||
$tpl->display();
|
||||
}
|
||||
|
||||
$today = sql_value("SELECT LEFT(NOW(),10)",0);
|
||||
$today_usermod = false;
|
||||
if (isset($dates[$today]))
|
||||
foreach ($dates[$today] as $cache_changed)
|
||||
if (strpos($cache_changed, "userchange"))
|
||||
$today_usermod = true;
|
||||
|
||||
$tpl->assign('cachelist',urlencode(implode(',',$cacheids)));
|
||||
$tpl->assign('dates',$dates);
|
||||
$tpl->assign('today', $today_usermod);
|
||||
$tpl->assign('rootadmin',$opt['page']['develsystem'] && $login->hasAdminPriv(ADMIN_ROOT));
|
||||
$tpl->display();
|
||||
}
|
||||
else if (isset($_REQUEST['username']) && ($_REQUEST['cacheids']) && isset($_REQUEST['doit']))
|
||||
{
|
||||
// STEP 5: restore data
|
||||
|
||||
$tpl->assign('step',5);
|
||||
$tpl->assign('username',$_REQUEST['username']);
|
||||
$tpl->assign('disabled', sql_value("SELECT NOT `is_active_flag` FROM `user` WHERE `username`='&1'", 0, $_REQUEST['username']));
|
||||
|
||||
$simulate = isset($_REQUEST['simulate']) && $_REQUEST['simulate'];
|
||||
$tpl->assign('simulate', $simulate);
|
||||
|
||||
$restore_date = "";
|
||||
$restore_options = array();
|
||||
foreach ($_REQUEST as $param => $value)
|
||||
if (substr($param,0,5) == "date_")
|
||||
$restore_date = substr($param,5);
|
||||
else if (substr($param,0,8) == "restore_")
|
||||
$restore_options[] = substr($param,8);
|
||||
|
||||
if ($restore_date == "")
|
||||
{
|
||||
$tpl->assign('error','nodate');
|
||||
$tpl->display();
|
||||
}
|
||||
else if (count($restore_options) == 0)
|
||||
{
|
||||
$tpl->assign('error','nochecks');
|
||||
$tpl->display();
|
||||
}
|
||||
if ((!isset($_REQUEST['sure']) || !$_REQUEST['sure']) && !$simulate)
|
||||
{
|
||||
$tpl->assign('error','notsure');
|
||||
$tpl->display();
|
||||
}
|
||||
|
||||
$cacheids = explode(",", urldecode($_REQUEST['cacheids']));
|
||||
$tpl->assign('restored',
|
||||
restore_listings($cacheids, $restore_date, $restore_options, $simulate));
|
||||
$tpl->assign('date', $restore_date);
|
||||
}
|
||||
else
|
||||
{
|
||||
// STEP 1: ask for username
|
||||
|
||||
$tpl->assign('step',1);
|
||||
}
|
||||
|
||||
$tpl->display();
|
||||
|
||||
|
||||
// get readable list of recorded data changes for a list of cache(id)s
|
||||
|
||||
function get_archive_data($caches)
|
||||
{
|
||||
$cachelist = "(" . implode(",",$caches) . ")";
|
||||
$data = array();
|
||||
$admins = array();
|
||||
|
||||
// make waypoint index
|
||||
$rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN " . $cachelist);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
$wp_oc[$r['cache_id']] = $r['wp_oc'];
|
||||
sql_free_result($rs);
|
||||
|
||||
// cache coordinates
|
||||
$rs = sql("SELECT `cache_id`, LEFT(`date_created`,10) AS `date_modified`, `longitude`, `latitude`, `restored_by`
|
||||
FROM `cache_coordinates`
|
||||
WHERE `cache_id` IN " . $cachelist . "
|
||||
ORDER BY `date_created` ASC");
|
||||
// order is relevant, because multiple changes per day possible
|
||||
$lastcoord = array();
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$coord = new coordinate($r['latitude'], $r['longitude']);
|
||||
$coord = $coord->getDecimalMinutes();
|
||||
$coord = $coord['lat'] . " " . $coord['lon'];
|
||||
if (isset($lastcoord[$r['cache_id']]) && $coord != $lastcoord[$r['cache_id']])
|
||||
// the database contains lots of old coord records with unchanged coords, wtf?
|
||||
append_data($data, $admins, $wp_oc, $r, "coord", $lastcoord[$r['cache_id']], $coord);
|
||||
$lastcoord[$r['cache_id']] = $coord;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// cache country
|
||||
$rs = sql("SELECT `cache_id`, LEFT(`date_created`,10) AS `date_modified`, `country`, `restored_by`
|
||||
FROM `cache_countries`
|
||||
WHERE `cache_id` IN " . $cachelist . "
|
||||
ORDER BY `date_created` ASC");
|
||||
// order is relevant, because multiple changes per day possible
|
||||
$lastcountry = array();
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
if (isset($lastcountry[$r['cache_id']]) && $r['country'] != $lastcountry[$r['cache_id']])
|
||||
// the database contains some old country records with unchanged coords, wtf?
|
||||
append_data($data, $admins, $wp_oc, $r, "country", $lastcountry[$r['cache_id']], $r['country']);
|
||||
$lastcountry[$r['cache_id']] = $r['country'];
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// all other cache data
|
||||
// first the current data ...
|
||||
$nextcd = array();
|
||||
$rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN " . $cachelist);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$nextcd[$r['wp_oc']] = $r;
|
||||
$user_id = $r['user_id']; // is used later for logs
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// .. and then the changes
|
||||
$rs = sql("SELECT * FROM `caches_modified` WHERE `cache_id` IN " . $cachelist . "
|
||||
ORDER BY `date_modified` DESC");
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$wp = $wp_oc[$r['cache_id']];
|
||||
if ($r['name'] != $nextcd[$wp]['name'])
|
||||
append_data($data, $admins, $wp_oc, $r, "name", $r['name'], $nextcd[$wp]['name']);
|
||||
if ($r['type'] != $nextcd[$wp]['type'])
|
||||
append_data($data, $admins, $wp_oc, $r, "type", labels::getLabelValue('cache_type',$r['type']), labels::getLabelValue('cache_type',$nextcd[$wp]['type']));
|
||||
if ($r['size'] != $nextcd[$wp]['size'])
|
||||
append_data($data, $admins, $wp_oc, $r, "size", labels::getLabelValue('cache_size',$r['size']), labels::getLabelValue('cache_size',$nextcd[$wp]['size']));
|
||||
if ($r['difficulty'] != $nextcd[$wp]['difficulty'])
|
||||
append_data($data, $admins, $wp_oc, $r, "D", $r['difficulty']/2, $nextcd[$wp]['difficulty']/2);
|
||||
if ($r['terrain'] != $nextcd[$wp]['terrain'])
|
||||
append_data($data, $admins, $wp_oc, $r, "T", $r['terrain']/2, $nextcd[$wp]['terrain']/2);
|
||||
if ($r['search_time'] != $nextcd[$wp]['search_time'])
|
||||
append_data($data, $admins, $wp_oc, $r, "time", $r['search_time'] . ' h', $nextcd[$wp]['search_time'] . ' h');
|
||||
if ($r['way_length'] != $nextcd[$wp]['way_length'])
|
||||
append_data($data, $admins, $wp_oc, $r, "way", $r['way_length'] . ' km', $nextcd[$wp]['way_length'] . ' km');
|
||||
if ($r['wp_gc'] != $nextcd[$wp]['wp_gc'])
|
||||
append_data($data, $admins, $wp_oc, $r, "GC ", format_wp($r['wp_gc']), format_wp($nextcd[$wp]['wp_gc']));
|
||||
if ($r['wp_nc'] != $nextcd[$wp]['wp_nc'])
|
||||
append_data($data, $admins, $wp_oc, $r, "GC ", format_wp($r['wp_nc']), format_wp($nextcd[$wp]['wp_nc']));
|
||||
if ($r['date_hidden'] != $nextcd[$wp]['date_hidden'])
|
||||
append_data($data, $admins, $wp_oc, $r, "hidden", $r['date_hidden'], $nextcd[$wp]['date_hidden']);
|
||||
|
||||
$nextcd[$wp] = $r;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// attributes
|
||||
$rs = sql("SELECT * FROM `caches_attributes_modified`
|
||||
WHERE `cache_id` IN " . $cachelist . " /* OConly attrib is shown, but not restorable */
|
||||
ORDER BY `date_modified` ASC"); // order doesn't matter as long it is date only
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
append_data($data, $admins, $wp_oc, $r, "attrib", ($r['was_set'] ? "-" : "+") . labels::getLabelValue('cache_attrib',$r['attrib_id']), "");
|
||||
sql_free_result($rs);
|
||||
|
||||
// descriptions
|
||||
// first the current data ...
|
||||
$nextdesc = array();
|
||||
$rs = sql("SELECT `cache_id`, `language`, LENGTH(`desc`) AS `dl`, LENGTH(`hint`) AS `hl`,
|
||||
LENGTH(`short_desc`) AS `sdl`
|
||||
FROM `cache_desc` WHERE `cache_id` IN ". $cachelist);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
if (!isset($nextdesc[$r['cache_id']]))
|
||||
$nextdesc[$r['cache_id']] = array();
|
||||
$nextdesc[$r['cache_id']][$r['language']] = $r;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// ... and then the changes
|
||||
$rs = sql("SELECT `cache_id`, `date_modified`, `language`,
|
||||
LENGTH(`desc`) AS `dl`, LENGTH(`hint`) AS `hl`, LENGTH(`short_desc`) AS `sdl`,
|
||||
`restored_by`
|
||||
FROM `cache_desc_modified` WHERE `cache_id` IN ". $cachelist . "
|
||||
ORDER BY `date_modified` DESC");
|
||||
// order doesn't matter as long only one change per day is recorded
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$wp = $wp_oc[$r['cache_id']];
|
||||
if (!isset($nextdesc[$r['cache_id']]) || !isset($nextdesc[$r['cache_id']][$r['language']]))
|
||||
$next = array('dl' => 0, 'hl' => 0, 'sdl' => 0);
|
||||
else
|
||||
$next = $nextdesc[$r['cache_id']][$r['language']];
|
||||
|
||||
if ($r['dl']+0 != $next['dl']+0)
|
||||
append_data($data, $admins, $wp_oc, $r, "desc(" . $r['language'] . ")", $r['dl']+0, $next['dl']+0 . " bytes");
|
||||
if ($r['hl']+0 != $next['hl']+0)
|
||||
append_data($data, $admins, $wp_oc, $r, "hint(" . $r['language'] . ")", $r['hl']+0, $next['hl']+0 . " bytes");
|
||||
if ($r['sdl']+0 != $next['sdl']+0)
|
||||
append_data($data, $admins, $wp_oc, $r, "shortdesc(" . $r['language'] . ")", $r['sdl']+0, $next['sdl']+0 . " bytes");
|
||||
|
||||
$nextdesc[$r['cache_id']][$r['language']] = $r;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// logs
|
||||
$rs = sql("SELECT `op`, LEFT(`date_modified`,10) AS `date_modified`, `cache_id`, `logs`.`user_id`, `type`, `date`, `restored_by`, `username` FROM
|
||||
(SELECT 1 as `op`, `deletion_date` AS `date_modified`, `cache_id`, `user_id`, `type`, `date`, `restored_by`
|
||||
FROM `cache_logs_archived`
|
||||
WHERE `cache_id` IN ". $cachelist . "AND `deleted_by`='&1' AND `user_id`<>'&1'
|
||||
UNION
|
||||
SELECT 2 as `op`, `date_modified`, `cache_id`,
|
||||
(SELECT `user_id` FROM `cache_logs_archived` WHERE `id`=`original_id`),
|
||||
(SELECT `type` FROM `cache_logs_archived` WHERE `id`=`original_id`),
|
||||
(SELECT `date` FROM `cache_logs_archived` WHERE `id`=`original_id`),
|
||||
`restored_by`
|
||||
FROM `cache_logs_restored`
|
||||
WHERE `cache_id` IN ". $cachelist . ") `logs`
|
||||
INNER JOIN `user` ON `user`.`user_id`=`logs`.`user_id`
|
||||
ORDER BY `logs`.`date_modified` ASC",
|
||||
// order may not be exact when redoing reverts, because delete and insert
|
||||
// operations then are so quick that dates in both tables are the same
|
||||
$user_id);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
append_data($data, $admins, $wp_oc, $r,
|
||||
$r["op"] == 1 ? "dellog" : "restorelog",
|
||||
"<a href='viewprofile.php?userid=" . $r['user_id'] . "' target='_blank'>" . $r['username'] . "</a>/" . $r['date'], "");
|
||||
sql_free_result($rs);
|
||||
|
||||
// pictures
|
||||
|
||||
/* For sake of simplification, we
|
||||
* - have stored the name of inserted pictures in pictures_modified
|
||||
* - give no detailed information on picture property changes. This will be very
|
||||
* rare in case of vandalism ...
|
||||
*/
|
||||
|
||||
$piccacheid = "IF(`object_type`=2, `object_id`, IF(`object_type`=1, IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)), 0))";
|
||||
$rs = sql("SELECT *, " . $piccacheid . "AS `cache_id` FROM `pictures_modified`
|
||||
WHERE " . $piccacheid . " IN " . $cachelist . "
|
||||
ORDER BY `date_modified` ASC"); // order is relevant for the case of restore-reverts
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$r['date_modified'] = substr($r['date_modified'],0,10);
|
||||
switch ($r['operation'])
|
||||
{
|
||||
case 'I': $picchange = "add"; break;
|
||||
case 'U': $picchange = "mod"; break;
|
||||
case 'D': $picchange = "del"; break;
|
||||
}
|
||||
switch ($r['object_type'])
|
||||
{
|
||||
case 1: $picchange .= "-log"; break;
|
||||
case 2: $picchange .= "-cache"; break;
|
||||
}
|
||||
append_data($data, $admins, $wp_oc, $r, $picchange . "pic", $r['title'], "");
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// admins
|
||||
foreach ($admins as $adate => $adata)
|
||||
foreach ($adata as $awp => $alist)
|
||||
$data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> " .
|
||||
implode(",", $alist);
|
||||
|
||||
// done
|
||||
ksort($data);
|
||||
return array_reverse($data,true);
|
||||
}
|
||||
|
||||
|
||||
function format_wp($wp)
|
||||
{
|
||||
if ($wp == "")
|
||||
return "(leer)";
|
||||
else
|
||||
return $wp;
|
||||
}
|
||||
|
||||
|
||||
function append_data(&$data, &$admins, $wp_oc, $r, $field, $oldvalue, $newvalue)
|
||||
{
|
||||
if (!isset($r['date_modified']))
|
||||
die("internal error: date_modified not set for $field");
|
||||
$mdate = $r['date_modified'];
|
||||
$wp = $wp_oc[$r['cache_id']];
|
||||
$byadmin = ($r['restored_by'] > 0);
|
||||
|
||||
if (!isset($data[$mdate])) $data[$mdate] = array();
|
||||
|
||||
$text = "<strong";
|
||||
if ($byadmin) $text .= " class='adminrestore'";
|
||||
else $text .= " class='userchange'";
|
||||
$text .= ">$field</strong>: $oldvalue" . ($newvalue != "" ? " → $newvalue" : "");
|
||||
if (isset($data[$mdate][$wp]))
|
||||
$data[$mdate][$wp] .= ", " . $text;
|
||||
else
|
||||
$data[$mdate][$wp] = $text;
|
||||
|
||||
if ($byadmin)
|
||||
{
|
||||
if (!isset($admins[$mdate]))
|
||||
$admins[$mdate] = array();
|
||||
if (!isset($admins[$mdate][$wp]))
|
||||
$admins[$mdate][$wp] = array();
|
||||
$admins[$mdate][$wp][$r['restored_by'] + 0]
|
||||
= "<a href='viewprofile.php?userid=" . $r['restored_by'] . "' target='_blank'>" .
|
||||
sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']) .
|
||||
"</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function restore_listings($cacheids, $rdate, $roptions, $simulate)
|
||||
{
|
||||
global $opt, $login;
|
||||
|
||||
sql("SET @restoredby='&1'", $login->userid); // is evaluated by trigger functions
|
||||
sql_slave("SET @restoredby='&1'", $login->userid);
|
||||
|
||||
$restored = array();
|
||||
|
||||
foreach ($cacheids as $cacheid)
|
||||
{
|
||||
$modified = false;
|
||||
|
||||
// get current cache data
|
||||
$rs = sql("SELECT * FROM `caches` WHERE `cache_id`='&1'", $cacheid);
|
||||
$cache = sql_fetch_assoc($rs);
|
||||
sql_free_result($rs);
|
||||
$wp = $cache['wp_oc'];
|
||||
$user_id = $cache['user_id'];
|
||||
|
||||
// coordinates
|
||||
if (in_array("coords", $roptions) &&
|
||||
sql_value("SELECT `cache_id` FROM `cache_coordinates`
|
||||
WHERE `cache_id`='&1' AND `date_created`>='&2'",
|
||||
0, $cacheid, $rdate))
|
||||
{
|
||||
$rs = sql("SELECT `latitude`, `longitude` FROM `cache_coordinates`
|
||||
WHERE `cache_id`='&1' AND `date_created` < '&2'
|
||||
ORDER BY `date_created` DESC
|
||||
LIMIT 1",
|
||||
$cacheid, $rdate);
|
||||
if ($r = sql_fetch_assoc($rs)) // should always be true ...
|
||||
{
|
||||
if (!$simulate)
|
||||
sql("UPDATE `caches` SET `latitude`='&1', `longitude`='&2' WHERE `cache_id`='&3'",
|
||||
$r['latitude'], $r['longitude'], $cacheid);
|
||||
|
||||
$restored[$wp]['coords'] = true;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
// country
|
||||
if (in_array("coords",$roptions) &&
|
||||
sql_value("SELECT `cache_id` FROM `cache_countries`
|
||||
WHERE `cache_id`='&1' AND `date_created`>='&2'",
|
||||
0, $cacheid, $rdate))
|
||||
{
|
||||
$rs = sql("SELECT `country` FROM `cache_countries`
|
||||
WHERE `cache_id`='&1' AND `date_created` < '&2'
|
||||
ORDER BY `date_created` DESC
|
||||
LIMIT 1",
|
||||
$cacheid, $rdate);
|
||||
if ($r = sql_fetch_assoc($rs)) // should always be true ...
|
||||
{
|
||||
if (!$simulate)
|
||||
sql("UPDATE `caches` SET `country`='&1' WHERE `cache_id`='&2'",
|
||||
$r['country'], $cacheid);
|
||||
|
||||
$restored[$wp]['country'] = true;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
// other cache data
|
||||
$rs = sql("SELECT * FROM `caches_modified`
|
||||
WHERE `cache_id`='&1' AND `date_modified` >='&2'
|
||||
ORDER BY `date_modified` ASC
|
||||
LIMIT 1",
|
||||
$cacheid, $rdate);
|
||||
|
||||
$fields = array('name' => 'settings',
|
||||
'type' => 'settings',
|
||||
'size' => 'settings',
|
||||
'date_hidden' => 'settings',
|
||||
'difficulty' => 'settings',
|
||||
'terrain' => 'settings',
|
||||
'search_time' => 'settings',
|
||||
'way_length' => 'settings',
|
||||
'wp_gc' => 'waypoints',
|
||||
'wp_nc' => 'waypoints');
|
||||
|
||||
if ($r = sql_fetch_assoc($rs)) // can be false
|
||||
{
|
||||
$setfields = "";
|
||||
foreach ($fields as $field => $ropt)
|
||||
if (in_array($ropt,$roptions) && $r[$field] != $cache[$field])
|
||||
{
|
||||
if ($setfields != "")
|
||||
$setfields .= ",";
|
||||
$setfields .= "`$field`='" . sql_escape($r[$field]) . "'";
|
||||
$restored[$wp][$field] = true;
|
||||
}
|
||||
if ($setfields !="" && !$simulate)
|
||||
sql("UPDATE `caches` SET " . $setfields . " WHERE `cache_id`='&1'", $cacheid);
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
// attributes
|
||||
if (in_array('settings',$roptions))
|
||||
{
|
||||
$rs = sql("SELECT * FROM `caches_attributes_modified`
|
||||
WHERE `cache_id`='&1' AND `date_modified`>='&2' AND `attrib_id` != 6 /* OConly */
|
||||
ORDER BY `date_modified` DESC",
|
||||
$cacheid, $rdate);
|
||||
|
||||
// revert all attribute changes in reverse order.
|
||||
// recording limit of one change per attribute, cache and day ensures that no exponentially
|
||||
// growing list of recording entries can emerge from multiple reverts.
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
if (!$simulate)
|
||||
{
|
||||
if ($r['was_set'])
|
||||
sql("INSERT IGNORE INTO `caches_attributes` (`cache_id`,`attrib_id`)
|
||||
VALUES ('&1','&2')", $cacheid, $r['attrib_id']);
|
||||
else
|
||||
sql("DELETE FROM `caches_attributes` WHERE `cache_id`='&1' AND `attrib_id`='&2'",
|
||||
$cacheid, $r['attrib_id']);
|
||||
}
|
||||
$restored[$wp]['attributes'] = true;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
// descriptions
|
||||
if (in_array('desc',$roptions))
|
||||
{
|
||||
$rs = sql("SELECT * FROM `cache_desc_modified`
|
||||
WHERE `cache_id`='&1' AND `date_modified`>='&2'
|
||||
ORDER BY `date_modified` DESC",
|
||||
$cacheid, $rdate);
|
||||
|
||||
// revert all desc changes in reverse order.
|
||||
// recording limit of one change per language, cache and day ensures that no exponentially
|
||||
// growing list of recording entries can emerge from restore-reverts.
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
if (!$simulate)
|
||||
{
|
||||
if ($r['desc'] == null) // was newly created -> delete
|
||||
sql("DELETE FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'",
|
||||
$cacheid, $r['language']);
|
||||
else
|
||||
// id, uuid, date_created and last_modified are set automatically
|
||||
sql("INSERT INTO `cache_desc`
|
||||
(`node`, `cache_id`, `language`, `desc`, `desc_html`, `desc_htmledit`, `hint`, `short_desc`)
|
||||
VALUES ('&1','&2','&3','&4','&5','&6','&7','&8')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`desc`='&4', `desc_html`='&5', `desc_htmledit`='&6', `hint`='&7', `short_desc`='&8'",
|
||||
$opt['logic']['node']['id'], $cacheid,
|
||||
$r['language'], $r['desc'], $r['desc_html'], $r['desc_htmledit'], $r['hint'], $r['short_desc']);
|
||||
}
|
||||
|
||||
$restored[$wp]['description(s)'] = true;
|
||||
}
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
// logs
|
||||
// ... before pictures, so that restored logpics have a parent
|
||||
if (in_array('logs',$roptions))
|
||||
{
|
||||
$rs = sql("SELECT * FROM (
|
||||
SELECT `id`, -1 AS `node`, `date_modified`, `cache_id`, 0 AS `user_id`, 0 AS `type`, '0' as `date`, '' AS `text`, 0 AS `text_html`, 0 AS `text_htmledit`, `original_id` FROM `cache_logs_restored`
|
||||
WHERE `cache_id`='&1' AND `date_modified` >= '&2'
|
||||
UNION SELECT `id`, `node`, `deletion_date`, `cache_id`, `user_id`, `type`, `date`, `text`, `text_html`, `text_htmledit`, 0 AS `original_id` FROM `cache_logs_archived`
|
||||
WHERE `cache_id`='&1' AND `deletion_date` >= '&2' AND `deleted_by`='&3' AND `user_id` != '&3'
|
||||
) `logs`
|
||||
ORDER BY `date_modified` ASC",
|
||||
$cacheid, $rdate, $user_id);
|
||||
|
||||
// We start with the oldest entry and will touch each log ony once:
|
||||
// After restoring its state, it is added to $logs_processed (by its last known id),
|
||||
// and all further operations on the same log are ignored. This prevents unnecessary
|
||||
// operations and flooding pictures_modified on restore-reverts.
|
||||
$logs_processed = array();
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$error = "";
|
||||
$logs_restored = false;
|
||||
|
||||
// the log's id may have changed by multiple delete-and-restores
|
||||
$revert_logid = get_current_logid($r['id']);
|
||||
if (!in_array($revert_logid, $logs_processed))
|
||||
{
|
||||
if ($r['node'] == -1)
|
||||
{
|
||||
if (sql_value("SELECT `id` FROM `cache_logs` WHERE `id`='&1'",0,$revert_logid) != 0)
|
||||
// if it was not already deleted by a later restore operation ...
|
||||
{
|
||||
if (!$simulate)
|
||||
{
|
||||
sql("INSERT INTO `cache_logs_archived`
|
||||
SELECT *, NOW(), '&2', '&3' FROM `cache_logs` WHERE `id`='&1'",
|
||||
$revert_logid,
|
||||
$user_id, // original deletor's ID and not restoring admin's ID!
|
||||
$login->userid);
|
||||
sql("DELETE FROM `cache_logs` WHERE `id`='&1'", $revert_logid);
|
||||
}
|
||||
$logs_restored = true;
|
||||
}
|
||||
}
|
||||
else if (sql_value("SELECT `id` FROM `cache_logs` WHERE `id`='&1'",0,$revert_logid) == 0)
|
||||
// if it was not already restored by a later restore operation ...
|
||||
{
|
||||
// id, uuid, date_created and last_modified are set automatically;
|
||||
// picture will be updated automatically on picture-restore
|
||||
$log = new cachelog();
|
||||
$log->setNode($r['node']); // cachelog class currently does not initialize node field
|
||||
$log->setCacheId($r['cache_id']);
|
||||
$log->setUserId($r['user_id']);
|
||||
$log->setType($r['type']);
|
||||
$log->setDate($r['date']);
|
||||
$log->setText($r['text']);
|
||||
$log->setTextHtml($r['text_html']);
|
||||
$log->setTextHtmlEdit($r['text_htmledit']);
|
||||
$log->setOwnerNotified(1);
|
||||
|
||||
if ($simulate)
|
||||
$logs_restored = true;
|
||||
else
|
||||
{
|
||||
if (!$log->save())
|
||||
$error = "restore";
|
||||
else
|
||||
{
|
||||
sql("INSERT IGNORE INTO `cache_logs_restored`
|
||||
(`id`, `date_modified`, `cache_id`, `original_id`, `restored_by`)
|
||||
VALUES ('&1', NOW(), '&2', '&3', '&4')",
|
||||
$log->getLogId(), $log->getCacheId(), $revert_logid, $login->userid);
|
||||
$logs_processed[] = $log->getLogId();
|
||||
|
||||
/* no longer needed after implementing picture deletion in removelog.php
|
||||
|
||||
// log pic deleting is not completely implemented, orphan pictures are [*p]
|
||||
// left over when directly deleting the log. We try to recover them ...
|
||||
sql("UPDATE `pictures` SET `object_id`='&1' WHERE `object_type`=1 AND `object_id`='&2'",
|
||||
$log->getLogId(), $revert_logid);
|
||||
|
||||
// ... and then update the stats:
|
||||
$log->updatePictureStat();
|
||||
*/
|
||||
|
||||
$logs_restored = true;
|
||||
}
|
||||
}
|
||||
} // restore deleted
|
||||
|
||||
$logs_processed[] = $revert_logid;
|
||||
} // not already processed
|
||||
|
||||
if ($error != "")
|
||||
$restored[$wp]['internal error - could not $error log ' + $r['id'] + "/" + $logid];
|
||||
if ($logs_restored)
|
||||
$restored[$wp]['logs'] = true;
|
||||
|
||||
} // while (all relevant log records)
|
||||
sql_free_result($rs);
|
||||
|
||||
} // if logs enabled per roptions
|
||||
|
||||
// pictures
|
||||
if (in_array("desc",$roptions) || in_array("logs",$roptions))
|
||||
{
|
||||
$rs = sql("SELECT * FROM `pictures_modified`
|
||||
WHERE ((`object_type`=2 AND '&2' AND `object_id`='&3') OR
|
||||
(`object_type`=1 AND '&1'
|
||||
AND IFNULL((SELECT `user_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `user_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)) != '&5'
|
||||
/* ^^ ignore changes of own log pics (shouldnt be in pictures_modified, anyway) */
|
||||
AND IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)) = '&3'))
|
||||
AND `date_modified`>='&4'
|
||||
ORDER BY `date_modified` ASC",
|
||||
in_array("logs",$roptions) ? 1 : 0,
|
||||
in_array("desc",$roptions) ? 1 : 0,
|
||||
$cacheid, $rdate, $user_id);
|
||||
|
||||
// We start with the oldest entry and will touch each picture ony once:
|
||||
// After restoring its state, it is added to $pics_processed (by its last known id),
|
||||
// and all further operations on the same pic are ignored. This prevents unnecessary
|
||||
// operations and flooding the _modified table on restore-reverts.
|
||||
$pics_processed = array();
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$pics_restored = false;
|
||||
|
||||
// the picture id may have changed by multiple delete-and-restores
|
||||
$revert_picid = get_current_picid($r['id']);
|
||||
if (!in_array($revert_picid, $pics_processed))
|
||||
{
|
||||
// .. as may have its uuid-based url
|
||||
$revert_url = sql_value("SELECT `url` FROM `pictures_modified` WHERE `id`='&1'",
|
||||
$r['url'], $revert_picid);
|
||||
$error = "";
|
||||
|
||||
switch ($r['operation'])
|
||||
{
|
||||
case 'I':
|
||||
if (sql_value("SELECT `id` FROM `pictures` WHERE `id`='&1'",0,$revert_picid) != 0)
|
||||
{
|
||||
// if it was not already deleted by a later restore operation:
|
||||
// delete added (cache) picture
|
||||
$pic = new picture($revert_picid);
|
||||
if ($simulate)
|
||||
$pics_restored = true;
|
||||
else
|
||||
if ($pic->delete(true))
|
||||
$pics_restored = true;
|
||||
else
|
||||
$error = "delete";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
if (sql_value("SELECT `id` FROM `pictures` WHERE `id`='&1'",0,$revert_picid) != 0)
|
||||
{
|
||||
// if it was not deleted by a later restore operation:
|
||||
// restore modified (cache) picture properties
|
||||
$pic = new picture($revert_picid);
|
||||
$pic->setTitle($r['title']);
|
||||
$pic->setSpoiler($r['spoiler']);
|
||||
$pic->setDisplay($r['display']);
|
||||
// mappreview flag is not restored, because it seems unappropriate to
|
||||
// advertise for the listing of a vandalizing owner
|
||||
|
||||
if ($simulate)
|
||||
$pics_restored = true;
|
||||
else
|
||||
if ($pic->save(true))
|
||||
$pics_restored = true;
|
||||
else
|
||||
$error = "update";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
if (sql_value("SELECT `id` FROM `pictures` WHERE `id`='&1'",0,$revert_picid) == 0)
|
||||
{
|
||||
// if it was not already restored by a later restore operation:
|
||||
// restore deleted picture
|
||||
// id, uuid, date_created and last_modified are set automatically
|
||||
|
||||
// the referring log's id may have changed by [multiple] delete-and-restore
|
||||
if ($r['object_type'] == 1)
|
||||
$r['object_id'] = get_current_logid($r['object_id']);
|
||||
|
||||
// id, uuid, node, date_created, date_modified are automatically set;
|
||||
// url will be set on save;
|
||||
// last_url_check and thumb_last_generated stay at defaults until checked;
|
||||
// thumb_url will be set on thumb creation (old thumb was deleted)
|
||||
$pic = new picture();
|
||||
$pic->setTitle($r['title']);
|
||||
$pic->setObjectId($r['object_id']);
|
||||
$pic->setObjectType($r['object_type']);
|
||||
$pic->setSpoiler($r['spoiler']);
|
||||
$pic->setLocal(1);
|
||||
$pic->setUnknownFormat($r['unknown_format']);
|
||||
$pic->setDisplay($r['display']);
|
||||
// mappreview flag is not restored, because it seems unappropriate to
|
||||
// advertise for the listing of a vandalizing owner
|
||||
|
||||
if ($simulate)
|
||||
$pics_restored = true;
|
||||
else
|
||||
if ($pic->save(true,$revert_picid, $revert_url))
|
||||
{
|
||||
$pics_restored = true;
|
||||
$pics_processed[] = $pic->getPictureId();
|
||||
}
|
||||
else
|
||||
$error = "restore";
|
||||
}
|
||||
break;
|
||||
} // switch
|
||||
|
||||
$pics_processed[] = $revert_picid;
|
||||
} // not already processed
|
||||
|
||||
if ($error != "")
|
||||
$restored[$wp]['internal error - could not $error picture ' . $r['id'] + "/" + $picid] = true;
|
||||
if ($pics_restored)
|
||||
$restored[$wp]['pictures'] = true;
|
||||
} // while (all relevant pic records)
|
||||
|
||||
sql_free_result($rs);
|
||||
|
||||
} // if pics enabled per roptions
|
||||
|
||||
} // foreach cache(id)
|
||||
|
||||
sql("SET @restoredby=0");
|
||||
sql_slave("SET @restoredby=0");
|
||||
|
||||
return $restored;
|
||||
}
|
||||
|
||||
|
||||
// determine new id of a log if it has been deleted and restored [multiple times]
|
||||
function get_current_logid($logid)
|
||||
{
|
||||
do
|
||||
{
|
||||
$new_logid = sql_value("SELECT `id` FROM `cache_logs_restored` WHERE `original_id`='&1'",
|
||||
0, $logid);
|
||||
if ($new_logid != 0)
|
||||
$logid = $new_logid;
|
||||
} while ($new_logid != 0);
|
||||
|
||||
return $logid;
|
||||
}
|
||||
|
||||
|
||||
// determine new id of a picture if it has been deleted and restored [multiple times]
|
||||
function get_current_picid($picid)
|
||||
{
|
||||
do
|
||||
{
|
||||
$new_picid = sql_value("SELECT `id` FROM `pictures_modified` WHERE `original_id`='&1'",
|
||||
0, $picid);
|
||||
if ($new_picid != 0)
|
||||
$picid = $new_picid;
|
||||
} while ($new_picid != 0);
|
||||
|
||||
return $picid;
|
||||
}
|
||||
|
||||
?>
|
@ -54,7 +54,7 @@
|
||||
{/if}
|
||||
{else}
|
||||
<p style="line-height: 1.6em;">{t}Details for report of {/t} <a href="viewcache.php?cacheid={$cacheid}" target="_blank">{$cachename|escape}</a> {t} by {/t} <a href="viewprofile.php?userid={$userid}" target="_blank">{$usernick|escape}</a></p>
|
||||
<p style="line-height: 1.6em;"><b>{t}Last modified:{/t}</b> {$lastmodified|date_format:$opt.format.datelong}</p>
|
||||
<p style="line-height: 1.6em;"><b>{t}Last modified{/t}:</b> {$lastmodified|date_format:$opt.format.datelong}</p>
|
||||
<p style="line-height: 1.6em;"><b>{t}State:{/t}</b> {$status} <b>Admin:</b> {if $adminnick==''}{t}not assigned{/t}{else}{if $otheradmin}<font color="red"><b>{/if}{$adminnick|escape}{if $otheradmin}</b></font>{/if}{/if}</p>
|
||||
<p style="line-height: 1.6em;"><b>{t}Reason:{/t}</b> {$reason|escape|nl2br}</p>
|
||||
<p style="line-height: 1.6em;"><b>{t}Comment:{/t}</b> {$note|escape|nl2br}</p>
|
||||
|
@ -52,7 +52,7 @@
|
||||
<td>{$user.date_created|date_format:$opt.format.date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t}Last modified:{/t}</td>
|
||||
<td>{t}Last modified{/t}:</td>
|
||||
<td>{$user.last_modified|date_format:$opt.format.date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -85,7 +85,9 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t}Logentries:{/t}</td>
|
||||
<td>{$user.logentries|escape}</td>
|
||||
<td>{$user.logentries}
|
||||
{if $user.deleted_logentries > 0} (+ {$user.deleted_logentries} {t}deleted{/t} / {t}archived{/t}){/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t}Total hidden:{/t}</td>
|
||||
@ -95,6 +97,10 @@
|
||||
<td>{t}Active geocaches:{/t}</td>
|
||||
<td>{$user.hidden_active|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t}Cache reports{/t}:</td>
|
||||
<td>{$user.reports|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t}Last known login:{/t}</td>
|
||||
<td>{if $user.last_known_login}{$user.last_known_login|date_format:$opt.format.date}{else}{t}Unknown{/t}{/if}</td>
|
||||
|
210
htdocs/templates2/ocstyle/restorecaches.tpl
Normal file
210
htdocs/templates2/ocstyle/restorecaches.tpl
Normal file
@ -0,0 +1,210 @@
|
||||
{***************************************************************************
|
||||
* You can find the license in the docs directory
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************}
|
||||
{* OCSTYLE *}
|
||||
|
||||
<div class="content2-pagetitle">
|
||||
<img src="resource2/{$opt.template.style}/images/misc/32x32-tools.png" style="align: left; margin-right: 10px;" width="32" height="32" alt="World" />
|
||||
{t}Revert Vandalism{/t}
|
||||
</div>
|
||||
|
||||
{* step 1: select user *}
|
||||
{if $step == 1}
|
||||
<form method="post" action="restorecaches.php">
|
||||
<input type="hidden" name="finduser" value="1" />
|
||||
<br />
|
||||
<p><strong>{t}Username{/t}:</strong>
|
||||
<input type="text" name="username" size="30" /></p>
|
||||
<br />
|
||||
<p><input type="submit" name="find" value="{t}Submit{/t}" class="formbutton" onclick="javascript:submitbutton('find')" /></p>
|
||||
</form>
|
||||
|
||||
{if $error != ""}
|
||||
<br />
|
||||
<p class="errormsg">
|
||||
{if $error=='userunknown'}
|
||||
{t 1=$username}User '%1' is unknown{/t}
|
||||
{elseif $error == "nocaches"}
|
||||
{t 1=$username}%1 has not listed any caches{/t}
|
||||
{/if}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{elseif $step > 1}
|
||||
|
||||
<h2>{t 1=$username}Restore cache listings of %1{/t}</h2>
|
||||
|
||||
{if !$disabled && $step<5}
|
||||
<p class="redtext">{t 1=$username}User '%1' is not disabled. You can view recorded changes, but not revert them.{/t}</p>
|
||||
{/if}
|
||||
|
||||
{if $error != "" && ($error != "notsure" || !$simulate)}
|
||||
<br />
|
||||
<p class="errormsg">
|
||||
{if $error == "nocaches"}
|
||||
{t}You did not select any caches.{/t}
|
||||
{elseif $error == "nodata"}
|
||||
{t}No saved data is available for these caches.{/t}
|
||||
{elseif $error == "nodate"}
|
||||
{t}You must select a date.{/t} {t}Use your browser's 'back' button to try again.{/t}
|
||||
{elseif $error == "nochecks"}
|
||||
{t}You must choosse the listing elements to be restored.{/t} {t}Use your browser's 'back' button to try again.{/t}
|
||||
{elseif $error == "notsure"}
|
||||
{t}You did not say that you are sure.{/t} {t}Use your browser's 'back' button to try again.{/t}
|
||||
{/if}
|
||||
</p>
|
||||
{if $error!="notsure" && $error!="nodate" && $error!="nochecks"}
|
||||
<br />
|
||||
<form method="post" action="restorecaches.php">
|
||||
<input type="hidden" name="finduser" value="1" />
|
||||
<input type="hidden" name="username" value="{$username}" />
|
||||
<input type="submit" class="formbutton" value="{t}Back{/t}" onclick="submitbutton('submit')" />
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
{* step 3: select caches *}
|
||||
{elseif $step == 3}
|
||||
{if $disabled}
|
||||
<p>{t}Please select the listings to restore{/t}:</p>
|
||||
{/if}
|
||||
<br />
|
||||
<form method="post" action="restorecaches.php">
|
||||
<input type="hidden" name="caches" value="1" />
|
||||
<input type="hidden" name="username" value="{$username}" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{t}Waypoint{/t}</th>
|
||||
<th>{t}Coordinates{/t}</th>
|
||||
<th>{t}Logs{/t}</th>
|
||||
<th>{t}modified{/t}</th>
|
||||
<th>{t}Cachename{/t}</th>
|
||||
</tr>
|
||||
{foreach from=$aCaches item=cache}
|
||||
<tr>
|
||||
<td>{if $cache.data|@count > 0}<input type="checkbox" name="cache_{$cache.cache_id}" value="1" />{/if}</td>
|
||||
<td><a href="viewcache.php?cacheid={$cache.cache_id}" target="_ocv">{$cache.wp_oc}</a></td>
|
||||
<td style="font-size:1em; line-height:1em; white-space:nowrap">{$cache.coordinates.lat|escape}<br />{$cache.coordinates.lon|escape}</td>
|
||||
<td style="text-align:right">{$cache.logs} </td>
|
||||
<td>{$cache.last_modified|date_format:$opt.format.date}</td>
|
||||
<!-- <td>{if $cache.data|@count > 0}{$cache.date|date_format:$opt.format.date} /{$cache.data|@count}{/if}</td> -->
|
||||
<td style="line-height:1.1em">{$cache.name}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr><td style="height:4px"></td></tr>
|
||||
</table>
|
||||
|
||||
<p><input type="submit" class="formbutton" name="tostep4" value="{t}Go on{/t}" onclick="submitbutton('tostep4')" /> {t}to the date selection{/t}</p>
|
||||
</form>
|
||||
|
||||
{* step 4: select date *}
|
||||
{elseif $step == 4}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
function checkall(value)
|
||||
{
|
||||
document.getElementsByName("restore_coords")[0].checked = value;
|
||||
document.getElementsByName("restore_settings")[0].checked = value;
|
||||
document.getElementsByName("restore_waypoints")[0].checked = value;
|
||||
document.getElementsByName("restore_desc")[0].checked = value;
|
||||
document.getElementsByName("restore_logs")[0].checked = value;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
<form method="get" action="restorecaches.php">
|
||||
<input type="hidden" name="username" value="{$username}" />
|
||||
<input type="hidden" name="cacheids" value="{$cachelist}" />
|
||||
<input type="hidden" name="doit" value="1" />
|
||||
{if $today}
|
||||
<p class="redtext">{t}The user changed one or more of these caches today, therefore you cannot revert changes. This can be done not before tomorrow.{/t}</p>
|
||||
{/if}
|
||||
{if ($disabled && !$today) || $rootadmin}
|
||||
<p>{t}Please select the date from which on all changes are to be reverted.<br />The listing will be reset to the contents it had on that day at 00:00:00.{/t}</p>
|
||||
{/if}
|
||||
<br />
|
||||
<table class="narrowtable">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{t}Date{/t}</th>
|
||||
<th>{t}Waypoint{/t}</th>
|
||||
<th>{t}Changes{/t}</th>
|
||||
</tr>
|
||||
|
||||
{foreach from=$dates key=date item=caches}
|
||||
<tr>
|
||||
<td>{if ($disabled && !$today) || $rootadmin}<input type="radio" name="date_{$date}" value="1" />{/if}</td>
|
||||
<td>{$date|date_format:$opt.format.date}</td>
|
||||
</tr>
|
||||
{foreach from=$caches key=wp item=text}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td style="vertical-align:top"><a href="viewcache.php?wp={$wp}" target="_ocv">{$wp}</a></td>
|
||||
<td>{$text}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td colspan="4"><hr /></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
|
||||
<br />
|
||||
{if $today && $rootadmin}
|
||||
<p class="redtext">{t}Warning: If you revert any owner-made listing changes of <em>today</em>, your revert will be final. It cannot be corrected / undone afterwards. Only reverts of coords & country, logs and pictures will be logged in this case, so all other changes will not be comprehensible. Therefore <span style="text-decoration:underline">it is strongly recommended to revert vandalism not before the next day!</span>{/t}</p>
|
||||
{/if}
|
||||
{if $disabled || $rootadmin}
|
||||
<p>{t}Restore{/t} ...</p>
|
||||
<p>
|
||||
<input type="checkbox" name="restore_coords" value="1" /> {t}coordinates and country{/t}
|
||||
<input type="checkbox" name="restore_settings" value="1" /> {t}name, settings, attributes and hide-date{/t}
|
||||
<input type="checkbox" name="restore_waypoints" value="1" /> {t}GC/NC waypoints{/t} <br />
|
||||
<input type="checkbox" name="restore_desc" value="1" /> {t}description(s) incl. pictures{/t}
|
||||
<input type="checkbox" name="restore_logs" value="1" /> {t}logs incl. pictures{/t}
|
||||
<a href="javascript:checkall('checked')">{t}_all{/t}</a> <a href="javascript:checkall('')">{t}nothing{/t}</a>
|
||||
</p>
|
||||
<p>
|
||||
<em>{t}Excluded from restore: cache status, OConly attribute, additional waypoints, log password, preview picture status{/t}</em>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" name="sure" value="1" /> {t}Sure?{/t}
|
||||
<input type="checkbox" name="simulate" value="1" /> {t}simulate{/t}
|
||||
</p>
|
||||
<br />
|
||||
<p><input type="submit" class="formbutton" name="revert" value="{t}Revert Vandalism{/t}" style="width:200px" onclick="submitbutton('revert')" /></p>
|
||||
{if !$disabled && $rootadmin}
|
||||
<p>{t}You are root admin and can override the warnings. Take care!{/t}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
{* step 4: listings are restored - show result *}
|
||||
{elseif $step == 5}
|
||||
<br />
|
||||
<p>
|
||||
{if $simulate}
|
||||
{t 1=$date|date_format:$opt.format.date}The following cache listings would have been reset to the state before %1{/t}:
|
||||
{else}
|
||||
{t 1=$date|date_format:$opt.format.date}The following cache listings have been reset to the state before %1{/t}:
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
{if $restored|@count == 0}
|
||||
<p>({t}none{/t})</p>
|
||||
{else}
|
||||
<ul>
|
||||
{foreach from=$restored key=wp item=fields}
|
||||
<li>
|
||||
<a href="viewcache.php?wp={$wp}" target="_ocv">{$wp}</a>:
|
||||
{assign var=first value=0}
|
||||
{foreach from=$fields key=field item=dummy}{if $first > 0}, {/if}{$field}{assign var=first value=1}{/foreach}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{/if}
|
Loading…
x
Reference in New Issue
Block a user