Skip to content

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

Display Index Browser links requiring auth only when authenticated.

luccioman4e2bc644cb66
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index 5a56c69c2..489f4dfb7 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -77,7 +77,7 @@ function updatepage(str) {
#%env/templates/submenuWebStructure.template%#
#(/topmenu)#
<h2>Index 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?admin=#[admin]#&hosts=">all hosts</a>, <a href="HostBrowser.html?admin=#[admin]#&hosts=crawling">only hosts with urls pending in the crawler</a> or <a href="HostBrowser.html?admin=#[admin]#&hosts=error">only with load errors</a>.</p>
+ <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?admin=#[admin]#&hosts=">all hosts</a>#(authorized)#::, <a href="HostBrowser.html?admin=#[admin]#&hosts=crawling">only hosts with urls pending in the crawler</a> or <a href="HostBrowser.html?admin=#[admin]#&hosts=error">only with load errors</a>#(/authorized)#.</p>
<form action="HostBrowser.html" id="searchform" method="get" onkeyup="xmlhttpPost(); return false;">
<fieldset class="yacys">
<input type="hidden" name="admin" id="admin" value="#[admin]#" />
@@ -108,9 +108,11 @@ function updatepage(str) {
<div style="clear:both; float:left; padding:10px 5px 1px 5px;">
<div style="float:left;clear:both;">Count Colors:</div>
<div class="commit" style="float:left;">&nbsp;&nbsp;&nbsp;Documents without Errors</div>
+ #(authorized)#::
<div class="pending" style="float:left;">&nbsp;&nbsp;&nbsp;Pending in Crawler</div>
<div class="info" style="float:left;">&nbsp;&nbsp;&nbsp;Crawler Excludes</div>
<div class="error" style="float:left;">&nbsp;&nbsp;&nbsp;Load Errors</div>
+ #(/authorized)#
</div>
</fieldset>
@@ -251,9 +253,11 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&defType=edismax&start=0&rows=
</fieldset>
#(/inbound)#
+ #(authorized)#::
#(admin)#::
#%HostBrowserAdmin_p.html%#
#(/admin)#
+ #(/authorized)#
#%env/templates/footer.template%#
</body>
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index 5e80d5fdd..5f002f209 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -79,7 +79,8 @@ public class HostBrowser {
/**
* <p>Retrieve local index entries for a path, or for hosts with the most references. Also allow some maintaining operations on entries with load errors.</p>
- * <p>Some parameters need administrator authentication or unauthenticated local host requests to be allowed : load, deleteLoadErrors, delete and reload404.
+ * <p>Some parameters need administrator authentication or unauthenticated local host requests to be allowed : load, deleteLoadErrors, delete, reload404,
+ * hosts="crawling" and hosts="error".
* The "load" parameter can also be applied without authentication when "browser.load4everyone" configuration setting is true.</p>
* @param header servlet request header
* @param post request parameters. Supported keys :<ul>
@@ -147,6 +148,11 @@ public class HostBrowser {
prop.putNum("ucount", 0);
return prop;
}
+
+ if(authorized) {
+ /* Fill the "admin" parameter for authorized links */
+ prop.put("authorized_admin", Boolean.toString(admin));
+ }
String path = post == null ? "" : post.get("path", "").trim();
if (authorized) sb.index.fulltext().commit(true);