Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix: respect config setting of "show Nav Top-Menu" in HostBrowser.html for public users (as hostbrowser is now available in search results)

regerbb20691d4f9d
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index bbd098d4c..54e5ea915 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -58,7 +58,17 @@ function updatepage(str) {
<script type="text/javascript" src="/js/sorttable.js"></script>
</head>
<body id="IndexControl">
+ #(topmenu)#
+ #%env/templates/portalheader.template%#
+ <div class="SubMenu">
+ <ul class="SubMenu">
+ <li style="width:15%;"><a class="MenuItemLink" href="/index.html"><img src="env/grafics/navsl.gif" height="10px" style="padding-right:10px" align="baseline"/>back to start page</a></li>
+ </ul>
+ </div>
+ #%env/templates/embeddedheader.template%#
+ ::
#%env/templates/simpleheader.template%#
+ #(/topmenu)#
<h2>Host Browser</h2>
<p>Browse the index of #[ucount]# documents. Enter a host or an URL for a file list or view a list of <a href="/HostBrowser.html?hosts=">all hosts</a>, <a href="/HostBrowser.html?hosts=crawling">only hosts with urls pending in the crawler</a> or <a href="/HostBrowser.html?hosts=error">only with load errors</a>.</p>
<form action="HostBrowser.html" id="searchform" method="get" onkeyup="xmlhttpPost(); return false;">
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index 985039909..fba5ae3cc 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -81,6 +81,12 @@ public class HostBrowser {
prop.put("files", 0);
prop.put("admin", 0);
+ if (admin) { // show top nav to admins
+ prop.put("topmenu",1);
+ } else { // for other respect setting in Search Design Configuration
+ prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
+ }
+
if (!searchAllowed) {
prop.put("result", "You are not allowed to use this page. Please ask an administrator for permission.");
return prop;