Class Group

Description

The Group:: class provides the Horde groups system.

$Horde: framework/Group/Group.php,v 1.67.2.22 2009/01/06 15:23:08 jan Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Group/Group.php (line 26)


	
			
Direct descendents
Class Description
 class Group_hooks The Group_hooks:: class provides the Horde groups system with the addition of adding support for hook functions to define if a user is in a group.
 class Group_ldap The Group_ldap class provides an LDAP backend for the Horde groups system.
 class Group_mock The Group:: class provides the Horde groups system.
 class Group_sql The Group:: class provides the Horde groups system.
Variable Summary
Method Summary
 Group Group ( $params)
 boolean exists (string $group)
 Group &factory ([mixed $driver = ''], [array $params = null])
 void &getGroup (string $name)
 void &getGroupById (integer $cid)
 integer getGroupId (string|DataTreeObject_Group $group)
 array getGroupMemberships (string $user, [boolean $parentGroups = false])
 string getGroupName (integer|DataTreeObject_Group $gid)
 integer getGroupParent (integer $gid)
 array getGroupParentList (integer $gid)
 array getGroupParents (integer $gid)
 The getGroupShortName (string $group)
 string getGUID (DataTreeObject_Group $group)
 The getLevel (integer $gid)
 array listAllUsers ( $gid, integer $group)
 array listGroups ([boolean $refresh = false])
 array listUsers (integer $gid)
 DataTreeObject_Group &newGroup (string $name, [string $parent = GROUP_ROOT])
 void removeGroup (DataTreeObject_Group $group, [boolean $force = false])
 void shutdown ()
 boolean userIsInGroup (string $user, integer $gid, [boolean $subgroups = true])
 void _loadDriver ( $driver)
 array __sleep ()
 void __wakeup ()
Variables
DataTree $_datatree (line 40)

Pointer to a DataTree instance to manage the different groups.

array $_groupCache = array() (line 47)

Cache of previously retrieved group objects.

array $_groupList (line 61)

Id-name-hash of all existing groups.

array $_groupMap = array() (line 54)

Id-name-map of already cached group objects.

array $_groupParentList = array() (line 91)

Cache of parent group trees.

This is an array with group IDs as keys and id-name-hashes of all parents as values.

array $_groupParents = array() (line 80)

Cache of parent groups.

This is an array with group IDs as keys and the integer group id of the direct parent as values.

array $_params (line 33)

Group driver parameters


Redefined in descendants as:
  • Group_ldap::$_params : Local copy of the global $conf['group']['params'] array. Simply for coding convenience.
array $_parentTree = array() (line 99)

Cache of parents tree.

array $_subGroups = array() (line 69)

List of sub groups.

array $_userGroups (line 107)

Hash of groups of certain users.

  • see: getGroupMemberShips()
Methods
Constructor Group (line 112)

Constructor.

Group Group ( $params)
  • $params
addGroup (line 224)

Adds a group to the groups system. The group must first be created with Group::newGroup(), and have any initial users added to it, before this function is called.

void addGroup (DataTreeObject_Group $group)

Redefined in descendants as:
  • Group_ldap::addGroup() : Add a group to the groups system. The group must first be created with Group_ldap::newGroup(), and have any initial users added to it, before this function is called.
  • Group_kolab::addGroup() : Adds a group to the groups system. The group must first be created with Group::newGroup(), and have any initial users added to it, before this function is called.
  • Group_mock::addGroup() : Adds a group to the groups system. The group must first be created with Group::newGroup(), and have any initial users added to it, before this function is called.
  • Group_sql::addGroup() : Adds a group to the groups system. The group must first be created with Group::newGroup(), and have any initial users added to it, before this function is called.
exists (line 379)

Check if a group exists in the system.

  • return: True if the group exists, false otherwise.
boolean exists (string $group)
  • string $group: The group to check.

Redefined in descendants as:
factory (line 633)

Attempts to return a concrete Group instance based on $driver.

  • return: The newly created concrete Group instance, or a PEAR_Error object on an error.
Group &factory ([mixed $driver = ''], [array $params = null])
  • mixed $driver: The type of concrete Group subclass to return.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getGroup (line 169)

Returns a DataTreeObject_Group object corresponding to the named group, with the users and other data retrieved appropriately.

void &getGroup (string $name)
  • string $name: The name of the group to retrieve.

Redefined in descendants as:
  • Group_ldap::getGroup() : Return an LDAP_Group object corresponding to the named group, with the users and other data retrieved appropriately.
  • Group_mock::getGroup() : Returns a DataTreeObject_Group object corresponding to the named group, with the users and other data retrieved appropriately.
  • Group_sql::getGroup() : Returns a SQLObject_Group object corresponding to the named group, with the users and other data retrieved appropriately.
getGroupById (line 188)

Returns a DataTreeObject_Group object corresponding to the given unique ID, with the users and other data retrieved appropriately.

void &getGroupById (integer $cid)
  • integer $cid: The unique ID of the group to retrieve.

Redefined in descendants as:
  • Group_ldap::getGroupById() : Return an LDAP_Object object corresponding to the given dn, with the users and other data retrieved appropriately.
  • Group_kolab::getGroupById() : Return a Kolab_Group object corresponding to the given dn, with the users and other data retrieved appropriately.
  • Group_mock::getGroupById() : Returns a DataTreeObject_Group object corresponding to the given unique ID, with the users and other data retrieved appropriately.
  • Group_sql::getGroupById() : Returns a SQLObject_Group object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getGroupId (line 352)

Retrieves the ID of a group.

  • return: The group's ID.
integer getGroupId (string|DataTreeObject_Group $group)

Redefined in descendants as:
getGroupMemberships (line 526)

Get a list of every group that $user is in.

  • return: An array of all groups the user is in.
array getGroupMemberships (string $user, [boolean $parentGroups = false])
  • string $user: The user to get groups for.
  • boolean $parentGroups: Also return the parents of any groups?

Redefined in descendants as:
getGroupName (line 316)

Retrieves the name of a group.

  • return: The group's name.
string getGroupName (integer|DataTreeObject_Group $gid)
  • integer|DataTreeObject_Group $gid: The id of the group or the group object to retrieve the name for.

Redefined in descendants as:
getGroupParent (line 418)

Returns the single parent ID of the given group.

  • return: The parent of the given group.
integer getGroupParent (integer $gid)
  • integer $gid: The DataTree ID of the child group.

Redefined in descendants as:
getGroupParentList (line 439)

Returns a flat list of the parents of a child group

  • return: A flat list of all of the parents of $group, hashed in $id => $name format.
array getGroupParentList (integer $gid)
  • integer $gid: The id of the group.

Redefined in descendants as:
getGroupParents (line 397)

Returns a tree of the parents of a child group.

  • return: The group parents tree, with groupnames as the keys.
array getGroupParents (integer $gid)
  • integer $gid: The id of the child group.

Redefined in descendants as:
getGroupShortName (line 339)

Strips all parent references off of the given group name.

  • return: name of the group without parents.
The getGroupShortName (string $group)
  • string $group: Name of the group.

Redefined in descendants as:
getGUID (line 212)

Returns a globally unique ID for a group.

  • return: A GUID referring to $group.
string getGUID (DataTreeObject_Group $group)

Redefined in descendants as:
  • Group_ldap::getGUID() : Get a globally unique ID for a group. This really just returns the dn for the group, but is included for compatibility with the Group class.
getLevel (line 595)

Returns the nesting level of the given group. 0 is returned for any object directly below GROUP_ROOT.

  • return: DataTree level of the group.
The getLevel (integer $gid)
  • integer $gid: The DataTree ID of the group.

Redefined in descendants as:
  • Group_ldap::getLevel() : Returns the tree depth of the given group, relative to the base dn.
  • Group_mock::getLevel() : Returns the nesting level of the given group. 0 is returned for any object directly below GROUP_ROOT.
listAllUsers (line 500)

Get a list of every user that is part of the specified group and any of its subgroups.

  • return: The complete user list.
array listAllUsers ( $gid, integer $group)
  • integer $group: The ID of the parent group.
  • $gid

Redefined in descendants as:
listGroups (line 460)

Returns a list of all groups, in the format id => groupname.

  • return: ID => groupname hash.
array listGroups ([boolean $refresh = false])
  • boolean $refresh: If true, the cached value is ignored and the group list is refreshed from the group backend.

Redefined in descendants as:
listUsers (line 477)

Get a list of every user that is a part of this group ONLY.

  • return: The user list.
array listUsers (integer $gid)
  • integer $gid: The ID of the group.

Redefined in descendants as:
newGroup (line 148)

Returns a new group object.

  • return: A new group object.
DataTreeObject_Group &newGroup (string $name, [string $parent = GROUP_ROOT])
  • string $name: The group's name.
  • string $parent: The group's parent's name.

Redefined in descendants as:
removeGroup (line 288)

Removes a group from the groups system permanently.

void removeGroup (DataTreeObject_Group $group, [boolean $force = false])

Redefined in descendants as:
shutdown (line 604)

Stores the object in the session cache.

void shutdown ()

Redefined in descendants as:
singleton (line 658)

Attempts to return a reference to a concrete Group instance.

It will only create a new instance if no Group instance currently exists.

This method must be invoked as: $var = &Group::singleton()

  • return: The concrete Group reference, or false on an error.
Group &singleton ()
updateGroup (line 257)

Stores updated data - users, etc. - of a group to the backend system.

void updateGroup (DataTreeObject_Group $group)

Redefined in descendants as:
userIsInGroup (line 565)

Say if a user is a member of a group or not.

boolean userIsInGroup (string $user, integer $gid, [boolean $subgroups = true])
  • string $user: The name of the user.
  • integer $gid: The ID of the group.
  • boolean $subgroups: Return true if the user is in any subgroups of group with ID $gid, also.

Redefined in descendants as:
_loadDriver (line 697)
void _loadDriver ( $driver)
  • $driver
__sleep (line 615)

Returns the properties that need to be serialized.

  • return: List of serializable properties.
array __sleep ()

Redefined in descendants as:
__wakeup (line 121)

Initializes the object.

void __wakeup ()

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:17:53 +0000 by phpDocumentor 1.4.3