[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Group.php (sommaire)

(pas de description)

Poids: 711 lignes (21 kb)
Inclus ou requis: 9 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

Group:: (24 méthodes):
  Group()
  newGroup()
  getGroup()
  getGroupById()
  getGUID()
  addGroup()
  updateGroup()
  renameGroup()
  removeGroup()
  getGroupName()
  getGroupShortName()
  getGroupId()
  exists()
  getGroupParents()
  getGroupParent()
  getGroupParentList()
  listGroups()
  listUsers()
  listAllUsers()
  getGroupMemberships()
  userIsInGroup()
  getLevel()
  factory()
  singleton()

DataTreeObject_Group:: (12 méthodes):
  DataTreeObject_Group()
  setGroupOb()
  getId()
  save()
  addUser()
  removeUser()
  listUsers()
  listAllUsers()
  getAuditLog()
  clearAuditLog()
  _toAttributes()
  _fromAttributes()


Classe: Group  - X-Ref

The Group:: class provides the Horde groups system.

$Horde: framework/Group/Group.php,v 1.67.2.15 2006/07/17 14:40:19 jan Exp $

Copyright 1999-2006 Stephane Huther <shuther@bigfoot.com>
Copyright 2001-2006 Chuck Hagenbuch <chuck@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.

Group()   X-Ref
Constructor


newGroup($name, $parent = DATATREE_ROOT)   X-Ref
Return a new group object.

param: string $name    The group's name.
param: string $parent  The group's parent's name.
return: DataTreeObject_Group  A new group object.

getGroup($name)   X-Ref
Return a DataTreeObject_Group object corresponding to the named
group, with the users and other data retrieved appropriately.

param: string $name The name of the group to retrieve.

getGroupById($cid)   X-Ref
Return a DataTreeObject_Group object corresponding to the given
unique ID, with the users and other data retrieved
appropriately.

param: integer $cid  The unique ID of the group to retrieve.

getGUID($group)   X-Ref
Get a globally unique ID for a group.

param: DataTreeObject_Group $group  The group.
return: string  A GUID referring to $group.

addGroup($group)   X-Ref
Add 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.

param: DataTreeObject_Group $group  The new group object.

updateGroup($group)   X-Ref
Store updated data - users, etc. - of a group to the backend system.

param: DataTreeObject_Group $group  The group to update.

renameGroup($group, $newName)   X-Ref
Change the name of a group without changing its contents or
where it is in the groups hierarchy.

param: DataTreeObject_Group $group  The group to rename.
param: string $newName              The group's new name.

removeGroup($group, $force = false)   X-Ref
Remove a group from the groups system permanently.

param: DataTreeObject_Group $group  The group to remove.
param: boolean $force               Force to remove every child.

getGroupName($gid)   X-Ref
Retrieve the name of a group.

param: integer $gid  The id of the group to retrieve the name for.
return: string  The group's name.

getGroupShortName($group)   X-Ref
Strips all parent references off of the given group name.

param: string $group  Name of the group.
return: The name of the group without parents.

getGroupId($group)   X-Ref
Retrieve the ID of a group.

param: string $group  The group to retrieve the ID for.
return: integer  The group's ID.

exists($group)   X-Ref
Check if a group exists in the system.

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

getGroupParents($gid)   X-Ref
Get a list of the parents of a child group.

param: integer $gid The id of the child group.
return: array

getGroupParent($gid)   X-Ref
Return the single parent of the given group.

param: integer $gid  The DataTree ID of the child group.
return: the parent of the given group.

getGroupParentList($gid)   X-Ref
Get a list of parents all the way up to the root object for $group.

param: integer $gid  The id of the group.
return: array  A flat list of all of the parents of $group,

listGroups($refresh = false)   X-Ref
Get a list of every group, in the format cid => groupname.

param: boolean $refresh  If true, the cached value is ignored and the group
return: array  CID => groupname hash.

listUsers($gid)   X-Ref
Get a list of every user that is a part of this group ONLY.

param: integer $gid  The ID of the group.
return: array  The user list.

listAllUsers($gid)   X-Ref
Get a list of every user that is part of the specified group
and any of its subgroups.

param: integer $group  The ID of the parent group.
return: array  The complete user list.

getGroupMemberships($user, $parentGroups = false)   X-Ref
Get a list of every group that $user is in.

param: string  $user          The user to get groups for.
param: boolean $parentGroups  Also return the parents of any groups?
return: array  An array of all groups the user is in.

userIsInGroup($user, $gid, $subgroups = true)   X-Ref
Say if a user is a member of a group or not.

param: string $user        The name of the user.
param: integer $gid        The ID of the group.
param: boolean $subgroups  Return true if the user is in any subgroups
return: boolean

getLevel($gid)   X-Ref
Returns the DataTree level of the given group. 0 is returned for
and object directly below DATATREE_ROOT.

param: integer $gid  The DataTree ID of the group.
return: The DataTree level of the group.

factory($driver = '', $params = null)   X-Ref
Attempts to return a concrete Group instance based on $driver.

param: mixed $driver  The type of concrete Group subclass to return.
param: array $params  A hash containing any additional configuration or
return: Group  The newly created concrete Group instance, or a

singleton()   X-Ref
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: Group  The concrete Group reference, or false on an error.

Classe: DataTreeObject_Group  - X-Ref

Extension of the DataTreeObject class for storing Group information
in the Categories driver. If you want to store specialized Group
information, you should extend this class instead of extending
DataTreeObject directly.

DataTreeObject_Group($name)   X-Ref
The DataTreeObject_Group constructor. Just makes sure to call
the parent constructor so that the group's name is set
properly.

param: string $name  The name of the group.

setGroupOb(&$groupOb)   X-Ref
Associates a Group object with this group.

param: Group $groupOb  The Group object.

getId()   X-Ref
Fetch the ID of this group

return: string The group's ID

save()   X-Ref
Save any changes to this object to the backend permanently.


addUser($username, $update = true)   X-Ref
Adds a user to this group, and makes sure that the backend is
updated as well.

param: string $username The user to add.

removeUser($username, $update = true)   X-Ref
Removes a user from this group, and makes sure that the backend
is updated as well.

param: string $username The user to remove.

listUsers()   X-Ref
Get a list of every user that is a part of this group
(and only this group)

return: array  The user list

listAllUsers()   X-Ref
Get a list of every user that is a part of this group and
any of it's subgroups

return: array  The complete user list

getAuditLog()   X-Ref
Get all the users recently added or removed from the group.


clearAuditLog()   X-Ref
Clears the audit log. To be called after group update.


_toAttributes()   X-Ref
Map this object's attributes from the data array into a format
that we can store in the attributes storage backend.

return: array  The attributes array.

_fromAttributes($attributes)   X-Ref
Take in a list of attributes from the backend and map it to our
internal data array.

param: array $attributes  The list of attributes from the



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7