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)
pull/149/head
reger 7 years ago
parent b907819cb4
commit 20bba135fe

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

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

Loading…
Cancel
Save