[pmwiki-users] How can I make an uploaded file expire?

Hans design5 at softflow.co.uk
Fri Jan 23 07:02:10 CST 2009


Friday, January 23, 2009, 12:33:59 PM, Neil Herber (nospam) wrote:

> Your suggestion is appreciated, but it has the disadvantage (for me) of
> requiring access to the config files for each expiry. I really need a 
> method that can be accomplished directly from wiki pages.

> If that requires a one-time code addition to the config files, that's 
> fine. For example, if I had custom markup that could parse:
> (:page_expire 2009-01-29:) I would be all set.

use a PTV?

in your page:  (:page_expire: 2009-01-29:)

in your config:

$expires = strtotime(PageTextVar($pagename, "page_expire"));
if ( !strncasecmp( $pagename, 'GroupName', N ) {
   $HandleAuth['download'] = 'download';
   $DefaultPasswords['download'] =
     ( $Now < $expires ) ? '@limited' : '@lock';
 }


I have not tested this.

  ~Hans




More information about the pmwiki-users mailing list