Group management
If you want to limit access to a specific group at USD, put the following before your “include” line, as in:
$gallow = "student";
or
$gallow = array("faculty", "employee");
As with users, you can use an array to specify multiple groups. Current groups allowed are ‘student’, ‘employee’, ‘faculty’, ‘site’, and ‘all’. You don’t normally need to use ‘all’ unless you have different levels of access and custom groups.
You can also deny access to a list of groups, using $gdeny instead of $gallow.
Custom groups
You can create a file that contains custom group names. Specify the file using “$cgfile”, as in:
<? $cgfile = "filepath"; $gallow = "groupname"; include('/web/includes/login.php'); ?>
Set up a group by placing the group name, a colon, a space, and then a number of usernames separated by spaces. For example:
Agents: smith brown johnson
If you have lots of users in a group, you can either have really long lines or break up the lines--just make sure that each line contains the group name and a colon-space as the first item.
Custom groups only supports $gallow. You cannot deny to custom groups using $gdeny.
Different content for different groups
You can display special content to each group. Use the “member” function to determine if the current user is a member of the group. For example:
<IF (member("Agents")):> <p>Agents should turn their timecards in to room 101.</p> <ENDIF;>
You can provide an array of groups to the member function, and if the current user is a member of any of those groups, it will return true.
Order of allows and denies
Groups are allowed first, then denied. Users are allowed after any groups, and then denied.
- Group allow (including custom groups)
- Group deny
- User allow
- User deny
The last item which matches is the one that counts. Thus, you can allow a group, and then allow users not in that group; or you can deny a group, and then selectively allow members who may or may not be in that group. And you can allow a group, and then deny users in that group.
By default, everyone is allowed. The presence of a group allow or a user allow makes everyone disallowed by default.
