disable mapping of logs by other users; fixed default log searchtype
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
function search_output()
|
||||
{
|
||||
global $opt, $tpl, $login, $NEWCACHES_DAYS;
|
||||
global $search_in_gm, $search_in_gm_zip;
|
||||
global $enable_mapdisplay, $search_in_gm, $search_in_gm_zip;
|
||||
global $called_by_search, $called_by_profile_query, $options, $lat_rad, $lon_rad, $distance_unit;
|
||||
global $startat, $caches_per_page, $sql;
|
||||
|
||||
@@ -136,6 +136,7 @@ function search_output()
|
||||
|
||||
$tpl->assign('displayownlogs', $options['sort'] == 'bymylastlog');
|
||||
$tpl->assign('search_headline_caches', $called_by_search);
|
||||
$tpl->assign('enable_mapdisplay', $enable_mapdisplay);
|
||||
|
||||
if ($called_by_profile_query)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
* (use caching of the same quries)
|
||||
***************************************************************************/
|
||||
|
||||
if (!$enable_mapdisplay)
|
||||
$tpl->error(ERROR_INVALID_OPERATION);
|
||||
|
||||
$sqlchecksum = sprintf('%u', crc32($cachesFilter."\n".$sqlFilter));
|
||||
|
||||
// check if query was already executed within the cache period
|
||||
|
||||
+14
-5
@@ -1149,9 +1149,14 @@
|
||||
$sAddWhere = '';
|
||||
$sGroupBy = '';
|
||||
|
||||
// disallow mapping other users' logs for data protection reasons
|
||||
$enable_mapdisplay = ($options['searchtype'] != 'byfinder') ||
|
||||
($options['finderid'] == $login->userid);
|
||||
|
||||
// *** load output module ***
|
||||
//
|
||||
// (map2 module will execute and exit)
|
||||
// (map2 module will execute and exit; it will use the variables
|
||||
// $cachesFilter, $sqlFilter and $map2_bounds and $options['queryid'].)
|
||||
|
||||
require($opt['rootpath'] . 'lib2/search/search.' . $output_module . '.inc.php');
|
||||
|
||||
@@ -1364,8 +1369,7 @@
|
||||
// $sqlLimit
|
||||
// $options['sort']
|
||||
// $options['queryid']
|
||||
// $cachesFilter
|
||||
// $map2_bounds
|
||||
// $enable_mapdisplay
|
||||
//=================================================================
|
||||
|
||||
search_output();
|
||||
@@ -1608,8 +1612,13 @@ function outputSearchForm($options)
|
||||
$tpl->assign('terrainmin', $options['terrainmin']);
|
||||
$tpl->assign('terrainmax', $options['terrainmax']);
|
||||
$tpl->assign('terrain_options', array(0,2,3,4,5,6,7,8,9,10));
|
||||
|
||||
|
||||
// logtypen
|
||||
if (isset($options['logtype']))
|
||||
$logtypes = explode(',', $options['logtype']);
|
||||
else
|
||||
$logtypes = array();
|
||||
|
||||
$rs = sql("
|
||||
SELECT `id`,
|
||||
IFNULL(`sys_trans_text`.`text`, `log_types`.`name`) AS `name`,
|
||||
@@ -1621,7 +1630,7 @@ function outputSearchForm($options)
|
||||
) `log_types`
|
||||
LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`log_types`.`trans_id` AND `sys_trans_text`.`lang`='&1'
|
||||
ORDER BY `log_types`.`id` ASC",
|
||||
$opt['template']['locale'], isset($options['logtype']) ? $options['logtype'] : 0);
|
||||
$opt['template']['locale'], $logtypes ? $logtypes[0] : 0);
|
||||
|
||||
$tpl->assign_rs('logtype_options',$rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
<td style="white-space:nowrap">
|
||||
<p class="content-title-noshade-size15" style="padding:0; margin:4px;"> {t 1=$results_count 2=($search_headline_caches?'':'display:none')}%1 caches<span style="%2"> matched</span>{/t} </p>
|
||||
</td>
|
||||
{if $caches|@count}
|
||||
<td style="text-align:right; width:1px">
|
||||
<a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1" class="nooutline"><img src="resource2/ocstyle/images/misc/32x32-world.png"/></a>
|
||||
</td>
|
||||
<td style="white-space:nowrap; text-align:left; padding-bottom:2px">
|
||||
<p class="inheader"><a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1">{t}Show on map{/t}</a></p>
|
||||
</td>
|
||||
{if $caches|@count && $enable_mapdisplay}
|
||||
<td style="text-align:right; width:1px">
|
||||
<a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1" class="nooutline"><img src="resource2/ocstyle/images/misc/32x32-world.png"/></a>
|
||||
</td>
|
||||
<td style="white-space:nowrap; text-align:left; padding-bottom:2px">
|
||||
<p class="inheader"><a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1">{t}Show on map{/t}</a></p>
|
||||
</td>
|
||||
{/if}
|
||||
<td style="text-align:right; padding-bottom:2px"><p class="inheader">
|
||||
<span style="white-space:nowrap">[<a href="query.php?action=save&queryid={$queryid}">{t}Save options{/t}</a>]</span>
|
||||
|
||||
Reference in New Issue
Block a user