[pmwiki-users] To disable html markup on publically-editable pages

Lucian Wischik lu.gmane at wischik.com
Sat Nov 18 13:25:57 CST 2006


Lucian Wischik <lu.gmane <at> wischik.com> writes:
> Does it look correct, please?
> if (!CondAuth($pagename,"admin"))
> { $ROSPatterns["/(:html:)/i"] = "";
>   $ROSPatterns["/(:htmlend:)/i"] = "";
> }

Actually that's not quite right. The following is better.

array_unshift($EditFunctions, 'MaybeDisableEmbedhtml');
function MaybeDisableEmbedhtml($pagename,&$page,&$new)
{ if (!CondAuth($pagename,"admin")) {$ROSPatterns[]... as above}
}


Explanation: I'd like to put the html-ROSdisable-functions inside
local/farmconfig.php. But local/farmconfig is executed before
local/config.php, ie. before passwords and authentication have been
set up. So I need to do my CondAuth test later on. At the start of 
"EditFunctions" is a good time to do it.

-- 
Lucian





More information about the pmwiki-users mailing list