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> <h2 class="yacy">Surftips</h2>
#(surftips)# #(surftips)#
Surftips are switched off<br /> Surftips are switched off for users without authorization
<a href="/Surftips.html?surftips=1">Show surftips</a>
:: ::
#{results}# #{results}#
<!-- link begin --> <!-- link begin -->
@ -50,7 +49,17 @@
#{/results}# #{/results}#
<p class="aftersurftips"> <p class="aftersurftips">
...provided by YaCy peers using public bookmarks, link votes and crawl start points<br /> ...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> </p>
<script type="text/javascript"> <script type="text/javascript">
addHover(); addHover();

@ -57,17 +57,18 @@ public class Surftips {
boolean showScore = ((post != null) && (post.containsKey("score"))); boolean showScore = ((post != null) && (post.containsKey("score")));
boolean surftipsOn = sb.getConfigBool("showSurftips", true); boolean publicPage = sb.getConfigBool("publicSurftips", true);
if ((post != null) && (post.containsKey("surftips"))) { boolean authorizedAccess = sb.verifyAuthentication(header, false);
if (!sb.verifyAuthentication(header, false)) { if ((post != null) && (post.containsKey("publicPage"))) {
if (!authorizedAccess) {
prop.put("AUTHENTICATE", "admin log-in"); // force log-in prop.put("AUTHENTICATE", "admin log-in"); // force log-in
return prop; return prop;
} }
surftipsOn = post.get("surftips", "0").equals("1"); publicPage = post.get("publicPage", "0").equals("1");
sb.setConfig("showSurftips", surftipsOn); sb.setConfig("publicSurftips", publicPage);
} }
if (surftipsOn) { if ((publicPage) || (authorizedAccess)) {
// read voting // read voting
String hash; String hash;

@ -81,7 +81,7 @@ public class WebStructurePicture_p {
// recursively find domains, up to a specific depth // recursively find domains, up to a specific depth
ymageGraph graph = new ymageGraph(); 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(); //graph.print();
return graph.draw(width, height, 20, 20, 20, 20); return graph.draw(width, height, 20, 20, 20, 20);

@ -852,8 +852,8 @@ currentSkin=
# table-types: RAM = 0, TREE = 1, FLEX = 2; # table-types: RAM = 0, TREE = 1, FLEX = 2;
tableTypeForPreNURL=0 tableTypeForPreNURL=0
# flag to show surftipps on index.html page # flag to show surftips on Surftips.html page for non-administrator users
showSurftipps = true publicSurftips = true
# a Java Properties file containig a list of SOAP services that should deployed # a Java Properties file containig a list of SOAP services that should deployed
# additionally to the default services. E.g. # additionally to the default services. E.g.

Loading…
Cancel
Save