Constants

CACHE_PREFIX

CACHE_PREFIX

Cache prefix.

CACHE_VERSION

CACHE_VERSION

Cache version.

Properties

$_ldap

$_ldap : \Horde_Ldap

Handle for the current LDAP connection.

Type

\Horde_Ldap

$_params

$_params : array

Any additional parameters for the driver.

Type

array

$_filter

$_filter : \Horde_Ldap_Filter

LDAP filter for searching groups.

Type

\Horde_Ldap_Filter

$_cache

$_cache : \Horde_Cache

Cache object.

Type

\Horde_Cache

Methods

__construct()

__construct(  $params = array()) 

Constructor.

Parameters

$params

readOnly()

readOnly() : boolean

Returns whether the group backend is read-only.

Returns

boolean

renameSupported()

renameSupported() : boolean

Returns whether groups can be renamed.

Returns

boolean

setCache()

setCache(\Horde_Cache  $cache) 

Sets a cache object.

Parameters

\Horde_Cache $cache

The cache object.

getCache()

getCache() : \Horde_Cache

Returns the cache object.

Returns

\Horde_Cache

create()

create(string  $name, string  $email = null) : mixed

Creates a new group.

Parameters

string $name

A group name.

string $email

The group's email address.

Throws

\Horde_Group_Exception

Returns

mixed —

The ID of the created group.

rename()

rename(mixed  $gid, string  $name) 

Renames a group.

Parameters

mixed $gid

A group ID.

string $name

The new name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

remove()

remove(mixed  $gid) 

Removes a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception

exists()

exists(mixed  $gid) : boolean

Checks if a group exists.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception

Returns

boolean —

True if the group exists.

getName()

getName(mixed  $gid) : string

Returns a group name.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

string —

The group's name.

getData()

getData(mixed  $gid) : array

Returns all available attributes of a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

array —

The group's data.

setData()

setData(mixed  $gid, array|string  $attribute, string  $value = null) 

Sets one or more attributes of a group.

Parameters

mixed $gid

A group ID.

array|string $attribute

An attribute name or a hash of attributes.

string $value

An attribute value if $attribute is a string.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

listAll()

listAll(string  $member = null) : array

Returns a list of all groups a user may see, with IDs as keys and names as values.

Parameters

string $member

Only return groups that this user is a member of.

Throws

\Horde_Group_Exception

Returns

array —

All existing groups.

listUsers()

listUsers(mixed  $gid) : array

Returns a list of users in a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

array —

List of group users.

listGroups()

listGroups(string  $user) : array

Returns a list of groups a user belongs to.

Parameters

string $user

A user name.

Throws

\Horde_Group_Exception

Returns

array —

A list of groups, with IDs as keys and names as values.

addUser()

addUser(mixed  $gid, string  $user) 

Add a user to a group.

Parameters

mixed $gid

A group ID.

string $user

A user name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

removeUser()

removeUser(mixed  $gid, string  $user) 

Removes a user from a group.

Parameters

mixed $gid

A group ID.

string $user

A user name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

search()

search(string  $name) : array

Searches for group names.

Parameters

string $name

A search string.

Throws

\Horde_Group_Exception

Returns

array —

A list of matching groups, with IDs as keys and names as values.

_create()

_create(string  $name, string  $email = null) : mixed

Creates a new group.

Parameters

string $name

A group name.

string $email

The group's email address.

Throws

\Horde_Group_Exception

Returns

mixed —

The ID of the created group.

_rename()

_rename(mixed  $gid, string  $name) 

Renames a group.

Parameters

mixed $gid

A group ID.

string $name

The new name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

_remove()

_remove(mixed  $gid) 

Removes a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception

_exists()

_exists(mixed  $gid) : boolean

Checks if a group exists.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception

Returns

boolean —

True if the group exists.

_getName()

_getName(mixed  $gid) : string

Returns a group name.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

string —

The group's name.

_getData()

_getData(mixed  $gid) : array

Returns all available attributes of a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

array —

The group's date.

_setData()

_setData(mixed  $gid, array|string  $attribute, string  $value = null) 

Sets one or more attributes of a group.

Parameters

mixed $gid

A group ID.

array|string $attribute

An attribute name or a hash of attributes.

string $value

An attribute value if $attribute is a string.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

_listAll()

_listAll() : array

Returns a list of all groups a user may see, with IDs as keys and names as values.

Throws

\Horde_Group_Exception

Returns

array —

All existing groups.

_listUsers()

_listUsers(mixed  $gid) : array

Returns a list of users in a group.

Parameters

mixed $gid

A group ID.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

Returns

array —

List of group users.

_listGroups()

_listGroups(string  $user) : array

Returns a list of groups a user belongs to.

Parameters

string $user

A user name.

Throws

\Horde_Group_Exception

Returns

array —

A list of groups, with IDs as keys and names as values.

_addUser()

_addUser(mixed  $gid, string  $user) 

Add a user to a group.

Parameters

mixed $gid

A group ID.

string $user

A user name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

_removeUser()

_removeUser(mixed  $gid, string  $user) 

Removes a user from a group.

Parameters

mixed $gid

A group ID.

string $user

A user name.

Throws

\Horde_Group_Exception
\Horde_Exception_NotFound

_search()

_search(string  $name) : array

Searches for group names.

Parameters

string $name

A search string.

Throws

\Horde_Group_Exception

Returns

array —

A list of matching groups, with IDs as keys and names as values.

_nextGid()

_nextGid() : integer

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

Throws

\Horde_Group_Exception

Returns

integer —

The next group ID.

_rebind()

_rebind(boolean  $write) 

Rebinds to the LDAP server.

Parameters

boolean $write

Whether to rebind for write access. Use false after finishing write actions.

Throws

\Horde_Ldap_Exception

_checkExistsCache()

_checkExistsCache(  $gid) 

Parameters

$gid

_sig()

_sig(string  $key) : string

Returns a full cache key.

Parameters

string $key

The internal key.

Returns

string —

The full key for Horde_Cache consumption.

_getListCache()

_getListCache(string  $user = null) : array

Returns the cached group list.

Parameters

string $user

A user name.

Returns

array —

The group list or null if not cached.

_setListCache()

_setListCache(array  $list, string  $user = null) 

Sets the cached group list.

Parameters

array $list

A group list.

string $user

A user name.

_dnForMail()

_dnForMail(string  $mail) : string

Tries to find a DN for a given kolab mail address.

Parameters

string $mail

The mail address to search for.

Throws

\Horde_Group_Exception

Returns

string —

The corresponding dn or false.