Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#76 2017-10-18 12:06:02
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
Any idea, anyone?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: smd_access_keys: secure, limited access to content
Sorry, Uli. I can’t get the plugin working at all under 4.7.0-dev and since that’s my working environment at the moment I’m unable to test this. I’ll see if I can spin up a 4.6.2 or something and see what happens. Dunno about 4.4.1 though!
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_access_keys: secure, limited access to content
uli wrote #307369:
the download link is already visible without the additional URL parameter.
While I figure this out, is there any mileage in adding the force="1" parameter around the protected content? In theory it shouldn’t be necessary but give it a whirl as it’ll probably get your page working how you intended, even if I can’t recall why I wrote the plugin to work that way.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#79 2017-10-18 13:37:35
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
It changed things a little, yes: Both states of the sheltered page now come with hidden download links.
Bloke wrote #307437:
Dunno about 4.4.1 though!
In theory it should work, as 4.4.1 was already released (I downloaded it in July 2011) when smd_access_keys v.0.11 came out (January 2012), I just researched that.
EDIT: In the admin, new links are added, but the counter remains at zero, no matter how often I refresh the page.
Last edited by uli (2017-10-18 13:47:20)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#80 2017-10-18 13:42:45
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
If it helps you, I could mail you credentials to the site in question.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: smd_access_keys: secure, limited access to content
uli wrote #307439:
It changed things a little, yes: Both states of the sheltered page now come with hidden download links.
Que? Where is your <txp:smd_access_protect> tag? In your default Page/Form for this Section, surrounding the part of the page you want to only be visible to holders of the tokenized URL?
In the admin, new links are added, but the counter remains at zero, no matter how often I refresh the page.
The counter only goes up when the page is visited with the valid token in place. e.g. http://example.org/articles/your-article/rkd/<token-here>.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#82 2017-10-18 14:54:38
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
Bloke wrote #307441:
Que? Where is your
<txp:smd_access_protect>tag? In yourdefaultPage/Form for this Section, surrounding the part of the page you want to only be visible to holders of the tokenized URL?
My article form (not default) contains this here:
<div class="zusammenfassung">
<h1 class="einzeltitel"><txp:title /></h1>
<txp:article_image />
<txp:body />
<txp:smd_access_protect expires="+168 hours" trigger="rkd" force="1">
<p class="rot">Gratisdownload</p>
</txp:smd_access_protect>
</div>
My tokens look a little different:
?rkd/e9c6d09bd48e4cde9922d7ed12dc7c15db817432/59e75794-59f09214.1. Note the question mark. Does that hint at something?
Last edited by uli (2017-10-18 14:55:30)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#83 2017-10-18 15:00:52
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
Dang! Looks like I’ve missed section_mode="1". Sorry for the annoyances.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#84 2017-10-18 15:02:17
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
And thanks for setting me on the track again :)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: smd_access_keys: secure, limited access to content
uli wrote #307443:
Dang! Looks like I’ve missed
section_mode="1". Sorry for the annoyances.
Yeah, if you’re protecting a Landing Page, that’s important :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#86 2017-10-23 19:22:17
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
I can’t for the life of me make the txp:else tag work inside the smd_access_protect container. I’ve a landing page where I want to hide the registration form for visitors coming in with an access key, so I’ve put the smd_access_protect container on the page. But whatever code comes above the else tag is executed, no matter whether I visit unregistered or come with a key.
Here’s my (simplified, current) page with just the smd_access part, displaying only the after-registration modus:
<txp:smd_access_protect expires="+168 hours" trigger="rkd" section_mode="1" enforce="1">
<txp:article form="downloads-after-registration" />
<txp:else />
<txp:zem_contact to="my@email.addr" label="Downloads freischalten" redirect="registrierung">
<txp:some_zem_contact_tags />
</txp:zem_contact>
<txp:article form="downloads" />
</txp:smd_access_protect>
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: smd_access_keys: secure, limited access to content
uli wrote #307503:
<txp:smd_access_protect expires="+168 hours" trigger="rkd" section_mode="1" enforce="1">...
Is that a typo? It’s force not enforce.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#88 2017-10-23 21:57:59
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
Ah, that was the breakthrough, finally! Thanks, Stef!
Yes, it’s a typo but an intentional one, cause I didn’t succeed earlier with force and different tag combos, and then let it as it was and forgot it.
Thanks again!
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#89 2017-10-24 15:09:47
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_access_keys: secure, limited access to content
New client idea: Is it possible with smd_access to hand over just 1 (section-)link to registered visitors and let them download each page item only once from a steadily varying range of items?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: smd_access_keys: secure, limited access to content
uli wrote #307511:
New client idea: Is it possible with smd_access to hand over just 1 (section-)link to registered visitors and let them download each page item only once from a steadily varying range of items?
Not really. The protection mechanism is to protect “a resource”. That resource could be a file, link, chunk of page content or a whole section, but once it’s unlocked, it’s unlocked. The key itself houses the limitations such as access attempts and dates.
If you give out the same key to many registered users to unlock a (non-time-bound, limitless) section, they could all access the content inside. If you wanted to limit what each person could see inside, you’d need to marry your downloads with some other mechanism to check who logged in and what they downloaded. Nothing to stop you auto-generating keys for each resource when people visit the section, but you’d need to know first that they haven’t already downloaded it to know if you need to generate a key.
If you gave out a different key to the section and encoded some unique value in the ‘extra’ area of each key, you could extract that when they log in and use it to generate one-time use keys for all the resources on the page. But you’d still need to know which ones they downloaded so you know not to generate new keys for those resources when the page is refreshed.
It’s not easy. And remember, once content’s downloaded, there’s nothing to stop it being shared peer to peer, so think carefully about putting too many controls in place. People will a) find a way round it or b) not bother using it if you restrict things too much.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline