[Openvas-commits] r11572 - in trunk/gsa: . src src/html
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Sep 6 15:30:16 CEST 2011
Author: mattm
Date: 2011-09-06 15:30:14 +0200 (Tue, 06 Sep 2011)
New Revision: 11572
Modified:
trunk/gsa/ChangeLog
trunk/gsa/src/gsad_omp.c
trunk/gsa/src/html/omp.xsl
Log:
* src/gsad_omp.c (get_report_omp): Add filters to GET_ASSET.
* src/html/omp.xsl: Add stylesheet attribs for functions.
(gsa:build-levels): New function.
(host, report [assets]): Add filters to links.
Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2011-09-06 12:38:09 UTC (rev 11571)
+++ trunk/gsa/ChangeLog 2011-09-06 13:30:14 UTC (rev 11572)
@@ -1,5 +1,13 @@
2011-09-06 Matthew Mundell <matthew.mundell at greenbone.net>
+ * src/gsad_omp.c (get_report_omp): Add filters to GET_ASSET.
+
+ * src/html/omp.xsl: Add stylesheet attribs for functions.
+ (gsa:build-levels): New function.
+ (host, report [assets]): Add filters to links.
+
+2011-09-06 Matthew Mundell <matthew.mundell at greenbone.net>
+
* src/gsad_omp.c (get_lsc_credentials): Init sort params.
* src/html/gsad.xsl (html-gsa-navigation): Clean up some wrapping.
Modified: trunk/gsa/src/gsad_omp.c
===================================================================
--- trunk/gsa/src/gsad_omp.c 2011-09-06 12:38:09 UTC (rev 11571)
+++ trunk/gsa/src/gsad_omp.c 2011-09-06 13:30:14 UTC (rev 11572)
@@ -7678,7 +7678,17 @@
if (delta_report_id && result_id && strcmp (result_id, "0"))
xml = g_string_new ("<get_delta_result>");
else if (host)
- xml = g_string_new ("<get_asset>");
+ {
+ xml = g_string_new ("<get_asset>");
+ g_string_append_printf (xml,
+ "<search_phrase>%s</search_phrase>"
+ "<levels>%s</levels>"
+ "<hosts start=\"%s\" max=\"%s\"/>",
+ search_phrase,
+ levels->str,
+ first_result,
+ max_results);
+ }
else
xml = g_string_new ("<get_report>");
Modified: trunk/gsa/src/html/omp.xsl
===================================================================
--- trunk/gsa/src/html/omp.xsl 2011-09-06 12:38:09 UTC (rev 11571)
+++ trunk/gsa/src/html/omp.xsl 2011-09-06 13:30:14 UTC (rev 11572)
@@ -3,7 +3,9 @@
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
- extension-element-prefixes="str">
+ xmlns:func = "http://exslt.org/functions"
+ xmlns:gsa="http://openvas.org"
+ extension-element-prefixes="str func">
<xsl:output
method="html"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
@@ -542,6 +544,21 @@
</div>
</xsl:template>
+<func:function name="gsa:build-levels">
+ <xsl:param name="filters"></xsl:param>
+ <func:result>
+ <xsl:for-each select="$filters/filter">
+ <xsl:choose>
+ <xsl:when test="text()='High'">h</xsl:when>
+ <xsl:when test="text()='Medium'">m</xsl:when>
+ <xsl:when test="text()='Low'">l</xsl:when>
+ <xsl:when test="text()='Log'">g</xsl:when>
+ <xsl:when test="text()='False Positive'">f</xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </func:result>
+</func:function>
+
<xsl:template name="build-levels">
<xsl:param name="filters"></xsl:param>
<xsl:for-each select="$filters">
@@ -10274,7 +10291,7 @@
<div class="gb_window_part_content">
<xsl:variable name="report_count" select="detail[name = 'report_count' and source/name = 'openvasmd']/value"/>
<div class="float_right">
- <a href="?cmd=get_report&type=assets&overrides=1&levels=hm&token={/envelope/token}">Back to Assets</a>
+ <a href="?cmd=get_report&type=assets&levels={../../../../levels}&search_phrase={../../../../search_phrase}&first_result={../../../../hosts/@start}&max_results={../../../../hosts/@max}&token={/envelope/token}">Back to Assets</a>
</div>
<table>
<tr>
@@ -10313,7 +10330,7 @@
<xsl:variable name="pos" select="detail[name/text() = 'report/pos']/value"/>
<xsl:choose>
<xsl:when test="$pos < $report_count">
- <a href="/omp?cmd=get_report&type=assets&host={ip}&pos={$pos + 1}&notes=1&overrides=1&result_hosts_only=1&search_phrase={}&token={/envelope/token}">
+ <a href="/omp?cmd=get_report&type=assets&host={ip}&pos={$pos + 1}&levels={../../../../levels}&search_phrase={../../../../search_phrase}&first_result={../../../../hosts/@start}&max_results={../../../../hosts/@max}&token={/envelope/token}">
<<
</a>
</xsl:when>
@@ -10324,7 +10341,7 @@
</a>
<xsl:choose>
<xsl:when test="$pos > 1">
- <a href="/omp?cmd=get_report&type=assets&host={ip}&pos={$pos - 1}&notes=1&overrides=1&result_hosts_only=1&search_phrase={}&token={/envelope/token}">
+ <a href="/omp?cmd=get_report&type=assets&host={ip}&pos={$pos - 1}&levels={../../../../levels}&search_phrase={../../../../search_phrase}&first_result={../../../../hosts/@start}&max_results={../../../../hosts/@max}&token={/envelope/token}">
>>
</a>
</xsl:when>
@@ -11275,7 +11292,7 @@
</xsl:choose>
</td>
<td>
- <a href="/omp?cmd=get_report&type=assets&host={ip}&pos=1&notes=1&overrides=1&result_hosts_only=1&search_phrase={}&token={/envelope/token}"
+ <a href="/omp?cmd=get_report&type=assets&host={ip}&pos=1&search_phrase={../filters/phrase}&levels={gsa:build-levels(../filters)}&first_result={../hosts/@start}&max_results={../hosts/@max}&token={/envelope/token}"
title="Asset Details" style="margin-left:3px;">
<img src="/img/details.png" border="0" alt="Details"/>
</a>
More information about the Openvas-commits
mailing list