A client wanted to force his users to fill out one of those annoying "your personal details" forms, before allowing access to certain downloads.
Information should be cached in the user's session, so he could download the same file twice without having to refill the form.

This mechanism is parallel to how protected_node password protects nodes... so I used it as a basis.

I introduced a property "protection method", which until now (supposedly) has always been 'password'. And then introduced a second method called 'webform'. So an editor can decide to protect a node with either a password, or a webform. For that second method to work, the webform module needs to be installed -- but no real dependencies are introduced in this module's code.

Admittedly the definition of 'protect' gets a bit fuzzy, if we also call 'showing a webform' protection... :) But it uses the same workflow.

I'd like to know if you consider this a good addition to protected_node. The patch is fit for inclusion.

---

In addition, this patch also:
- redirects to the "protection page" for the node, when (the file system is set to 'private' and) a file is requested which is uploaded to a protected node. The current module just denies access.
- contains a lot of code specific to the 'webform' method: it can remember filled values across different webforms in the user's session, so the user does not need to fill out the same data on every form. (This is configurable per webform-field.)

CommentFileSizeAuthor
protected_node_webform.patch39.49 KBroderik

Comments

roderik’s picture

> contains a lot of code specific to the 'webform' method:

Uh - wait.

Now that the deadlines are over...
I can probably split all that code into its own module, which depends on protected_node.

It means you are still left with a pretty large patch for protected_node, which generalises code, and still introduces the same changes to your API calls. And adds a field to your database table.

And to me it makes sense to distribute that 'add on module' as a part of the protected_node project. (I may not be able to strip 'webform' out of 100% of the API calls/descriptions.)

I need feedback on whether you are willing to include these changes, before I do the work on it :)

AlexisWilke’s picture

This is a huge patch! It sounds to me that it should, indeed, be a completely separate module. But I like the idea since I wanted exactly that too. Having a form such as First name + Email address, and then send people to a page with the info. That page should be protected so only users who filled the form can access it.

I'd use that if that's what your patch is supposed to do! 8-))

And I'll help tolmi to get the necessary changes in this module. However, that should not include any changes to the database table. That is, you can do changes in your module to the existing database (with db_add_field() and db_delete_field() on install/uninstall) but you cannot ask us to modify the table in the protected_node module itself.

Thank you.
Alexis

roderik’s picture

Yes, that's what the patch is supposed to do :)

I guess if you want to use it now, you can... just use the current patch with the current module. It will be reworked as an add-on module to whatever version of protected_node you have then. When I get my head out of some other stuff.

I'm not sure if I agree with the db_add_field construction for all the fields I'm adding -- but I'll get back to you on that there and then :)

AlexisWilke’s picture

roderik,

Yeah... well... the module did not work for me with PostgreSQL. So I had to do some changes. At this point there are 3 patches I posted. Tolmi also said he would create a dev-1.x version which I think would be a good thing (i.e. help us have more people test possible changes and see whether they work. If not we can always rollback.)

Anyway, if I get around it, I may test your version. The problem is that if it changes a lot, it could also be problematic to switch to the next version. 8-) If you get the separate module, I'll definitively start using it!

Thank you.
Alexis

AlexisWilke’s picture

After having worked on the module, I think that what you are offering here should be another module. One that works with webform and generates the necessary session that gives you access to a specific page instead of hacking this very module so greatly.

Thank you.
Alexis Wilke

grimreaper’s picture

Status: Needs review » Closed (outdated)

Hello,

I close this issue because Drupal 6 is no more supported. https://www.drupal.org/drupal-6-eol

If this issue is present in Drupal 7, feel free to re-open it.