Class Group_ldap

Description

The Group_ldap class provides an LDAP backend for the Horde groups system.

$Horde: framework/Group/Group/ldap.php,v 1.18.2.15 2009/04/04 10:10:54 jan Exp $

Copyright 2005-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/ldap.php (line 17)

Group
   |
   --Group_ldap
Direct descendents
Class Description
 class Group_kolab The Group_kolab class provides a Kolab backend for the Horde groups system.
Variable Summary
 mixed $_ds
 mixed $_filter
 mixed $_params
Method Summary
 Group_ldap Group_ldap ( $params)
 mixed addGroup (LDAP_Group $group)
 boolean exists (string $group)
 LDAP_Group &getGroup (string $name)
 LDAP_Object &getGroupById (string $dn)
 string getGroupId (mixed $group)
 array getGroupMemberships (string $user, [boolean $parentGroups = false])
 string getGroupName (string $dn)
 string getGroupParent (string $dn)
 array getGroupParentList (string $dn)
 array getGroupParents (string $dn)
 string getGroupShortName (string $group)
 string getGUID (LDAP_Object $group)
 intenger getLevel (string $dn)
 array listAllUsers (string $dn)
 array listGroups ([boolean $refresh = false])
 LDAP_Group &newGroup (string $name, [string $parent = null])
 mixed removeGroup (LDAP_Group $group, [boolean $force = false])
 mixed updateGroup (LDAP_Object $group)
 boolean _connect ()
 void _nextGid ()
 mixed _recursive_delete ( $dn)
Variables
mixed $_ds (line 22)

LDAP connection handle

mixed $_filter (line 33)

Generated LDAP filter based on the config parameters

mixed $_params (line 28)

Local copy of the global $conf['group']['params'] array. Simply for coding convenience.


Redefinition of:
Group::$_params
Group driver parameters

Inherited Variables

Inherited from Group

Group::$_datatree
Group::$_groupCache
Group::$_groupList
Group::$_groupMap
Group::$_groupParentList
Group::$_groupParents
Group::$_parentTree
Group::$_subGroups
Group::$_userGroups
Methods
Constructor Group_ldap (line 38)

Constructor.

Group_ldap Group_ldap ( $params)
  • $params
addGroup (line 295)

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.

  • return: True if successful, PEAR_Error otherwise.
mixed addGroup (LDAP_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.

Redefined in descendants as:
  • 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.
exists (line 474)

Check if a group exists in the system.

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

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

Return an LDAP_Group object corresponding to the named group, with the users and other data retrieved appropriately.

  • return: The requested group.
LDAP_Group &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 229)

Return an LDAP_Object object corresponding to the given dn, with the users and other data retrieved appropriately.

  • return: The requested group.
LDAP_Object &getGroupById (string $dn)
  • string $dn: The dn 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.

Redefined in descendants as:
  • Group_kolab::getGroupById() : Return a Kolab_Group object corresponding to the given dn, with the users and other data retrieved appropriately.
getGroupId (line 439)

Retrieve the ID of the given group.

NOTE: If given a group name, this function can be unreliable if more than one group exists with the same name.

  • return: The group's ID.
string getGroupId (mixed $group)
  • mixed $group: LDAP_Group object, or a group name (string)

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

Redefined in descendants as:
getGroupMemberships (line 665)

Get a list of every group that the given user is a member of.

  • 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.

Redefined in descendants as:
getGroupName (line 404)

Retrieve the name of a group.

  • return: The group's name.
string getGroupName (string $dn)
  • string $dn: The dn of the group to retrieve the name for.

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

Get the parent of the given group.

  • return: The dn of the parent group.
string getGroupParent (string $dn)
  • string $dn: The dn of the child group.

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

Redefined in descendants as:
getGroupParentList (line 551)

Get a list of parents all the way up to the root object for the given group.

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

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

Redefined in descendants as:
getGroupParents (line 506)

Get a list of the parents of a child group.

  • return: Nested array of parents
array getGroupParents (string $dn)
  • string $dn: The fully qualified group dn

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

Redefined in descendants as:
getGroupShortName (line 424)

DataTreeObject full names include references to parents, but LDAP does not have this concept. This function simply returns the $group parameter and is included for compatibility with the Group class.

string getGroupShortName (string $group)
  • string $group: Group name.

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

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.

  • return: a GUID referring to $group.
string getGUID (LDAP_Object $group)
  • LDAP_Object $group: The group.

Redefinition of:
Group::getGUID()
Returns a globally unique ID for a group.
getLevel (line 720)

Returns the tree depth of the given group, relative to the base dn.

  1. is returned for any object directly below the base dn.

  • return: The tree depth of the group.
intenger getLevel (string $dn)
  • string $dn: The dn of the object.

Redefinition of:
Group::getLevel()
Returns the nesting level of the given group. 0 is returned for any object directly below GROUP_ROOT.
listAllUsers (line 624)

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 (string $dn)
  • string $dn: The dn of the parent group.

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)

Get a list of every group, in the format dn => groupname.

  • return: dn => 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 182)

Return a new group object.

  • return: A new group object.
LDAP_Group &newGroup (string $name, [string $parent = null])
  • string $name: The group's name.
  • string $parent: The group's parent's ID (DN)

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

Redefined in descendants as:
removeGroup (line 373)

Remove a group from the groups system permanently.

  • return: True on success, PEAR_Error otherwise.
mixed removeGroup (LDAP_Group $group, [boolean $force = false])
  • LDAP_Group $group: The group to remove.
  • boolean $force: Recursively delete children groups if true.

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

Redefined in descendants as:
updateGroup (line 328)

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

  • return: True on success, PEAR_Error otherwise.
mixed updateGroup (LDAP_Object $group)
  • LDAP_Object $group: The group to update

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

Redefined in descendants as:
_connect (line 69)

Connects to the LDAP server.

  • return: True or False based on success of connect and bind.
boolean _connect ()
_nextGid (line 144)

Searches existing groups for the highest gidnumber, and returns one higher.

void _nextGid ()
_recursive_delete (line 117)

Recursively deletes $dn. $this->_ds MUST already be connected.

  • return: True if delete was successful, PEAR_Error otherwise.
mixed _recursive_delete ( $dn)
  • $dn

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:19:06 +0000 by phpDocumentor 1.4.3