Properties

$_shareCallback

$_shareCallback : callback

A function to be called when a Horde_Share object is needed and not available.

Type

callback

$_shareOb

$_shareOb : \Horde_Share

The Horde_Share object which this share is associated with.

If this is empty, the $_shareCallback is called to obtain it.

Type

\Horde_Share

Methods

setShareOb()

setShareOb(  $shareOb) 

Associates a Share object with this share, or provides a callback that knows how to provide it.

Parameters

$shareOb

getShareOb()

getShareOb() : \Horde_Share

Obtain this object's share driver.

Returns

\Horde_Share —

The share driver.

set()

set(string  $attribute, mixed  $value, boolean  $update = false) : boolean

Sets an attribute value in this object.

Parameters

string $attribute

The attribute to set.

mixed $value

The value for $attribute.

boolean $update

Immediately update only this change.

Returns

boolean

get()

get(string  $attribute) : mixed

Returns an attribute value from this object.

Parameters

string $attribute

The attribute to return.

Returns

mixed —

The value for $attribute.

getId()

getId() : string

Returns the ID of this share.

Returns

string —

The share's ID.

getName()

getName() : string

Returns the name of this share.

Returns

string —

The share's name.

save()

save() : boolean

Saves the current attribute values.

Throws

\Horde_Exception

Returns

boolean

toHash()

toHash() : array

Exports the share object as a PHP hash.

Returns

array —

Hash representation of this share.

addUserPermission()

addUserPermission(string  $userid, integer  $permission) 

Gives a user a certain privilege for this share.

Parameters

string $userid

The userid of the user.

integer $permission

A Horde_Perms::* constant.

removeUserPermission()

removeUserPermission(string  $userid, integer  $permission) 

Removes a certain privilege for a user from this share.

Parameters

string $userid

The userid of the user.

integer $permission

A Horde_Perms::* constant.

addGroupPermission()

addGroupPermission(string  $group, integer  $permission) 

Gives a group certain privileges for this share.

Parameters

string $group

The group to add permissions for.

integer $permission

A Horde_Perms::* constant.

removeGroupPermission()

removeGroupPermission(string  $group, \constant  $permission) 

Removes a certain privilege from a group.

Parameters

string $group

The group to remove permissions from.

\constant $permission

A Horde_Perms::* constant.

removeUser()

removeUser(string  $userid) 

Removes a user from this share.

Parameters

string $userid

The userid of the user to remove.

removeGroup()

removeGroup(integer  $groupId) 

Removes a group from this share.

Parameters

integer $groupId

The group to remove.

listUsers()

listUsers(integer  $perm_level = null) : array

Returns an array containing all the userids of the users with access to this share.

Parameters

integer $perm_level

List only users with this permission level. Defaults to all users.

Returns

array —

The users with access to this share.

listGroups()

listGroups(integer  $perm_level = null) : array

Returns an array containing all the groupids of the groups with access to this share.

Parameters

integer $perm_level

List only users with this permission level. Defaults to all users.

Returns

array —

The IDs of the groups with access to this share.

addGuestPermission()

addGuestPermission(integer  $permission) 

Gives guests a certain privilege for this share.

Parameters

integer $permission

A Horde_Perms::* constant.

removeGuestPermission()

removeGuestPermission(integer  $permission) 

Removes a certain privilege for guests from this share.

Parameters

integer $permission

A Horde_Perms::* constant.

addCreatorPermission()

addCreatorPermission(integer  $permission) 

Gives creators a certain privilege for this share.

Parameters

integer $permission

A Horde_Perms::* constant.

removeCreatorPermission()

removeCreatorPermission(integer  $permission) 

Removes a certain privilege for creators from this share.

Parameters

integer $permission

A Horde_Perms::* constant.

addDefaultPermission()

addDefaultPermission(integer  $permission) 

Gives all authenticated users a certain privilege for this share.

Parameters

integer $permission

A Horde_Perms::* constant.

removeDefaultPermission()

removeDefaultPermission(integer  $permission) 

Removes a certain privilege for all authenticated users from this share.

Parameters

integer $permission

A Horde_Perms::* constant.

hasPermission()

hasPermission(string  $userid, integer  $permission, string  $creator = null) : boolean

Checks to see if a user has a given permission.

Parameters

string $userid

The userid of the user.

integer $permission

A Horde_Perms::* constant to test for.

string $creator

The creator of the event.

Returns

boolean —

Whether or not $userid has $permission.

setPermission()

setPermission(\Horde_Perms_Permission  $perm, boolean  $update = true) 

Sets the permission of this share.

Parameters

\Horde_Perms_Permission $perm

Permission object.

boolean $update

Should the share be saved after this operation?

getPermission()

getPermission() : \Horde_Perms_Permission

Returns the permission of this share.

Returns

\Horde_Perms_Permission —

Permission object that represents the permissions on this share.

_save()

_save() 

Saves the current attribute values.

_getAttributes()

_getAttributes() : array

Returns the share attributes.

Returns

array —

All share attributes as a hash.