[pmwiki-users] FAQ: Editable RecentChanges

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 8 15:25:41 CDT 2005


On Sat, Aug 06, 2005 at 02:42:52PM -0700, H. Fox wrote:
> ## Disallow editing of RecentChanges and RecentUploads pages.
> if ($action=='edit'
>   && preg_match('/\\.(All)?Recent(Changes|Uploads)$/', $pagename)) {
>   unset($_POST['post']); unset($_POST['postedit']);
> }

Shorter is

    if ($action=='edit' && substr($pagename, -13) == 'RecentChanges')
      $action = 'browse';

> How would someone password-protect the pages, even ones that don't
> exist yet, rather than disabling editing them completely.  Or a better
> question: How can the answer be improved while remaining concise?

    if (substr($pagename, -13) == 'RecentChanges')
      $DefaultPasswords['edit'] = '*';

This locks the page for editing, although the admin password will
still work.

Pm




More information about the pmwiki-users mailing list