Skip to content

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

Show hide or show public surftip button depending on current config status, to show the button to switch the status (hiding button of current status)

reger20bba135fe3e
diff --git a/htroot/Surftips.html b/htroot/Surftips.html
index 4075cab43..7d225c6d5 100644
--- a/htroot/Surftips.html
+++ b/htroot/Surftips.html
@@ -55,19 +55,22 @@
</p>
<form action="Surftips.html" method="get" class="PeerControl" accept-charset="UTF-8"><div>
- <button type="submit" name="publicPage" class="btn btn-primary" value="0">
- <img src="env/grafics/lock.gif" alt="authentication required" />
- Hide surftips for users without autorization
- </button>
+ #(publicSurftips)#
<button type="submit" name="publicPage" class="btn btn-primary" value="1">
<img src="env/grafics/lock.gif" alt="authentication required" />
Show surftips to everyone
</button>
+ ::
+ <button type="submit" name="publicPage" class="btn btn-primary" value="0">
+ <img src="env/grafics/lock.gif" alt="authentication required" />
+ Hide surftips for users without autorization
+ </button>
+ #(/publicSurftips)#
</div></form>
<script type="text/javascript">
addHover();
</script>
- #(/surftips)#
+ #(/surftips)#
#%env/templates/footer.template%#
</body>
diff --git a/htroot/Surftips.java b/htroot/Surftips.java
index dad98d129..33b59d197 100644
--- a/htroot/Surftips.java
+++ b/htroot/Surftips.java
@@ -72,6 +72,7 @@ public class Surftips {
publicPage = post.get("publicPage", "0").equals("1");
sb.setConfig("publicSurftips", publicPage);
}
+ prop.put("surftips_publicSurftips", publicPage);
if ((publicPage) || (authorizedAccess)) {
@@ -79,7 +80,7 @@ public class Surftips {
String hash;
if ((post != null) && ((hash = post.get("voteNegative", null)) != null)) {
if (!sb.verifyAuthentication(header)) {
- prop.authenticationRequired();
+ prop.authenticationRequired();
return prop;
}
// make new news message with voting
@@ -93,7 +94,7 @@ public class Surftips {
}
if ((post != null) && ((hash = post.get("votePositive", null)) != null)) {
if (!sb.verifyAuthentication(header)) {
- prop.authenticationRequired();
+ prop.authenticationRequired();
return prop;
}
// make new news message with voting