User management for the world wide web

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

GenieGate_Groups Class Reference

Class for working with UserGroups. More...

List of all members.

Public Member Functions

 GenieGate_Groups (&$dbh)
 Constructor.

 getMemberGroups ($uid)
 Return an associative array of groups this uid is a member of, the keys are the group ID's, the values are the group's symbolic names.

 getMemberGids ($uid)
 Like getMemberGids, except that it only returns the group IDŐs, not the whole group info.

 setMember ($uid, $gids)
 Sets member to a list of groups.

 getMembers ($gid)
 Get all the members of a given group ID.

 setGroup ($gid, $name, $can_signup)
 Create/Update a named group, if $gid already exists, the name (and $can_signup) are edited, if it does NOT exist, a new group is created.

 getGroupName ($gid)
 Get the group details for a group.

 getAllGroups ($show=TRUE)
 Get a list of all groups.

 removeGroup ($gid)
 Removes a group.

 addListener (&$listener)
 Add a listener.

 fireGroupNameChange ($gid, $name, $sign_ok, $is_new)
 Tell all listeners we've added/changed a group.

 fireGroupNameDelete ($gid, &$info)
 Tell all listeners that a group has been removed.

 fireUserGroupChange ($uid, &$old_groups, &$new_groups)
 Tell listeners about the new groups the user is part of.


Public Attributes

 $DBH
 mysql database link.

 $LISTENERS = array()
 List of listeners.


Detailed Description

Class for working with UserGroups.

Definition at line 5 of file Groups.php.


Constructor & Destructor Documentation

GenieGate_Groups &$  dbh  ) 
 

Constructor.

Parameters:
$dbh - The Database handle.

Definition at line 21 of file Groups.php.


Member Function Documentation

addListener &$  listener  ) 
 

Add a listener.

(plugins use)

Definition at line 210 of file Groups.php.

fireGroupNameDelete gid,
&$  info
 

Tell all listeners that a group has been removed.

*

Definition at line 221 of file Groups.php.

Referenced by removeGroup().

getAllGroups show = TRUE  ) 
 

Get a list of all groups.

Parameters:
$show - Request all groups. If FALSE, only self-signup groups listed.
Returns:
Associative arrays of all available groups, keyed on gid

Definition at line 172 of file Groups.php.

Referenced by setMember().

getGroupName gid  ) 
 

Get the group details for a group.

Parameters:
$gid - The group ID.
Returns:
An associative array containing the group info.

Definition at line 153 of file Groups.php.

Referenced by removeGroup(), and setGroup().

getMemberGroups uid  ) 
 

Return an associative array of groups this uid is a member of, the keys are the group ID's, the values are the group's symbolic names.

Parameters:
$uid - The user ID.
Returns:
Associative array of all the groups this $uid is a member of.

Definition at line 32 of file Groups.php.

removeGroup gid  ) 
 

Removes a group.

Parameters:
$gid - The group ID to remove.

Definition at line 195 of file Groups.php.

References fireGroupNameDelete(), and getGroupName().

setGroup gid,
name,
can_signup
 

Create/Update a named group, if $gid already exists, the name (and $can_signup) are edited, if it does NOT exist, a new group is created.

Parameters:
$gid - The group ID.
$name - The group Name.
$can_signup - Indicator flag, if TRUE, suggests users can sign themselves up.

Definition at line 123 of file Groups.php.

References fireGroupNameChange(), and getGroupName().

setMember uid,
gids
 

Sets member to a list of groups.

Note:
It's callers responsibility to ensure $uid is valid.
Parameters:
$uid - User ID to add it to.
$gids - List of the Group ID's make this $uid a part of.
Returns:
List of group ID's that were addded.

Definition at line 74 of file Groups.php.

References fireUserGroupChange(), getAllGroups(), and getMemberGids().


The documentation for this class was generated from the following file:
DoxyGen Documentation generated by DoxyGen