[pmwiki-users] Fox authorization to post when user only has read access

Tegan Dowling tmdowling at gmail.com
Mon Jan 14 09:15:11 CST 2008


On Jan 14, 2008 8:19 AM, Hans <design5 at softflow.co.uk> wrote:
> Monday, January 14, 2008, 2:00:04 PM, Randy wrote:
>
> > I have a file called MyGroup.MyPage.php which is in the local
> > directory that contains config.php. That file contains:
>
> > <?php if (!defined('PmWiki')) exit();
> > $FoxAuth='read';
>
> > I would think readers of MyGroup.MyPage would thus be able to post
> > regardless of what I do in config.php - but they can't unless I grant
> > the authorization to all pages in config.php as you described.
>
> I think the page local customisation php file gets loaded later than
> config.php, so setting $FoxAuth='read' there comes too late.
> I quote from PmWiki.PerGroupCustomizations:
>
> "Processing order. For all local customizations, PmWiki first processes
> the local/config.php file, and then looks for a per-page customization
> file in the local/ subdirectory to process, followed by any per-group
> customization file. If no per-page or per-group customizations are
> loaded, then PmWiki loads local/default.php. If a per-page
> customization wants to have the per-group customizations loaded first,
> it can do so directly by using PHP's include_once() function."
>
> Try this instead in config.php, before fox.php is included, as a page
> specific customisation:
>
> $page = PageVar($pagename, '$FullName');
> if ($page=='MyGroup.MyPage')
>     $FoxAuth = 'read';
>
> and replace MyGroup.MyPage with the specific full page name.
>

Just for reference, how would this be written if Randy wanted to set
$FoxAuth='read' for an entire group, rather than one specific page?
Would it be if($page=='MyGroup.*') ?



More information about the pmwiki-users mailing list