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
pull/1/head
orbiter 18 years ago
parent 8b393744f1
commit c321ddff7a

@ -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();

@ -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;

@ -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);

@ -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.

Loading…
Cancel
Save