[pmwiki-users] Condition authority on date?

Patrick R. Michaud pmichaud at pobox.com
Mon May 29 08:54:00 CDT 2006


On Mon, May 29, 2006 at 03:45:11PM +1200, Allister Jenks wrote:
> Anybody got any clever ideas to simplify this situation?
> 
> I have a website which has some pages with date-conditioned content.
> Essentially, a portion of the site will 'launch' on a given date.
> Some of my basic pages are conditioned on (:if date 2006-06-01.. :) to
> reflect the pre- and post-launch situations.
> 
> Additionally, an entire wiki group (Issue1) is currently secured to
> user group @Issue1Pending - which has no members.  On June 1st I need
> to change the authorisation of the Issue1 wiki group to the @Issue1
> user group which already has many members.  Voila!  The site is
> launched.
> 
> My problem is that despite having all the other parts of the site (not
> in the Issue1 group) adapting based on pre- or post-launch conditions
> (i.e. the date) I still have to get up at midnight and change that one
> authority entry.  :-(
> 
> The key point here is the Issue1 wiki group should not be accessible
> until June 1st.

In local/config.php:

   $date = strftime('%Y%m%d', $Now);
   if ($date >= '20060601') {
     $page = ReadPage('Issue1.GroupAttributes');
     if ($page['passwdread'] != '@Issue1') {
       $page['passwdread'] = '@Issue1';
       WritePage('Issue1.GroupAttributes', $page);
     }
   }

Upon receiving the first page request on June 1st, PmWiki will
change the read password for Issue1.GroupAttributes to '@Issue1'.
(I haven't tested this code myself, but it ought to work or at
least be fairly close.)

Pm




More information about the pmwiki-users mailing list