[pmwiki-users] Condition authority on date?

Allister Jenks arj at zkarj.co.nz
Mon May 29 21:23:49 CDT 2006

On 5/30/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Mon, May 29, 2006 at 03:45:11PM +1200, Allister Jenks wrote:
> > 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.)

Wow!  That is pretty clever.  I never understand the context of
config.php enough to think of these things.  I might try and turn it
into something generic I can use in the future.  One question.  Where
does the $Now variable come from?  Is it a PmWiki variable?

OK, so another question now.  If I were to set up a cron job to run a
php script, how can I get access to the ReadPage and WritePage
functions of PmWiki?


More information about the pmwiki-users mailing list