PHP Class Horde_Core_ActiveSync_Connector, horde

Provides the communication between the Horde Registry on the local machine and the ActiveSync Horde driver.
Author: Michael J Rubinsky ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_capabilities array Cache results of capability queries
$_folderCache array Cache list of folders
$_gal string Cache the GAL to avoid hitting the contacts API multiple times.
$_logger Horde_Log_Logger The logger
$_registry Horde_Registry Horde registry

Méthodes publiques

Méthode Description
__construct ( array $params = [] ) : Horde_ActiveSync_Driver_Horde_Connector_Registry Const'r
calendar_delete ( string $uid, string $calendar = null, string $instanceid = null ) Delete an event from Horde's calendar storage
calendar_export ( string $uid, array $options = [], string $calendar = null ) : Horde_ActiveSync_Message_Appointment Export the specified event as an ActiveSync message
calendar_getActionTimestamp ( string $uid, string $action, string $calendar = null ) : integer Return the timestamp for the last time $action was performed.
calendar_getAttachment ( string $filereference ) : array Return an event attachment.
calendar_import ( Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : string Import an event into the user's default calendar.
calendar_import16 ( Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : array Version of calendar_import capable of returning an array of values.
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.
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.
calendar_listUids ( integer $startstamp, integer $endstamp, string $calendar ) : array Get a list of events from horde's calendar api
calendar_move ( string $uid, string $source, string $target ) : string | boolean Move a calendar event.
calendar_replace ( string $uid, Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : null | array Replace the event with new data
changeFolder ( string $class, string $id, string $name ) Change an existing folder on the server.
clearAuth ( ) Clear the authentication and destroy the current session.
contacts_delete ( string | array $uid ) : boolean Delete the specified contact
contacts_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Contact Export the specified contact from Horde's contacts storage
contacts_getActionTimestamp ( string $uid, string $action, string $addressbook = null ) : integer Get the timestamp of the most recent occurance of $action for the specifed contact
contacts_getGal ( ) : string | boolean Get the GAL source uid.
contacts_import ( Horde_ActiveSync_Message_Contact $content, string $addressbook = null ) : mixed Import the provided contact data into Horde's contacts storage
contacts_listUids ( string $source = null ) : array Get a list of all contacts a user can see
contacts_replace ( string $uid, string $content ) Replace the specified contact with the data provided.
contacts_search ( string $query, array $options = [] ) : array Search the contacts store.
createFolder ( string $class, string $foldername ) : string | integer Create a new folder/source in the specified collection.
deleteFolder ( string $class, string $id ) Delete a folder.
files_browse ( string $path ) : array Browse VFS backend.
filters_getVacation ( ) : array | boolean Return the currently set vacation message details.
filters_setVacation ( array $setting ) Set vacation message properties.
getChanges ( string $collection, integer $from_ts, integer $to_ts, string $server_id ) : array Get all server changes for the specified collection
getFolders ( string $collection, integer $multiplex ) : array | string Return the list of folders to sync for the specified collection.
getHighestModSeq ( $collection, $id = null ) : integer Return the highest modification sequence value for the specified collection
getRecipientCache ( integer $max = 100 ) : array Returns the favouriteRecipients data for RI requests.
hasFeature ( string $feature, string $collection ) : boolean Return if the backend collection has the requested feature.
horde_getPref ( string $app, string $pref ) : mixed Obtain a user's preference setting.
horde_hasInterface ( string $api ) : string Obtain the name of the Horde application that provides the specified api interface.
horde_hasMethod ( string $method, string $api ) : boolean Wrapper around Horde_Registry::hasMethod.
horde_listApis ( ) : array Return all active api interfaces.
mail_ensureMessageFlags ( array $flags ) Add any user-defined flags to IMP's preferences.
mail_getMaillog ( string $mid ) : Horde_History_Log | false Return a Maillog entry for the specified Message-ID.
mail_getMaillogChanges ( integer $ts ) : array Poll the maillog for changes since the specified timestamp.
mail_logMaillog ( string $action, string $mid, string $recipients = null, string $folder = null ) Log a forward/reply action to the maillog.
mail_logRecipient ( $action, $recipients, $message_id )
mdnSend ( $mdn )
notes_delete ( string $id ) Delete a note from the backend.
notes_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Note Export a single note from the backend.
notes_getActionTimestamp ( string $uid, string $action, string $notepad = null ) : integer Return the timestamp for the last time $action was performed.
notes_import ( Horde_ActiveSync_Message_Note $message, string $notebook = null ) : string Importa a single note into the backend.
notes_listNotepads ( ) : array List notepads.
notes_listUids ( string $notepad = null ) : array List all notes in the user's default notepad.
notes_replace ( string $uid, Horde_ActiveSync_Message_Note $message ) Replace an existing task with the provided task.
resolveRecipient ( string $query, array $opts = [] ) : array Resolve a recipient
setLogger ( $logger ) Set a logger for this object.
softDelete ( string $collection, long $from_ts, long $to_ts, string $source = null ) : array Return message UIDs that should be SOFTDELETEd from the client.
tasks_delete ( string $id ) Delete a task from the backend.
tasks_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Task Export a single task from the backend.
tasks_getActionTimestamp ( string $uid, string $action, $tasklist = null ) : integer Return the timestamp or modseq for the last time $action was performed.
tasks_import ( Horde_ActiveSync_Message_Task $message, string $tasklist = null ) : string Import a single task into the backend.
tasks_listUids ( string $tasklist = null ) : array List all tasks in the user's default tasklist.
tasks_replace ( string $uid, Horde_ActiveSync_Message_Task $message ) Replace an existing task with the provided task.

Méthodes protégées

Méthode Description
_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.
_getAppFromCollectionId ( string $collection ) : string Convert a collection id to a horde app name.
_getInterfaceFromCollectionId ( string $collection ) : string Normalize the collection ids to interface names.

Method Details

__construct() public méthode

Const'r
public __construct ( array $params = [] ) : Horde_ActiveSync_Driver_Horde_Connector_Registry
$params array Configuration parameters. Requires: - registry: An instance of Horde_Registry
Résultat Horde_ActiveSync_Driver_Horde_Connector_Registry

_ensureCalendar() protected méthode

Return an array of calendar sources - either the user's configured "default" calendar (if $source is empty) or the calendar specified by $soruce.
protected _ensureCalendar ( string $source ) : array
$source string The calendar id.
Résultat array An array containing the calendar id.

_getAppFromCollectionId() protected méthode

Convert a collection id to a horde app name.
protected _getAppFromCollectionId ( string $collection ) : string
$collection string The collection id e.g., @Notes@.
Résultat string The horde application name e.g., nag.

_getInterfaceFromCollectionId() protected méthode

Normalize the collection ids to interface names.
protected _getInterfaceFromCollectionId ( string $collection ) : string
$collection string The collection id e.g., @Notes@
Résultat string The Horde interface name e.g., notes

calendar_delete() public méthode

Delete an event from Horde's calendar storage
public calendar_delete ( string $uid, string $calendar = null, string $instanceid = null )
$uid string The UID of the event to delete
$calendar string The calendar id. @since 2.12.0 @deprecated (Not used).
$instanceid string The instanceid if this is a EAS 16.0 instance. @since 2.23.0

calendar_export() public méthode

Export the specified event as an ActiveSync message
public calendar_export ( string $uid, array $options = [], string $calendar = null ) : Horde_ActiveSync_Message_Appointment
$uid string The calendar id.
$options array 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).
$calendar string The calendar id. If null, uses multiplexed. @since 2.12.0
Résultat Horde_ActiveSync_Message_Appointment The requested event.

calendar_getActionTimestamp() public méthode

Return the timestamp for the last time $action was performed.
public calendar_getActionTimestamp ( string $uid, string $action, string $calendar = null ) : integer
$uid string The UID of the event we are interested in.
$action string The action we are interested in (add, modify...).
$calendar string The calendar id, if not using multiplexed data.
Résultat integer

calendar_getAttachment() public méthode

Return an event attachment.
public calendar_getAttachment ( string $filereference ) : array
$filereference string A filereference pointing to the file: calendar:{calendar_id}:{event_uid}:{filename}
Résultat array An array containing: 'content-type' and 'data'.

calendar_import() public méthode

Import an event into the user's default calendar.
public calendar_import ( Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : string
$content Horde_ActiveSync_Message_Appointment The event content
$calendar string The calendar id. @since 2.12.0
Résultat string The event's UID.

calendar_import16() public méthode

Needed for EAS 16 support in order to deal with the fact that attachment actions are handled within the Message object.
Since: 2.27.0
public calendar_import16 ( Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : array
$content Horde_ActiveSync_Message_Appointment The event content
$calendar string The calendar id.
Résultat array

calendar_import_attendee() public méthode

Import an event response into a user's calendar. Used for updating attendee information from a meeting response.
public calendar_import_attendee ( Horde_Icalendar_vEvent $vEvent, string $attendee )
$vEvent Horde_Icalendar_vEvent The event data.
$attendee string The attendee.

calendar_import_vevent() public méthode

Import a Horde_Icalendar_vEvent into a user's calendar. Used for creating events from meeting invitations.
public calendar_import_vevent ( Horde_Icalendar_vEvent $vEvent ) : string
$vEvent Horde_Icalendar_vEvent The event data.
Résultat string The event's UID.

calendar_listUids() public méthode

Get a list of events from horde's calendar api
public calendar_listUids ( integer $startstamp, integer $endstamp, string $calendar ) : array
$startstamp integer The start of time period.
$endstamp integer The end of time period
$calendar string The calendar id. If null, uses multiplexed. @since 2.12.0
Résultat array

calendar_move() public méthode

Move a calendar event.
Since: 2.15.0
public calendar_move ( string $uid, string $source, string $target ) : string | boolean
$uid string The event UID.
$source string The source calendar's id.
$target string The target calendar's id.
Résultat string | boolean The UID if successfully moved otherwise false.

calendar_replace() public méthode

Replace the event with new data
public calendar_replace ( string $uid, Horde_ActiveSync_Message_Appointment $content, string $calendar = null ) : null | array
$uid string The UID of the event to replace.
$content Horde_ActiveSync_Message_Appointment The new event.
$calendar string The calendar id. @since 2.12.0
Résultat null | array May return an array of 'uid' and 'atchash' or null.

changeFolder() public méthode

Change an existing folder on the server.
Since: 2.12.0
public changeFolder ( string $class, string $id, string $name )
$class string The collection class. A Horde_ActiveSync::CLASS_* constant.
$id string The existing serverid.
$name string The new folder display name.

clearAuth() public méthode

Clear the authentication and destroy the current session.
public clearAuth ( )

contacts_delete() public méthode

Delete the specified contact
public contacts_delete ( string | array $uid ) : boolean
$uid string | array The UID(s) of the contact(s) to remove.
Résultat boolean

contacts_export() public méthode

Export the specified contact from Horde's contacts storage
public contacts_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Contact
$uid string The contact's UID
$options array 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.
Résultat Horde_ActiveSync_Message_Contact The contact object.

contacts_getActionTimestamp() public méthode

Get the timestamp of the most recent occurance of $action for the specifed contact
public contacts_getActionTimestamp ( string $uid, string $action, string $addressbook = null ) : integer
$uid string The UID of the contact to search.
$action string The action to lookup.
$addressbook string The addressbook id, if not using multiplex.
Résultat integer

contacts_getGal() public méthode

Get the GAL source uid.
public contacts_getGal ( ) : string | boolean
Résultat string | boolean | boolean The address book id of the GAL, or false if not available.

contacts_import() public méthode

Import the provided contact data into Horde's contacts storage
public contacts_import ( Horde_ActiveSync_Message_Contact $content, string $addressbook = null ) : mixed
$content Horde_ActiveSync_Message_Contact The contact data
$addressbook string The addessbook id. @since 2.12.0
Résultat mixed string|boolean The new UID or false on failure.

contacts_listUids() public méthode

Get a list of all contacts a user can see
public contacts_listUids ( string $source = null ) : array
$source string The source to list. If null, use multiplex. @since 2.12.0
Résultat array An array of contact UIDs

contacts_replace() public méthode

Replace the specified contact with the data provided.
public contacts_replace ( string $uid, string $content )
$uid string The UID of the contact to replace
$content string The contact data

createFolder() public méthode

Create a new folder/source in the specified collection.
Since: 2.12.0
public createFolder ( string $class, string $foldername ) : string | integer
$class string The collection class. A Horde_ActiveSync::CLASS_* constant.
$foldername string The name of the new folder.
Résultat string | integer The new folder serverid.

deleteFolder() public méthode

Delete a folder.
Since: 2.12.0
public deleteFolder ( string $class, string $id )
$class string The EAS collection class.
$id string The folder id

files_browse() public méthode

Browse VFS backend.
public files_browse ( string $path ) : array
$path string 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
Résultat 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

filters_getVacation() public méthode

Return the currently set vacation message details.
public filters_getVacation ( ) : array | boolean
Résultat array | boolean The vacation rule properties or false if interface unavailable.

filters_setVacation() public méthode

Set vacation message properties.
public filters_setVacation ( array $setting )
$setting array The vacation details.

getChanges() public méthode

Get all server changes for the specified collection
public getChanges ( string $collection, integer $from_ts, integer $to_ts, string $server_id ) : array
$collection string The collection type (a Horde interface name - calendar, contacts, tasks)
$from_ts integer Starting timestamp or modification sequence.
$to_ts integer Ending timestamp or modification sequence.
$server_id string The server id of the collection. If null, uses multiplexed.
Résultat array A hash of add, modify, and delete uids

getFolders() public méthode

Return the list of folders to sync for the specified collection.
Since: 2.12.0
public getFolders ( string $collection, integer $multiplex ) : array | string
$collection string The collection class A Horde_ActiveSync::CLASS_* constant.
$multiplex integer A bitmask flagging the collections that must be multiplexed, regardless of horde's settings
Résultat 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)

getHighestModSeq() public méthode

Return the highest modification sequence value for the specified collection
Since: 2.6.0
public getHighestModSeq ( $collection, $id = null ) : integer
Résultat integer The modseq value.

getRecipientCache() public méthode

Returns the favouriteRecipients data for RI requests.
public getRecipientCache ( integer $max = 100 ) : array
$max integer The maximum number of recipients to return.
Résultat array An array of email addresses.

hasFeature() public méthode

Return if the backend collection has the requested feature.
Since: 2.6.0
public hasFeature ( string $feature, string $collection ) : boolean
$feature string The requested feature.
$collection string The requested collection id.
Résultat boolean

horde_getPref() public méthode

Obtain a user's preference setting.
Deprecation: (unused)
public horde_getPref ( string $app, string $pref ) : mixed
$app string The Horde application providing the setting.
$pref string The name of the preference setting.
Résultat mixed The preference value

horde_hasInterface() public méthode

Obtain the name of the Horde application that provides the specified api interface.
public horde_hasInterface ( string $api ) : string
$api string The interface name
Résultat string The application name.

horde_hasMethod() public méthode

Wrapper around Horde_Registry::hasMethod.
public horde_hasMethod ( string $method, string $api ) : boolean
$method string The method name.
$api string The API to check.
Résultat boolean

horde_listApis() public méthode

Return all active api interfaces.
public horde_listApis ( ) : array
Résultat array An array of interface names.

mail_ensureMessageFlags() public méthode

Add any user-defined flags to IMP's preferences.
public mail_ensureMessageFlags ( array $flags )
$flags array An array of flags to add.

mail_getMaillog() public méthode

Return a Maillog entry for the specified Message-ID.
public mail_getMaillog ( string $mid ) : Horde_History_Log | false
$mid string The Message-ID of the message.
Résultat Horde_History_Log | false The history log or false if not found.

mail_getMaillogChanges() public méthode

Poll the maillog for changes since the specified timestamp.
public mail_getMaillogChanges ( integer $ts ) : array
$ts integer The timestamp to check since.
Résultat array An array of Message-IDs that have changed since $ts.

mail_logMaillog() public méthode

Log a forward/reply action to the maillog.
public mail_logMaillog ( string $action, string $mid, string $recipients = null, string $folder = null )
$action string The action to log. One of: 'forward', 'reply', 'reply_all'.
$mid string The Message-ID to log.
$recipients string The recipients the mail was forwarded to.
$folder string The sent-mail folder. @since Horde_Core 2.27.0

mail_logRecipient() public méthode

public mail_logRecipient ( $action, $recipients, $message_id )

mdnSend() public méthode

public mdnSend ( $mdn )

notes_delete() public méthode

Delete a note from the backend.
Since: 5.1
public notes_delete ( string $id )
$id string The task's uid

notes_export() public méthode

Export a single note from the backend.
Since: 5.1
public notes_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Note
$uid string The note uid
$options array Options to pass to the backend exporter.
Résultat Horde_ActiveSync_Message_Note The note message object

notes_getActionTimestamp() public méthode

Return the timestamp for the last time $action was performed.
Since: 5.1
public notes_getActionTimestamp ( string $uid, string $action, string $notepad = null ) : integer
$uid string The UID of the task we are interested in.
$action string The action we are interested in (add, modify...)
$notepad string The notepad to use, if not using multiplex.
Résultat integer

notes_import() public méthode

Importa a single note into the backend.
Since: 5.1
public notes_import ( Horde_ActiveSync_Message_Note $message, string $notebook = null ) : string
$message Horde_ActiveSync_Message_Note The note message object
$notebook string The notebook id. @since 2.12.0
Résultat string The newly added notes's uid.

notes_listNotepads() public méthode

List notepads.
Deprecation: - @todo was never used, remove in H6.
Since: 5.1
public notes_listNotepads ( ) : array
Résultat array

notes_listUids() public méthode

List all notes in the user's default notepad.
Since: 5.1
public notes_listUids ( string $notepad = null ) : array
$notepad string The notepad id to list. If null, use multiplexed. @since 2.12.0
Résultat array An array of note uids.

notes_replace() public méthode

Replace an existing task with the provided task.
Since: 5.1
public notes_replace ( string $uid, Horde_ActiveSync_Message_Note $message )
$uid string The existing tasks's uid
$message Horde_ActiveSync_Message_Note The task object

resolveRecipient() public méthode

Resolve a recipient
public resolveRecipient ( string $query, array $opts = [] ) : array
$query string The search string. Ususally an email address.
$opts array 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.
Résultat array The search results, keyed by the $query.

setLogger() public méthode

Set a logger for this object.
public setLogger ( $logger )

softDelete() public méthode

Return message UIDs that should be SOFTDELETEd from the client.
public softDelete ( string $collection, long $from_ts, long $to_ts, string $source = null ) : array
$collection string The collection type.
$from_ts long The start of the time period to search.
$to_ts long The end of the time period to search.
$source string Limit to this source only. @since 2.12.0
Résultat array An array of message UIDs that occur within the $from_ts and $to_ts range that are to be SOFTDELETEd from the client.

tasks_delete() public méthode

Delete a task from the backend.
public tasks_delete ( string $id )
$id string The task's uid

tasks_export() public méthode

Export a single task from the backend.
public tasks_export ( string $uid, array $options = [] ) : Horde_ActiveSync_Message_Task
$uid string The task uid
$options array Options to pass to the backend exporter.
Résultat Horde_ActiveSync_Message_Task The task message object

tasks_getActionTimestamp() public méthode

Return the timestamp or modseq for the last time $action was performed.
public tasks_getActionTimestamp ( string $uid, string $action, $tasklist = null ) : integer
$uid string The UID of the task we are interested in.
$action string The action we are interested in (add, modify...)
Résultat integer

tasks_import() public méthode

Import a single task into the backend.
public tasks_import ( Horde_ActiveSync_Message_Task $message, string $tasklist = null ) : string
$message Horde_ActiveSync_Message_Task The task message object
$tasklist string The tasklist id. @since 2.12.0
Résultat string The newly added task's uid.

tasks_listUids() public méthode

List all tasks in the user's default tasklist.
public tasks_listUids ( string $tasklist = null ) : array
$tasklist string The tasklist to check. If null, use multiplexed.
Résultat array An array of task uids.

tasks_replace() public méthode

Replace an existing task with the provided task.
public tasks_replace ( string $uid, Horde_ActiveSync_Message_Task $message )
$uid string The existing tasks's uid
$message Horde_ActiveSync_Message_Task The task object

Property Details

$_capabilities protected_oe property

Cache results of capability queries
protected array $_capabilities
Résultat array

$_folderCache protected_oe property

Cache list of folders
protected array $_folderCache
Résultat array

$_gal protected_oe property

Cache the GAL to avoid hitting the contacts API multiple times.
protected string $_gal
Résultat string

$_logger protected_oe property

The logger
protected Horde_Log_Logger $_logger
Résultat Horde_Log_Logger

$_registry protected_oe property

Horde registry
protected Horde_Registry $_registry
Résultat Horde_Registry