Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2017-01-04 13:48:52

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 215
Website

Re: smd_access_keys: secure, limited access to content

Hey Bloke, did you had any chance to find out what can be done ?

Would a solution like a plugin firing off before your and ripping of the query string, work ?
If yes, what kind of code would it involve ?
And if no, what else would you recommend ?

I really need this sorted out, now. Sorry to not have followed up.
Regards

Offline

#74 2017-10-13 16:38:03

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: smd_access_keys: secure, limited access to content

Stef, I followed the steps you adviced husaink here. Now, the problem is the download link is already visible without the additional URL parameter. Here’s my code:

<txp:smd_access_protect expires="+168 hours" trigger="rkd">
	<p class="rot">Gratisdownload</p>
</txp:smd_access_protect>

Is there something obvious? (TXP 4.4.1, smd_access v0.11)

Last edited by uli (2017-10-13 16:47:12)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#75 2017-10-17 11:36:31

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: smd_access_keys: secure, limited access to content

I still could not solve my above issue with the plugin. It neither hides my download links when I visit the page with a normal URL, nor does it add to the admin side counter when I use the links it creates. I’ve tried to move things by eliminating errors I discovered while in debug mode (not caused by the plugin) but to no avail. It’s also not a cache issue, other changes on the page are displayed. Also, removing the expires attribute completely didn’t change the behaviour.

This is what the source code shows while in debug mode:

Sheltered page visited with a standard URL:

<txp:smd_access_protect expires="+168 hours" trigger="rkd">
	[SQL (0,00071215629577637): select CHARACTER_MAXIMUM_LENGTH from INFORMATION_SCHEMA.COLUMNS where table_name = 'smd_akeys' AND table_schema = 'txp_cms' AND column_name = 't_hex']
	[SQL (0,00060892105102539): show columns from smd_akeys]
	[smd_access_key URL elements: http:||www.site.de|cms|downloads|]
	[smd_access_key trigger: rkd]
	[<txp:smd_access_protect expires="+168 hours" trigger="rkd">: true]
</txp:smd_access_protect>

Same page visited with access key URL:

<txp:smd_access_protect expires="+168 hours" trigger="rkd">
	[SQL (0,00076198577880859): select CHARACTER_MAXIMUM_LENGTH from INFORMATION_SCHEMA.COLUMNS where table_name = 'smd_akeys' AND table_schema = 'txp_cms' AND column_name = 't_hex']
	[SQL (0,00066804885864258): show columns from smd_akeys]
	[smd_access_key URL elements: http:||www.site.de|cms|downloads?rkd|067b88d1d03d66675f7a3ddbf979ef6777faf30d|59e5dc02-59ef1682.1]
	[smd_access_key trigger: rkd]
	[<txp:smd_access_protect expires="+168 hours" trigger="rkd">: true]
</txp:smd_access_protect>

In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#76 2017-10-18 12:06:02

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

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

#77 2017-10-18 12:39:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#78 2017-10-18 13:06:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

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.

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,304

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,304

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

#81 2017-10-18 14:37:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

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.

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,304

Re: smd_access_keys: secure, limited access to content

Bloke wrote #307441:

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?

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,304

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,304

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

Board footer

Powered by FluxBB