\Horde_Core_ActiveSync_Connector

Registry connector for Horde backend.

Provides the communication between the Horde Registry on the local machine and the ActiveSync Horde driver.

Summary

Methods
Properties
Constants
__construct()
setLogger()
calendar_listUids()
calendar_export()
calendar_import()
calendar_import16()
calendar_import_vevent()
calendar_import_attendee()
calendar_replace()
calendar_delete()
calendar_getActionTimestamp()
calendar_move()
calendar_getAttachment()
contacts_listUids()
contacts_export()
contacts_import()
contacts_replace()
contacts_delete()
contacts_getActionTimestamp()
getRecipientCache()
contacts_search()
resolveRecipient()
contacts_getGal()
files_browse()
tasks_listUids()
tasks_export()
tasks_import()
tasks_replace()
tasks_delete()
tasks_getActionTimestamp()
notes_listNotepads()
notes_listUids()
notes_export()
notes_import()
notes_replace()
notes_delete()
notes_getActionTimestamp()
horde_listApis()
hasFeature()
getHighestModSeq()
horde_getPref()
horde_hasInterface()
horde_hasMethod()
filters_getVacation()
filters_setVacation()
mail_getMaillog()
mail_logMaillog()
mail_logRecipient()
mail_getMaillogChanges()
mail_ensureMessageFlags()
getChanges()
softDelete()
getFolders()
createFolder()
changeFolder()
deleteFolder()
clearAuth()
mdnSend()
No public properties found
No constants found
_getAppFromCollectionId()
_getInterfaceFromCollectionId()
_ensureCalendar()
$_registry
$_logger
$_gal
$_capabilities
$_folderCache
N/A
No private methods found
No private properties found
N/A

Properties

$_registry

$_registry : \Horde_Registry

Horde registry

Type

\Horde_Registry

$_logger

$_logger : \Horde_Log_Logger

The logger

Type

\Horde_Log_Logger

$_gal

$_gal : string

Cache the GAL to avoid hitting the contacts API multiple times.

Type

string

$_capabilities

$_capabilities : array

Cache results of capability queries

Type

array

$_folderCache

$_folderCache : array

Cache list of folders

Type

array

Methods

__construct()

__construct(array  $params = array()) : \Horde_ActiveSync_Driver_Horde_Connector_Registry

Const'r

Parameters

array $params

Configuration parameters. Requires:

  • registry: An instance of Horde_Registry

Throws

\InvalidArgumentException

Returns

\Horde_ActiveSync_Driver_Horde_Connector_Registry

setLogger()

setLogger(  $logger) 

Set a logger for this object.

Parameters

$logger

calendar_listUids()

calendar_listUids(integer  $startstamp, integer  $endstamp, string  $calendar) : array

Get a list of events from horde's calendar api

Parameters

integer $startstamp

The start of time period.

integer $endstamp

The end of time period

string $calendar

The calendar id. If null, uses multiplexed. @since 2.12.0

Returns

array

calendar_export()

calendar_export(string  $uid, array  $options = array(), string  $calendar = null) : \Horde_ActiveSync_Message_Appointment

Export the specified event as an ActiveSync message

Parameters

string $uid

The calendar id.

array $options

Options to pass to the backend exporter.

  • protocolversion: (float) The EAS version to support DEFAULT: 2.5
  • bodyprefs: (array) A BODYPREFERENCE array. DEFAULT: none (No body prefs enforced).
  • truncation: (integer) Truncate event body to this length DEFAULT: none (No truncation).
string $calendar

The calendar id. If null, uses multiplexed. @since 2.12.0

Returns

\Horde_ActiveSync_Message_Appointment —

The requested event.

calendar_import()

calendar_import(\Horde_ActiveSync_Message_Appointment  $content, string  $calendar = null) : string

Import an event into the user's default calendar.

Parameters

\Horde_ActiveSync_Message_Appointment $content

The event content

string $calendar

The calendar id. @since 2.12.0

Returns

string —

The event's UID.

calendar_import16()

calendar_import16(\Horde_ActiveSync_Message_Appointment  $content, string  $calendar = null) : array

Version of calendar_import capable of returning an array of values.

Needed for EAS 16 support in order to deal with the fact that attachment actions are handled within the Message object.

Parameters

\Horde_ActiveSync_Message_Appointment $content

The event content

string $calendar

The calendar id.

Returns

array

calendar_import_vevent()

calendar_import_vevent(\Horde_Icalendar_vEvent  $vEvent) : string

Import a Horde_Icalendar_vEvent into a user's calendar. Used for creating events from meeting invitations.

Parameters

\Horde_Icalendar_vEvent $vEvent

The event data.

Returns

string —

The event's UID.

calendar_import_attendee()

calendar_import_attendee(\Horde_Icalendar_vEvent  $vEvent, string  $attendee) 

Import an event response into a user's calendar. Used for updating attendee information from a meeting response.

Parameters

\Horde_Icalendar_vEvent $vEvent

The event data.

string $attendee

The attendee.

calendar_replace()

calendar_replace(string  $uid, \Horde_ActiveSync_Message_Appointment  $content, string  $calendar = null) : null|array

Replace the event with new data

Parameters

string $uid

The UID of the event to replace.

\Horde_ActiveSync_Message_Appointment $content

The new event.

string $calendar

The calendar id. @since 2.12.0

Returns

null|array —

May return an array of 'uid' and 'atchash' or null.

calendar_delete()

calendar_delete(string  $uid, string  $calendar = null, string  $instanceid = null) 

Delete an event from Horde's calendar storage

Parameters

string $uid

The UID of the event to delete

string $calendar

The calendar id. @since 2.12.0 @deprecated (Not used).

string $instanceid

The instanceid if this is a EAS 16.0 instance. @since 2.23.0

calendar_getActionTimestamp()

calendar_getActionTimestamp(string  $uid, string  $action, string  $calendar = null) : integer

Return the timestamp for the last time $action was performed.

Parameters

string $uid

The UID of the event we are interested in.

string $action

The action we are interested in (add, modify...).

string $calendar

The calendar id, if not using multiplexed data.

Returns

integer

calendar_move()

calendar_move(string  $uid, string  $source, string  $target) : string|boolean

Move a calendar event.

Parameters

string $uid

The event UID.

string $source

The source calendar's id.

string $target

The target calendar's id.

Returns

string|boolean —

The UID if successfully moved otherwise false.

calendar_getAttachment()

calendar_getAttachment(string  $filereference) : array

Return an event attachment.

Parameters

string $filereference

A filereference pointing to the file: calendar:{calendar_id}:{event_uid}:{filename}

Returns

array —

An array containing: 'content-type' and 'data'.

contacts_listUids()

contacts_listUids(string  $source = null) : array

Get a list of all contacts a user can see

Parameters

string $source

The source to list. If null, use multiplex. @since 2.12.0

Returns

array —

An array of contact UIDs

contacts_export()

contacts_export(string  $uid, array  $options = array()) : \Horde_ActiveSync_Message_Contact

Export the specified contact from Horde's contacts storage

Parameters

string $uid

The contact's UID

array $options

Exporter options:

  • protocolversion: (float) The EAS version to support DEFAULT: 2.5
  • bodyprefs: (array) A BODYPREFERENCE array. DEFAULT: none (No body prefs enforced).
  • truncation: (integer) Truncate event body to this length DEFAULT: none (No truncation).
  • device: (Horde_ActiveSync_Device) The device object.

Returns

\Horde_ActiveSync_Message_Contact —

The contact object.

contacts_import()

contacts_import(\Horde_ActiveSync_Message_Contact  $content, string  $addressbook = null) : mixed

Import the provided contact data into Horde's contacts storage

Parameters

\Horde_ActiveSync_Message_Contact $content

The contact data

string $addressbook

The addessbook id. @since 2.12.0

Returns

mixed —

string|boolean The new UID or false on failure.

contacts_replace()

contacts_replace(string  $uid, string  $content) 

Replace the specified contact with the data provided.

Parameters

string $uid

The UID of the contact to replace

string $content

The contact data

contacts_delete()

contacts_delete(string|array  $uid) : boolean

Delete the specified contact

Parameters

string|array $uid

The UID(s) of the contact(s) to remove.

Returns

boolean

contacts_getActionTimestamp()

contacts_getActionTimestamp(string  $uid, string  $action, string  $addressbook = null) : integer

Get the timestamp of the most recent occurance of $action for the specifed contact

Parameters

string $uid

The UID of the contact to search.

string $action

The action to lookup.

string $addressbook

The addressbook id, if not using multiplex.

Returns

integer

getRecipientCache()

getRecipientCache(integer  $max = 100) : array

Returns the favouriteRecipients data for RI requests.

Parameters

integer $max

The maximum number of recipients to return.

Returns

array —

An array of email addresses.

contacts_search()

contacts_search(string  $query, array  $options = array()) : array

Search the contacts store.

Parameters

string $query

The search string.

array $options

Additional options:

  • pictures: (boolean) Include photos in results. DEFAULT: false (Do not include photos).
  • recipient_cache_search: (boolean) If true, this is a RI cache search, should only search the 'email' field and only return a small subset of fields.

Returns

array —

The search results.

resolveRecipient()

resolveRecipient(string  $query, array  $opts = array()) : array

Resolve a recipient

Parameters

string $query

The search string. Ususally an email address.

array $opts

Any additional options:

  • maxcerts: (integer) The maximum number of certificates to return as provided by the client.
  • maxambiguous: (integer) The maximum number of ambiguous results. If set to zero, we MUST have an exact match.
  • starttime: (Horde_Date) The start time for the availability window if requesting AVAILABILITY.
  • endtime: (Horde_Date) The end of the availability window if requesting AVAILABILITY.
  • maxsize: (integer) The maximum size of any pictures. DEFAULT: 0 (No limit).
  • maxpictures: (integer) The maximum count of images to return. DEFAULT: - (No limit).
  • pictures: (boolean) Return pictures.

Returns

array —

The search results, keyed by the $query.

contacts_getGal()

contacts_getGal() : string

Get the GAL source uid.

Returns

string —

| boolean The address book id of the GAL, or false if not available.

files_browse()

files_browse(string  $path) : array

Browse VFS backend.

Parameters

string $path

The path to browse/fetch. This should be in UNC format with the "server" portion specifying backend name. e.g., \file\mike\file.txt or \sql\mike\file.txt

Returns

array —

An array of data arrays with the following structure: linkid: (string) The UNC path for this resource. name: (string) The display name of the resource. content-length: (integer) The byte size of the resource (if a file). modified: (Horde_Date) The modification time of the resource, if available. create: (Horde_Date) The creation time of the resource, if available. is_folder: (boolean) True if the resource is a folder. data: (Horde_Stream) The data, if resource is a file. content-type: (string) The MIME type of the file resource, if available. @since 2.12.0

tasks_listUids()

tasks_listUids(string  $tasklist = null) : array

List all tasks in the user's default tasklist.

Parameters

string $tasklist

The tasklist to check. If null, use multiplexed.

Returns

array —

An array of task uids.

tasks_export()

tasks_export(string  $uid, array  $options = array()) : \Horde_ActiveSync_Message_Task

Export a single task from the backend.

Parameters

string $uid

The task uid

array $options

Options to pass to the backend exporter.

Returns

\Horde_ActiveSync_Message_Task —

The task message object

tasks_import()

tasks_import(\Horde_ActiveSync_Message_Task  $message, string  $tasklist = null) : string

Import a single task into the backend.

Parameters

\Horde_ActiveSync_Message_Task $message

The task message object

string $tasklist

The tasklist id. @since 2.12.0

Returns

string —

The newly added task's uid.

tasks_replace()

tasks_replace(string  $uid, \Horde_ActiveSync_Message_Task  $message) 

Replace an existing task with the provided task.

Parameters

string $uid

The existing tasks's uid

\Horde_ActiveSync_Message_Task $message

The task object

tasks_delete()

tasks_delete(string  $id) 

Delete a task from the backend.

Parameters

string $id

The task's uid

tasks_getActionTimestamp()

tasks_getActionTimestamp(string  $uid, string  $action,   $tasklist = null) : integer

Return the timestamp or modseq for the last time $action was performed.

Parameters

string $uid

The UID of the task we are interested in.

string $action

The action we are interested in (add, modify...)

$tasklist

Returns

integer

notes_listNotepads()

notes_listNotepads() : array

List notepads.

Returns

array

notes_listUids()

notes_listUids(string  $notepad = null) : array

List all notes in the user's default notepad.

Parameters

string $notepad

The notepad id to list. If null, use multiplexed. @since 2.12.0

Returns

array —

An array of note uids.

notes_export()

notes_export(string  $uid, array  $options = array()) : \Horde_ActiveSync_Message_Note

Export a single note from the backend.

Parameters

string $uid

The note uid

array $options

Options to pass to the backend exporter.

Returns

\Horde_ActiveSync_Message_Note —

The note message object

notes_import()

notes_import(\Horde_ActiveSync_Message_Note  $message, string  $notebook = null) : string

Importa a single note into the backend.

Parameters

\Horde_ActiveSync_Message_Note $message

The note message object

string $notebook

The notebook id. @since 2.12.0

Returns

string —

The newly added notes's uid.

notes_replace()

notes_replace(string  $uid, \Horde_ActiveSync_Message_Note  $message) 

Replace an existing task with the provided task.

Parameters

string $uid

The existing tasks's uid

\Horde_ActiveSync_Message_Note $message

The task object

notes_delete()

notes_delete(string  $id) 

Delete a note from the backend.

Parameters

string $id

The task's uid

notes_getActionTimestamp()

notes_getActionTimestamp(string  $uid, string  $action, string  $notepad = null) : integer

Return the timestamp for the last time $action was performed.

Parameters

string $uid

The UID of the task we are interested in.

string $action

The action we are interested in (add, modify...)

string $notepad

The notepad to use, if not using multiplex.

Returns

integer

horde_listApis()

horde_listApis() : array

Return all active api interfaces.

Returns

array —

An array of interface names.

hasFeature()

hasFeature(string  $feature, string  $collection) : boolean

Return if the backend collection has the requested feature.

Parameters

string $feature

The requested feature.

string $collection

The requested collection id.

Returns

boolean

getHighestModSeq()

getHighestModSeq(  $collection,   $id = null) : integer

Return the highest modification sequence value for the specified collection

Parameters

$collection
$id

Returns

integer —

The modseq value.

horde_getPref()

horde_getPref(string  $app, string  $pref) : mixed

Obtain a user's preference setting.

Parameters

string $app

The Horde application providing the setting.

string $pref

The name of the preference setting.

Returns

mixed —

The preference value

horde_hasInterface()

horde_hasInterface(string  $api) : string

Obtain the name of the Horde application that provides the specified api interface.

Parameters

string $api

The interface name

Returns

string —

The application name.

horde_hasMethod()

horde_hasMethod(string  $method, string  $api) : boolean

Wrapper around Horde_Registry::hasMethod.

Parameters

string $method

The method name.

string $api

The API to check.

Returns

boolean

filters_getVacation()

filters_getVacation() : array|boolean

Return the currently set vacation message details.

Returns

array|boolean —

The vacation rule properties or false if interface unavailable.

filters_setVacation()

filters_setVacation(array  $setting) 

Set vacation message properties.

Parameters

array $setting

The vacation details.

Throws

\Horde_Exception

mail_getMaillog()

mail_getMaillog(string  $mid) : \Horde_History_Log|false

Return a Maillog entry for the specified Message-ID.

Parameters

string $mid

The Message-ID of the message.

Returns

\Horde_History_Log|false —

The history log or false if not found.

mail_logMaillog()

mail_logMaillog(string  $action, string  $mid, string  $recipients = null, string  $folder = null) 

Log a forward/reply action to the maillog.

Parameters

string $action

The action to log. One of: 'forward', 'reply', 'reply_all'.

string $mid

The Message-ID to log.

string $recipients

The recipients the mail was forwarded to.

string $folder

The sent-mail folder. @since Horde_Core 2.27.0

mail_logRecipient()

mail_logRecipient(  $action,   $recipients,   $message_id) 

Parameters

$action
$recipients
$message_id

mail_getMaillogChanges()

mail_getMaillogChanges(integer  $ts) : array

Poll the maillog for changes since the specified timestamp.

Parameters

integer $ts

The timestamp to check since.

Returns

array —

An array of Message-IDs that have changed since $ts.

mail_ensureMessageFlags()

mail_ensureMessageFlags(array  $flags) 

Add any user-defined flags to IMP's preferences.

Parameters

array $flags

An array of flags to add.

getChanges()

getChanges(string  $collection, integer  $from_ts, integer  $to_ts, string  $server_id) : array

Get all server changes for the specified collection

Parameters

string $collection

The collection type (a Horde interface name - calendar, contacts, tasks)

integer $from_ts

Starting timestamp or modification sequence.

integer $to_ts

Ending timestamp or modification sequence.

string $server_id

The server id of the collection. If null, uses multiplexed.

Throws

\InvalidArgumentException,

Horde_Exception

Returns

array —

A hash of add, modify, and delete uids

softDelete()

softDelete(string  $collection, \long  $from_ts, \long  $to_ts, string  $source = null) : array

Return message UIDs that should be SOFTDELETEd from the client.

Parameters

string $collection

The collection type.

\long $from_ts

The start of the time period to search.

\long $to_ts

The end of the time period to search.

string $source

Limit to this source only. @since 2.12.0

Returns

array —

An array of message UIDs that occur within the $from_ts and $to_ts range that are to be SOFTDELETEd from the client.

getFolders()

getFolders(string  $collection, integer  $multiplex) : array|string

Return the list of folders to sync for the specified collection.

Parameters

string $collection

The collection class A HordeActiveSync::CLASS* constant.

integer $multiplex

A bitmask flagging the collections that must be multiplexed, regardless of horde's settings

Returns

array|string —

A list of folder uids or $collection if supporting API is not found. If a list is returned, it is in the following format: 'uid' => array('display' => "Display Name", 'primary' => boolean)

createFolder()

createFolder(string  $class, string  $foldername) : string|integer

Create a new folder/source in the specified collection.

Parameters

string $class

The collection class. A HordeActiveSync::CLASS* constant.

string $foldername

The name of the new folder.

Throws

\Horde_ActiveSync_Exception

Returns

string|integer —

The new folder serverid.

changeFolder()

changeFolder(string  $class, string  $id, string  $name) 

Change an existing folder on the server.

Parameters

string $class

The collection class. A HordeActiveSync::CLASS* constant.

string $id

The existing serverid.

string $name

The new folder display name.

Throws

\Horde_ActiveSync_Exception

deleteFolder()

deleteFolder(string  $class, string  $id) 

Delete a folder.

Parameters

string $class

The EAS collection class.

string $id

The folder id

clearAuth()

clearAuth() 

Clear the authentication and destroy the current session.

mdnSend()

mdnSend(  $mdn) 

Parameters

$mdn

_getAppFromCollectionId()

_getAppFromCollectionId(string  $collection) : string

Convert a collection id to a horde app name.

Parameters

string $collection

The collection id e.g., @Notes@.

Returns

string —

The horde application name e.g., nag.

_getInterfaceFromCollectionId()

_getInterfaceFromCollectionId(string  $collection) : string

Normalize the collection ids to interface names.

Parameters

string $collection

The collection id e.g., @Notes@

Returns

string —

The Horde interface name e.g., notes

_ensureCalendar()

_ensureCalendar(string  $source) : array

Return an array of calendar sources - either the user's configured "default" calendar (if $source is empty) or the calendar specified by $soruce.

Parameters

string $source

The calendar id.

Returns

array —

An array containing the calendar id.