[pmwiki-users] hide links for certain groups

Hans design5 at softflow.co.uk
Fri Apr 1 10:18:36 CDT 2011


Friday, April 1, 2011, 3:48:08 PM, Randy Brown wrote:

> But how would you test for authuser group membership using PHP code within config?

the $AuthList array holds the information.

for instance:
 Array
(
    [] => 1
    [nopass:] => 1
    [@nopass] => 1
    [id:hans] => 1
    [id:-hans] => -1
    [@admins] => 1
    [@editors] => 1
)

that is me logged in as hans, and I am member of auth groups
@admins and @editors, set in Site.AuthUser in my case, but could be
set in a different source I think.

this is $AuthList after logging out:
 Array
(
    [] => 1
    [nopass:] => 1
    [@nopass] => 1
)

the nopass denotes that there is no read password set on the page I am
viewing.

the conditional is just checking for a group name to be present (true)
in the array:
Conditions['authgroup'] = '(boolean)@$GLOBALS["AuthList"][\$condparm]';

but you could use $AuthList for checks directly in config.php.

  ~Hans




More information about the pmwiki-users mailing list