Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
redesigned access control to surftips: - access is now granted to authorized admin, even if it is blocked to the public - generalized naming - changed links to buttons
orbiterc321ddff7a5c
diff --git a/htroot/Surftips.html b/htroot/Surftips.htmlindex 08faf3279..e8a3adb97 100644--- a/htroot/Surftips.html+++ b/htroot/Surftips.html@@ -25,8 +25,7 @@<h2 class="yacy">Surftips</h2>#(surftips)#- Surftips are switched off<br />- <a href="/Surftips.html?surftips=1">Show surftips</a>+ Surftips are switched off for users without authorization::#{results}#<!-- link begin -->@@ -50,7 +49,17 @@#{/results}#<p class="aftersurftips">...provided by YaCy peers using public bookmarks, link votes and crawl start points<br />- <a href="/Surftips.html?surftips=0">Hide surftips</a>++ <form action="Surftips.html" method="get" class="PeerControl">+ <button type="submit" name="publicPage" value="0">+ <img src="/env/grafics/lock.gif" alt="authentication required" />+ Hide surftips for users without autorization+ </button>+ <button type="submit" name="publicPage" value="1">+ <img src="/env/grafics/lock.gif" alt="authentication required" />+ Show surftips to everyone+ </button>+ </form></p><script type="text/javascript">addHover();diff --git a/htroot/Surftips.java b/htroot/Surftips.javaindex 5fa5e7418..8479051aa 100644--- a/htroot/Surftips.java+++ b/htroot/Surftips.java@@ -57,17 +57,18 @@ public class Surftips {boolean showScore = ((post != null) && (post.containsKey("score")));- boolean surftipsOn = sb.getConfigBool("showSurftips", true);- if ((post != null) && (post.containsKey("surftips"))) {- if (!sb.verifyAuthentication(header, false)) {+ boolean publicPage = sb.getConfigBool("publicSurftips", true);+ boolean authorizedAccess = sb.verifyAuthentication(header, false);+ if ((post != null) && (post.containsKey("publicPage"))) {+ if (!authorizedAccess) {prop.put("AUTHENTICATE", "admin log-in"); // force log-inreturn prop;}- surftipsOn = post.get("surftips", "0").equals("1");- sb.setConfig("showSurftips", surftipsOn);+ publicPage = post.get("publicPage", "0").equals("1");+ sb.setConfig("publicSurftips", publicPage);}- if (surftipsOn) {+ if ((publicPage) || (authorizedAccess)) {// read votingString hash;diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.javaindex 019cf1bae..6b3a41c66 100644--- a/htroot/WebStructurePicture_p.java+++ b/htroot/WebStructurePicture_p.java@@ -81,7 +81,7 @@ public class WebStructurePicture_p {// recursively find domains, up to a specific depthymageGraph graph = new ymageGraph();- place(graph, sb.webStructure, hash, host, 0.0, 0.0, 0, depth);+ if (host != null) place(graph, sb.webStructure, hash, host, 0.0, 0.0, 0, depth);//graph.print();return graph.draw(width, height, 20, 20, 20, 20);diff --git a/yacy.init b/yacy.initindex bfd81e050..3589eca36 100644--- a/yacy.init+++ b/yacy.init@@ -852,8 +852,8 @@ currentSkin=# table-types: RAM = 0, TREE = 1, FLEX = 2;tableTypeForPreNURL=0-# flag to show surftipps on index.html page-showSurftipps = true+# flag to show surftips on Surftips.html page for non-administrator users+publicSurftips = true# a Java Properties file containig a list of SOAP services that should deployed# additionally to the default services. E.g.