[pmwiki-users] conditional change of variable (sectionedit)

H. Fox haganfox at users.sourceforge.net
Sun Apr 2 16:37:46 CDT 2006


On 4/2/06, noskule <noskule at gmx.net> wrote:
> hi list
> I would like to do a farmconfig entry that means:
>
> if !auth edit
>
> $SectionEditWithoutHeaders = true;
>
> this sould automaticly disables all sectionedit links if the user has no edit permission.
>
> Is this possible? If yes, could please some php crack provide my with a codesnip

If any of your default passwords are in local/config.php, then code
like that can't happen in farmconfig.php.

I think that type of code belongs in the recipe (where the recipe
after any lines involving authentication) script or possibly even in
skin.php

http://www.pmwiki.org/wiki/PmWiki/WikiCascades

(Should pub/skins/{$Skin}/skin.php be added to the list on that page?)

The code for the equivalent to (:if !auth edit:) is

$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
if (!@$page['=auth']['edit']) {
  $SectionEditWithoutHeaders = true;
}

Hagan




More information about the pmwiki-users mailing list