\Horde_Api

Horde external API interface.

This file defines Horde's external API interface. Other applications can interact with Horde through this API.

Summary

Methods
Properties
Constants
admin_list()
listApps()
listAPIs()
blockTitle()
blockContent()
blocks()
getPreference()
setPreference()
removeUserData()
addGroup()
removeGroup()
addUserToGroup()
removeUserFromGroup()
listUsersOfGroup()
addShare()
removeShare()
listSharesOfOwner()
addUserPermissions()
addGroupPermissions()
removeUserPermissions()
removeGroupPermissions()
listUserPermissions()
listGroupPermissions()
listUsersOfShare()
listGroupsOfShare()
listActiveSyncDevices()
performActiveSyncDeviceAction()
performBulkActiveSyncDeviceAction()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

admin_list()

admin_list() : array

Returns a list of adminstrative links.

Returns

array —

Keys are link labels, values are array with these keys:

  • icon: (string) Graphic for page.
  • link: (string) Registry encoded link to page.
  • name: (string) Gettext label for page.

listApps()

listApps(array  $filter = null) : array

Returns a list of the installed and registered applications.

Parameters

array $filter

An array of the statuses that should be returned. Defaults to non-hidden.

Returns

array —

List of apps registered with Horde. If no applications are defined returns an empty array.

listAPIs()

listAPIs() : array

Returns all available registry APIs.

Returns

array —

The API list.

blockTitle()

blockTitle(string  $app, string  $name, array  $params = array()) : string

Returns a Horde_Block's title.

Parameters

string $app

The block application name.

string $name

The block name (NOT the class name).

array $params

Block parameters.

Returns

string —

The block title.

blockContent()

blockContent(string  $app, string  $name, array  $params = array()) : string

Returns a Horde_Block's content.

Parameters

string $app

The block application name.

string $name

The block name (NOT the classname).

array $params

Block parameters.

Returns

string —

The block content.

blocks()

blocks() : array

Returns a pretty printed list of all available blocks.

Returns

array —

A hash with block IDs as keys and application plus block block names as values.

getPreference()

getPreference(string  $app, string  $pref) : string

Returns the value of the requested preference.

Parameters

string $app

The application of the preference to retrieve.

string $pref

The name of the preference to retrieve.

Returns

string —

The value of the preference, null if it doesn't exist.

setPreference()

setPreference(string  $app, string  $pref,   $value) 

Sets a preference to the specified value, if the preference is allowed to be modified.

Parameters

string $app

The application of the preference to modify.

string $pref

The name of the preference to modify.

$value

removeUserData()

removeUserData(string  $user, string  $app = false) 

Removes user data.

Parameters

string $user

Name of user to remove data for.

string $app

Remove data from this application. If boolean true, removes all applications. If boolean false, removes only base Horde data.

Throws

\Horde_Exception

addGroup()

addGroup(string  $name) : mixed

Adds a group to the groups system.

Parameters

string $name

The group's name.

Throws

\Horde_Exception

Returns

mixed —

The group's ID.

removeGroup()

removeGroup(mixed  $group) 

Removes a group from the groups system.

Parameters

mixed $group

The group ID.

Throws

\Horde_Exception

addUserToGroup()

addUserToGroup(mixed  $group, string  $user) 

Adds a user to a group.

Parameters

mixed $group

The group ID.

string $user

The user to add.

Throws

\Horde_Exception

removeUserFromGroup()

removeUserFromGroup(mixed  $group, string  $user) 

Removes a user from a group.

Parameters

mixed $group

The group ID.

string $user

The user to add.

Throws

\Horde_Exception

listUsersOfGroup()

listUsersOfGroup(mixed  $group) : array

Returns a list of users that are part of this group (and only this group).

Parameters

mixed $group

The group ID.

Throws

\Horde_Exception

Returns

array —

The user list.

addShare()

addShare(string  $scope, string  $shareName, string  $shareTitle, string  $userName) 

Adds a share to the shares system.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

string $shareTitle

The share's human readable title.

string $userName

The share's owner.

Throws

\Horde_Exception

removeShare()

removeShare(string  $scope, string  $shareName) 

Removes a share from the shares system permanently.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

Throws

\Horde_Exception

listSharesOfOwner()

listSharesOfOwner(string  $scope, string  $userName) : array

Returns an array of all shares that $userName is the owner of.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $userName

The share's owner.

Throws

\Horde_Exception

Returns

array —

The list of shares.

addUserPermissions()

addUserPermissions(string  $scope, string  $shareName, string  $userName, array  $permissions) 

Gives a user certain privileges for a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

string $userName

The user's name.

array $permissions

A list of permissions (show, read, edit, delete).

Throws

\Horde_Exception

addGroupPermissions()

addGroupPermissions(string  $scope, string  $shareName, mixed  $groupId, array  $permissions) 

Gives a group certain privileges for a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

mixed $groupId

The group ID.

array $permissions

A list of permissions (show, read, edit, delete).

Throws

\Horde_Exception

removeUserPermissions()

removeUserPermissions(string  $scope, string  $shareName, string  $userName) 

Removes a user from a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

string $userName

The user's name.

Throws

\Horde_Exception

removeGroupPermissions()

removeGroupPermissions(string  $scope, string  $shareName, mixed  $groupId) 

Removes a group from a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

mixed $groupId

The group ID.

Throws

\Horde_Exception

listUserPermissions()

listUserPermissions(string  $scope, string  $shareName, string  $userName) : array

Returns an array of all user permissions on a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

string $userName

The user's name.

Throws

\Horde_Exception

Returns

array —

All user permissions for this share.

listGroupPermissions()

listGroupPermissions(string  $scope, string  $shareName, string  $groupName) : array

Returns an array of all group permissions on a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

string $groupName

The group's name.

Throws

\Horde_Exception

Returns

array —

All group permissions for this share.

listUsersOfShare()

listUsersOfShare(string  $scope, string  $shareName, array  $permissions) : array

Returns a list of users which have have certain permissions on a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

array $permissions

A list of permissions (show, read, edit, delete).

Throws

\Horde_Exception

Returns

array —

List of users with the specified permissions.

listGroupsOfShare()

listGroupsOfShare(string  $scope, string  $shareName, array  $permissions) : array

Returns a list of groups which have have certain permissions on a share.

Parameters

string $scope

The name of the share root, e.g. the application that the share belongs to.

string $shareName

The share's name.

array $permissions

A list of permissions (show, read, edit, delete).

Throws

\Horde_Exception

Returns

array —

List of groups with the specified permissions.

listActiveSyncDevices()

listActiveSyncDevices(array  $filter = array()) : array

Returns a list of ActiveSync devices that are partnered with Horde.

Parameters

array $filter

An array of parameters to filter on:

  • user: Only return devices owned by user. If not present will default to returning devices for current user only. If present, but empty and current user is admin, will return all devices. Otherwise, will return devices matching the parameter (must be admin to list users other than current).

Returns

array —

List of device properties.

performActiveSyncDeviceAction()

performActiveSyncDeviceAction(string  $action, string  $deviceid, string  $user = null) : boolean

Perform an administrative action on a single paired ActiveSync device.

Parameters

string $action

The action to perform. One of: WIPE, CANCEL_WIPE, REMOVE.

string $deviceid

The device's deviceid.

string $user

Restrict actions to only this user's account on the device in the case where the device may have multiple user accounts on this server. If empty, all users' state information will be removed. If a non-admin calls this method, this will always be set to the current horde username.

Throws

\Horde_Exception

Returns

boolean

performBulkActiveSyncDeviceAction()

performBulkActiveSyncDeviceAction(string  $action) : boolean

Perform an admistrative action on ALL paired ActiveSync devices.

Parameters

string $action

The action. Currently, only 'RESET' is supported.

  • 'RESET': Causes all state for all devices to be removed. I.e., sets the synckey for all devices to 0.

Returns

boolean