Class Group_sql

Description

The Group:: class provides the Horde groups system.

$Horde: framework/Group/Group/sql.php,v 1.1.2.12 2009/02/25 05:35:42 chuck 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/sql.php (line 16)

Group
   |
   --Group_sql
Variable Summary
 boolean $_connected
 DB $_db
Method Summary
 Group_sql Group_sql ( $params)
 void addGroup ( &$group, SQLObject_Group $group)
 string encodeName (string $name)
 boolean exists (string $group)
 void &getGroup (string $name)
 void &getGroupById (integer $cid)
 integer getGroupId (string|SQLObject_Group $group)
 array getGroupMemberships (string $user, [boolean $parentGroups = false])
 string getGroupName (integer|SQLObject_Group $gid)
 integer getGroupParent (integer $gid)
 array getGroupParentList (integer $gid)
 array getGroupParents (integer $gid)
 The getGroupShortName (string $group)
 array listAllUsers ( $gid, integer $group)
 array listGroups ([boolean $refresh = false])
 SQLObject_Group &newGroup (string $name, [string $parent = GROUP_ROOT])
 void removeGroup (SQLObject_Group $group, [boolean $force = false])
 void shutdown ()
 void updateGroup (SQLObject_Group $group)
 boolean userIsInGroup (string $user, integer $gid, [boolean $subgroups = true])
 boolean _connect ()
 array _getGroupParentNameList ( $name, integer $gid)
 array _getGroupParents (string $child)
 void _getParents ( $parents)
 array __sleep ()
 void __wakeup ()
Variables
boolean $_connected = false (line 23)

Boolean indicating whether or not we're connected to the SQL server.

DB $_db (line 30)

Handle for the current database connection.

DB $_write_db (line 38)

Handle for the current database connection, used for writing. Defaults to the same handle as $db if a separate write database is not required.

Inherited Variables

Inherited from Group

Group::$_datatree
Group::$_groupCache
Group::$_groupList
Group::$_groupMap
Group::$_groupParentList
Group::$_groupParents
Group::$_params
Group::$_parentTree
Group::$_subGroups
Group::$_userGroups
Methods
Constructor Group_sql (line 43)

Constructor.

Group_sql Group_sql ( $params)
  • $params
addGroup (line 200)

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 ( &$group, SQLObject_Group $group)

Redefinition of:
Group::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.
encodeName (line 78)

Replace all occurences of ':' in an object name with '.'.

  • return: The encoded name.
string encodeName (string $name)
  • string $name: The name of the object.
exists (line 421)

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.

Redefinition of:
Group::exists()
Check if a group exists in the system.
getGroup (line 112)

Returns a SQLObject_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.

Redefinition of:
Group::getGroup()
Returns a DataTreeObject_Group object corresponding to the named group, with the users and other data retrieved appropriately.
getGroupById (line 154)

Returns a SQLObject_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.

Redefinition of:
Group::getGroupById()
Returns a DataTreeObject_Group object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getGroupId (line 392)

Retrieves the ID of a group.

  • return: The group's ID.
integer getGroupId (string|SQLObject_Group $group)
  • string|SQLObject_Group $group: The group name or object to retrieve the ID for.

Redefinition of:
Group::getGroupId()
Retrieves the ID of a group.
getGroupMemberships (line 629)

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?

Redefinition of:
Group::getGroupMemberships()
Get a list of every group that $user is in.
getGroupName (line 347)

Retrieves the name of a group.

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

Redefinition of:
Group::getGroupName()
Retrieves the name of a group.
getGroupParent (line 496)

Returns the single parent ID of the given group.

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

Redefinition of:
Group::getGroupParent()
Returns the single parent ID of the given group.
getGroupParentList (line 524)

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.

Redefinition of:
Group::getGroupParentList()
Returns a flat list of the parents of a child group
getGroupParents (line 441)

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.

Redefinition of:
Group::getGroupParents()
Returns a tree of the parents of a child group.
getGroupShortName (line 372)

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.

Redefinition of:
Group::getGroupShortName()
Strips all parent references off of the given group name.
listAllUsers (line 602)

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

Redefinition of:
Group::listAllUsers()
Get a list of every user that is part of the specified group and any of its subgroups.
listGroups (line 583)

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.

Redefinition of:
Group::listGroups()
Returns a list of all groups, in the format id => groupname.
newGroup (line 91)

Returns a new group object.

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

Redefinition of:
Group::newGroup()
Returns a new group object.
removeGroup (line 304)

Removes a group from the groups system permanently.

void removeGroup (SQLObject_Group $group, [boolean $force = false])
  • SQLObject_Group $group: The group to remove.
  • boolean $force: Force to remove every child.

Redefinition of:
Group::removeGroup()
Removes a group from the groups system permanently.
shutdown (line 67)

Stores the object in the session cache.

void shutdown ()

Redefinition of:
Group::shutdown()
Stores the object in the session cache.
updateGroup (line 254)

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

void updateGroup (SQLObject_Group $group)

Redefinition of:
Group::updateGroup()
Stores updated data - users, etc. - of a group to the backend system.
userIsInGroup (line 673)

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.

Redefinition of:
Group::userIsInGroup()
Say if a user is a member of a group or not.
_connect (line 703)

Attempts to open a persistent connection to the sql server.

  • return: True on success; exits (Horde::fatal()) on error.
boolean _connect ()
_getGroupParentNameList (line 562)

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 _getGroupParentNameList ( $name, integer $gid)
  • integer $gid: The id of the group.
  • $name
_getGroupParents (line 464)

Returns a list of parent permissions.

  • return: A hash with all parents in a tree format.
array _getGroupParents (string $child)
  • string $child: The name of the child to retrieve parents for.
_getParents (line 475)
void _getParents ( $parents)
  • $parents
__sleep (line 60)

Returns the properties that need to be serialized.

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

Redefinition of:
Group::__sleep()
Returns the properties that need to be serialized.
__wakeup (line 51)

Initializes the object.

void __wakeup ()

Redefinition of:
Group::__wakeup()
Initializes the object.

Inherited Methods

Inherited From Group

 Group::Group()
 Group::addGroup()
 Group::exists()
 Group::factory()
 Group::getGroup()
 Group::getGroupById()
 Group::getGroupId()
 Group::getGroupMemberships()
 Group::getGroupName()
 Group::getGroupParent()
 Group::getGroupParentList()
 Group::getGroupParents()
 Group::getGroupShortName()
 Group::getGUID()
 Group::getLevel()
 Group::listAllUsers()
 Group::listGroups()
 Group::listUsers()
 Group::newGroup()
 Group::removeGroup()
 Group::shutdown()
 Group::singleton()
 Group::updateGroup()
 Group::userIsInGroup()
 Group::_loadDriver()
 Group::__sleep()
 Group::__wakeup()

Documentation generated on Sun, 30 Jan 2011 05:21:40 +0000 by phpDocumentor 1.4.3