CML Reference Guide

Chapter 4.12:  Groups of People

[TOP] [UP] [PREV] [NEXT]

$peo_members(cnum)
Evaluates to a list of userids that are members of conference cnum.  The userids are sorted by "last name" of the actual users.

$peo_names(cnum names)
Evaluates to a list of userids of people who match names.  A person matches if every word in names is an initial substring of some part of their name.  If cnum is non-zero, matching people must also be a member of conference cnum.

$peo_access(cnum priv)
Evaluates to a space-separated list of userids of people who have access level priv in conference cnum.  The access level must be exact, i.e. not less than or greater than.  Access levels are defined as in $co_priv().

The list includes all userids in any referenced groups, sub-groups, etc.  It does not expand any wildcard references, but includes them literally in the returned list.  The userids need not actually exist (be registered) -- they are taken literally from the userlist and any referenced groups.

$all_users(match)
Evaluates to a list of all of the userids registered with Caucus that begin with the initial substring match.  If match is empty, evaluates to list of all of the Caucus userids.  (Even on a site with thousands of users, this function evaluates quickly.)

$in_group(userid gfile)
The In_group function, in combination with the Caucus "groups" files, acts as a simple kind of ACL (access control list) mechanism.  It evaluates to a number (the "match value") >= 1 if userid is found or matched in group file gfile, or any group file that gfile in turn includes.  Otherwise "0".

If userid is found by itself on a line, the match value is 1.  If userid is followed on the same line by a number or numbers, the match value is the bitwise "OR" of those numbers.  If userid is followed on the same line by one or more words, those words are translated into numbers (from the GroupPermNames parameter in swebd.conf), and then likewise "OR"ed together.

If the swebd.conf parameter GroupSearch is "ALL", $in_group() searches for all possible matches for userid, and similarly "OR"s them all together.  Otherwise, $in_group() just returns the first match. 

If you are using $in_group() simply to check if a user is in a group, then GroupSearch does not need to be set to "ALL", and in fact Caucus will run somewhat faster that way.  If, however, you use $in_group() for ACLs, and there's any chance at all that a userid will be listed more than once, you should definitely make sure that GroupSearch is set to "ALL".

$groupperm(permname...)
Translates group permission names (as in the groups files used by $in_group(), above) into their numerical equivalents.  Evaluates to the bitwise "OR" of the numeric values (from the swebd.conf parameter GroupPermNames) of the word(s) in permname.