Skip to content

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

*) Display login link on Status.html See: http://www.yacy-forum.de/viewtopic.php?p=15183&highlight=#15183

theli83328ed712cd
diff --git a/htroot/Status.html b/htroot/Status.html
index 8513d8e03..23f8f822c 100644
--- a/htroot/Status.html
+++ b/htroot/Status.html
@@ -107,7 +107,13 @@ To switch online-mode, press one of the following buttons:
</table>
<!-- </td></tr></table> -->
</p>
+<p>
+#(showPrivateTable)#
+ Click <a href="Status.html?login=">here</a> to log in as administrator.
+ ::
+#(/showPrivateTable)#
#%[privateStatusTable]%#
+</p>
<p><font size="-3"><i>Last Refresh:</i> #[date]#</font></p>
#%env/templates/footer.template%#
diff --git a/htroot/Status.java b/htroot/Status.java
index 4ee764894..7140e116f 100644
--- a/htroot/Status.java
+++ b/htroot/Status.java
@@ -71,15 +71,23 @@ public class Status {
final serverObjects prop = new serverObjects();
if (post != null) {
- if (post.containsKey("pausecrawlqueue")) {
- ((plasmaSwitchboard)env).pauseCrawling();
- } else if (post.containsKey("continuecrawlqueue")) {
- ((plasmaSwitchboard)env).continueCrawling();
- } else if (post.containsKey("ResetTraffic")) {
- httpdByteCountInputStream.resetCount();
- httpdByteCountOutputStream.resetCount();
+ if (post.containsKey("login")) {
+ if (((plasmaSwitchboard) env).adminAuthenticated(header) < 2) {
+ prop.put("AUTHENTICATE","log-in");
+ } else {
+ prop.put("LOCATION","");
+ }
+ } else {
+ if (post.containsKey("pausecrawlqueue")) {
+ ((plasmaSwitchboard)env).pauseCrawling();
+ } else if (post.containsKey("continuecrawlqueue")) {
+ ((plasmaSwitchboard)env).continueCrawling();
+ } else if (post.containsKey("ResetTraffic")) {
+ httpdByteCountInputStream.resetCount();
+ httpdByteCountOutputStream.resetCount();
+ }
+ prop.put("LOCATION","");
}
- prop.put("LOCATION","");
return prop;
}
@@ -91,8 +99,10 @@ public class Status {
yacyCore.peerActions.updateMySeed();
if (((plasmaSwitchboard) env).adminAuthenticated(header) >= 2) {
+ prop.put("showPrivateTable",1);
prop.put("privateStatusTable", "Status_p.inc");
- } else {
+ } else {
+ prop.put("showPrivateTable",0);
prop.put("privateStatusTable", "");
}