~~~~~~~~~~~~ IMPORTANT INFORMATION -- Please read! ~~~~~~~~~~~~

1. The "search..." box above searches the Docs & Forum Posts. The "Search" tab above just searches the Forum Posts. :side:
Please use these to search for your issue *before* creating a new message topic, as your issue may have been previously solved.
2. Please put your Club # and Club Web Address in your Forum Signature (best) OR in each post to get faster support from us.
Click here to edit your signature at the bottom of the Profile Information tab.
3. Our user and admin docs are available at: support.toastmastersclubs.org/doc "There's a doc for that!" ;)
4. There is an "Opt In" Feature for newly added members. The Opt In document explains the [strike]strikethrough[/strike] member information. Click Here to View the Post
5. When posting a New Topic , please include all relevant details and be specific. When did your issue 1st occur? What operating system, browser, & browser version are you using? Did you refresh your browser cache? Are your cookies enabled? Lastly, a screen shot is often helpful.
6. Please abide by the Terms of Use . We are volunteers contributing our spare time. We are happy to assist you, so long as you are respectful and courteous.
7. We are always looking for new FreeToastHost Ambassadors to join our team and support fellow Toastmasters in their use of the FreeToastHost website system. If you are familiar with the system and have some interest, send a Send Us a Private Message.

Add Member Ony to Unlisted Access Custom Web Pages

More
9 years 3 months ago #56137 by StanGreen
When creating a custom web page, you can set it to Public, Members or Officer access. When you create a Unlisted Access page, it is always public. Yes, the page is hidden, but if someone was able to access the page with the link, there is no security around it. For example, an internal club page is created. A person, who is a member at the time, book marks the page. They then let their membership laps and are removed from the members only links. However, if they use their bookmark, they can still access the page. What I would expect is if they are not logged in, they would get some sort of error and be redirected back to the home page or a login page. This is a simple example, but I can think of many more that would be much worse then one person accessing the page.

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #56139 by Jane Atkinson
I agree with this. I've often had reservations about making a member-only page hidden, for exactly these reasons.

Secretary, EY Toastmasters club 1137486, District 112
Auckland, NZ

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #56202 by StanGreen
If anyone would like a workaround, I came up with this javascript. It seems to meet about 85% of my needs so it is better than nothing.
<!-- Check Logged In -->
<script language="JavaScript">
function getCookie(cname)
{
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca;
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
}
return "";
}

var LoggedIn = getCookie("FTH.MSID");

if(LoggedIn.length < 1)
{
window.location = "http://" + window.location.host + "/";
}
</script>
<!-- End of Check Logged In -->

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago - 9 years 3 months ago #56203 by SteveTheTechie
Your test is flawed, since the actual test checks whether the cookie value matches what is in the db, not whether a cookie value exists.

A reliable method is to just check for the existence of element id memberlogout which is the member logout button. E.g.,
Code:
var LoggedIn = !!document.getElementById("memberlogout");

Of course, if I choose to change that ID, well, all bets are off... ;)
Last edit: 9 years 3 months ago by SteveTheTechie.

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #56206 by StanGreen
Yes, I know this is a hack, which is the 85%. In all my testing, which I admit was somewhat limited, I always saw the session cookie (i.e. FTH.MSID) being deleted on logout.

Using the element ID make the code simpler as I don't need to parse the cookie. (As long as the ID does not change.) My one question is why the double exclamation points (i.e. !!) . Does this not just return the getElementById result?

New code (using Steve's concept)

<!-- Check Logged In -->
<script language="JavaScript">
if (!document.getElementById("memberlogout"))
{
window.location = "http://" + window.location.host + "/";
}
</script>
<!-- End of Check Logged In -->

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago - 9 years 3 months ago #56207 by SteveTheTechie
!! is "bang bang" ... forces boolean result... It converts a "truthy" value to pure boolean. (look it up)
There are cases where a boolean result (and only a boolean result) is what is really needed.
Last edit: 9 years 3 months ago by SteveTheTechie.
The following user(s) said Thank You: StanGreen

Please Log in or Create an account to join the conversation.

Time to create page: 0.651 seconds