[pmwiki-devel] skin php question
Patrick R. Michaud
pmichaud at pobox.com
Wed May 30 10:30:08 CDT 2007
On Wed, May 30, 2007 at 12:08:54PM -0300, Guillermo Calderon - INCO wrote:
> The Editor wrote:
> > I have a condition in my skin php I'd like to change to a specific group. ie
> > from: if (CondAuth($pagename, 'edit') == true) ...
> > to: if (in_group @editors = true) ...
> > Can anyone suggest the code for this?
> > Cheers
> > Dan
> I have this code in my config.php:
> $Conditions['grp'] = '$GLOBALS["AuthList"]["@".$condparm] == 1';
> So, I can write something like:
> (:if grp editors:) .....
Better would be to test for '> 0' instead of '== 1'. (Yes, there
have been times when $AuthList has values other than 1,
although I don't know if that's currently the case.)
I think I would go with:
$Conditions['authgroup'] = '$GLOBALS["AuthList'][$condparm] > 0';
and then an author can write:
(:if authgroup @editors:)
(:if authgroup id:alice :)
The next step, of course, would be to have a way to specify multiple
values, as in:
(:if authgroup @editors, at authors,id:alice :)
More information about the pmwiki-devel