[development] temporary access module

Alan Dixon alan.g.dixon at gmail.com
Fri Feb 16 20:47:55 UTC 2007

Hi drupalites:

I've been working on a little module i'm calling 'peek' and just
wanted to check in on duplication of efforts, existing wisdom, etc.

The client wants to be able to create a page, and then fire off a
bunch of emails to people who may or may not have accounts, allowing
them to access the page temporarily.

So an administrator needs to be able to generate a semi-secret url
(like the ones generated by the user module) that would give someone
temporary access to a single node page.

After struggling with the node_access stuff for a while, i realised
that i probably want to sidestep the usual permissions by providing
access to the node page via a callback anyway.

So the url i'm generating looks like '/peek/<uid>/<timestamp>/<hd5 hash>'
and my peek table keeps track of things like the corresponding nid,
when it was generated, how long it's valid for, when it was first
accessed, and how long it remains valid after first access. I've also
got a helper function to generate new users for email address that
don't already have a user. When the link is generated, the user gets
authenticated to this uid. That way all subsequent activity is
connected to their userid for tracking purposes.

Thoughts anyone?

Alan Dixon, Web Developer

More information about the development mailing list