[pmwiki-users] Find out users authorization in PHP when loading page

Peter Bowers pbowers at pobox.com
Tue Feb 21 06:46:59 CST 2012


On Tue, Feb 21, 2012 at 12:47 AM, Patrick R. Michaud <pmichaud at pobox.com>wrote:

> The CondAuth() function does what you want:
>
>    if (CondAuth($pagename, 'edit')) { ... }
>

When using CondAuth() or other similar functions [1] it's important to
remember to place them as late as possible in your config.php to avoid
various caching issues which can be very difficult to troubleshoot
otherwise.

See http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-order.

-Peter

[1] ResolvePageName(), CondAuth(), PageTextVar(), PageVar(),
RetrieveAuthPage() or others -- basically anything that is likely to
require the reading of a page during the processing of the function.  (That
list of functions pasted from the link above.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20120221/a0ab6a71/attachment.html>


More information about the pmwiki-users mailing list