diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-23 17:49:16 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-23 17:49:16 +0000 |
| commit | c321ddff7a5c3e4e9408cf2110c9ec913db7ac02 (patch) | |
| tree | f0e93066664cdadb0dd1a5ff581eff376046562e /htroot | |
| parent | 8b393744f195714a2527631933180601f472c2bb (diff) | |
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
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3750 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/Surftips.html | 15 | ||||
| -rw-r--r-- | htroot/Surftips.java | 13 | ||||
| -rw-r--r-- | htroot/WebStructurePicture_p.java | 2 |
3 files changed, 20 insertions, 10 deletions
diff --git a/htroot/Surftips.html b/htroot/Surftips.html index 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.java index 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-in return 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 voting String hash; diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java index 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 depth ymageGraph 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); |
