auditors may see the relevant part of the sphinx query

This commit is contained in:
SJ 2015-08-13 15:44:22 +02:00
parent 75b552e5e0
commit aa0d5e35c8
3 changed files with 19 additions and 0 deletions

View File

@ -72,6 +72,17 @@ class Sphinx {
if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("sphinx query: '%s' in %.2f s, %d hits, %d total found", $query->query, $query->exec_time, $query->num_rows, $query->total_found)); }
$session = Registry::get('session');
$sphx_query = '';
$b = preg_split("/\ ORDER\ /", $query->query);
$a = preg_split("/\ WHERE\ /", $b[0]);
if(isset($a[1])) {
$sphx_query = preg_replace("/\'/", "\'", $a[1]);
}
$session->set("sphx_query", $sphx_query);
return $query;
}

View File

@ -136,6 +136,10 @@
<?php if(ENABLE_DELETE == 1) { ?><i class="icon-exclamation-sign" title="<?php print $text_compliance_warning; ?>"></i><?php } ?>
<?php if(Registry::get('auditor_user') == 1 && $session->get("sphx_query")) { ?>
<span style="margin-left: 30px;"><a href="#" onclick="Piler.show_message('messagebox1', '<?php print $session->get("sphx_query"); ?>', 5);">sphinx</a></span>
<?php } ?>
<?php } else { print $text_none_found; } ?>
</div>
</div>

View File

@ -101,6 +101,10 @@
<?php if($next_page <= $total_pages){ ?><a href="#" onclick="Piler.navigation(<?php print $next_page; ?>);">&gt; </a> <?php } else { ?><span class="navlink">&gt; </span><?php } ?>
<?php if($page < $total_pages) { ?> &nbsp; <a href="#" onclick="Piler.navigation(<?php print $total_pages; ?>);"> &gt;&gt; </a><?php } else { ?> <span class="navlink"> &nbsp; &gt;&gt;</span><?php } ?>
<?php if(Registry::get('auditor_user') == 1 && $session->get("sphx_query")) { ?>
<span style="margin-left: 30px;"><a href="#" onclick="Piler.show_message('messagebox1', '<?php print $session->get("sphx_query"); ?>', 5);">sphinx</a></span>
<?php } ?>
</span>
<?php } else { ?>&nbsp;<?php } ?>