Property | Type | Description | |
---|---|---|---|
$_auth | Horde_Core_ActiveSync_Auth | Authentication object | |
$_classMap | array | Class => Id map | |
$_connector | Horde_Core_ActiveSync_Connector | Horde connector instance | |
$_displayMap | array | Mappings for server uids -> display names. Populated in the const'r so we can use localized text. | |
$_folders | array | Local cache of folders polled from the various backends. | |
$_imap | Horde_ActiveSync_Imap_Adapter | Imap client adapter | |
$_modCache | Cache message stats | ||
$_pid | integer | Current process id | |
$_verbs | array | Local cache of last verb searches. |
Method | Description | |
---|---|---|
__construct ( array $params = [] ) | Const'r | |
authenticate ( string $username, string $password, string $domain = null ) : mixed | Authenticate to Horde | |
autoDiscover ( array $params = [] ) : array | Attempt to autodiscover. Autodiscovery happens before the user is authenticated, and ALWAYS uses the user's email address. We have to do our best to translate email address to username. If this fails, the device simply falls back to requiring full user configuration. | |
buildFbString ( stdClass $fb, Horde_Date $start, Horde_Date $end ) : string | Build a EAS style FB string. Essentially, each digit represents 1/2 hour. | |
changeFolder ( string $old_name, string $new_name, string $parent, string $uid = null, integer $type = null ) : Horde_ActiveSync_Message_Folder | Change a folder on the server. | |
changeMessage ( string $folderid, string $id, Horde_ActiveSync_Message_Base $message, Horde_ActiveSync_Device $device ) : array | boolean | Add/Edit a message | |
clearAuthentication ( ) | Clean up | |
createDeviceCallback ( Horde_ActiveSync_Device $device ) : boolean | integer | Callback method called before new device is created for a user. Allows final check of permissions. | |
deleteFolder ( string $id, string $parent = Horde_ActiveSync::FOLDER_ROOT ) | Delete a folder on the server. | |
deleteMessage ( string $folderid, array $ids, boolean $instanceids = false ) : array | Delete a message | |
deviceCallback ( Horde_ActiveSync_Device $device ) : boolean | integer | Callback that allows custom policy checking on the device before allowing it to connect. Useful for things like limiting the types of devices that can connect e.g., not allowing iOS devices etc. | |
getAttachment ( string $name, array $options = [] ) : array | Return the specified attachment. | |
getCurrentPolicy ( boolean | array $device = false ) : array | Return the security policies. | |
getFolder ( string $id ) : Horde_ActiveSync_Message_Folder | Return a Horde_ActiveSync_Message_Folder object. | |
getFolderList ( ) : array | Return an array of stats for the server's folder list. | |
getFolders ( ) : array | Return an array of the server's folder objects. | |
getFreebusy ( $user, array $options = [] ) | Request freebusy information from the server | |
getMessage ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base | Obtain an ActiveSync message from the backend. | |
getProvisioning ( Horde_ActiveSync_Device $device = null ) : mixed | Returns the provisioning support for the current request. | |
getSearchResults ( string $type, array $query ) : array | Returns array of items which contain contact information | |
getServerChanges ( Horde_ActiveSync_Folder_Base $folder, integer $from_ts, integer $to_ts, integer $cutoffdate, boolean $ping, boolean $ignoreFirstSync = false, integer $maxitems = 100, boolean $refreshFilter = false ) : array | Get a list of server changes that occured during the specified time period. | |
getSettings ( array $settings, stdClass $device ) : array | Return settings from the backend for a SETTINGS request. | |
getSpecialFolderNameByType ( string $type ) : string | boolean | Return the server id of the specified special folder type. | |
getSyncStamp ( string $collection, integer $last = null ) : integer | boolean | Return the SyncStamp - the value used to determine the end of the current sync range. If the collection backend supports modification sequences, we will use that, otherwise return the current timestamp. | |
getUsernameFromEmail ( string $email ) : string | Attempt to guess a username based on the email address passed from EAS Autodiscover requests. | |
getWasteBasket ( $class ) : string | boolean | Get the wastebasket folder. If this returns false, imap deletions are permanent. If it returns a valid mailbox, deletions are treated as moves to this mailbox. Note that any collection class other than Horde_ActiveSync::CLASS_EMAIL will return false. | |
itemOperationsEmptyFolder ( array $params ) | Empty specified mailbox. | |
itemOperationsFetchMailbox ( string $longid, array $bodyprefs, integer $mimesupport ) : Horde_ActiveSync_Message_Base | Return Horde_Imap_Message_Mail object represented by the specified longid. Used to fetch email objects from a search result, which only returns a 'longid'. | |
itemOperationsGetAttachmentData ( string $filereference ) : Horde_ActiveSync_Message_AirSyncBaseFileAttachment | Return the specified attachement data for an ITEMOPERATIONS request. | |
itemOperationsGetDocumentLibraryLink ( string $linkid, array $cred ) : array | Return a documentlibrary item. | |
meetingResponse ( array $response ) : string | Handle meeting responses. | |
modifyDeviceCallback ( Horde_ActiveSync_Device $device ) : Horde_ActiveSync_Device | Allow modification of device properties before request processing continues. | |
moveMessage ( string $folderid, array $ids, string $newfolderid ) : array | Move message | |
resolveRecipient ( string $type, string $search, array $opts = [] ) : array | Handle ResolveRecipient requests | |
sendMail ( mixed $rfc822, integer | boolean $forward = false, integer | boolean $reply = false, string $parent = false, boolean $save = true, Horde_ActiveSync_Message_SendMail $message = null ) : boolean | Sends the email represented by the rfc822 string received by the PIM. | |
setLogger ( Horde_Log_Logger $logger ) | Set the logger. | |
setReadFlag ( string $folderId, string $id, integer $flags ) | Set the read (\seen) flag on the specified message. | |
setSettings ( array $settings, stdClass $device ) : array | Set backend settings from a SETTINGS request. | |
setup ( string $user ) : boolean | Setup sync parameters. The user provided here is the user the backend will sync with. This allows you to authenticate as one user, and sync as another, if the backend supports this (Horde does not). | |
statFolder ( string $id, mixed $parent = '0', mixed $mod = null, string $serverid = null, integer $type = null ) : a | Stat folder. Note that since the only thing that can ever change for a folder is the name, we use that as the 'mod' value. | |
statMailMessage ( string $folderid, integer | array $id ) : array | Build a stat structure for an email message. | |
statMessage ( $folderid, $id ) | Get message stat data |
Method | Description | |
---|---|---|
_buildDummyFolder ( $id ) | ||
_buildNonMailFolder ( string $id, stirng $parent, integer $type, string $name ) : Horde_ActiveSync_Message_Folder | Helper to build a folder object for non-email folders. | |
_endBuffer ( ) | End output buffering, log any unexpected output. | |
_getFolder ( string $id, array $params = [] ) : Horde_ActiveSync_Message_Folder | Factory for creating new Horde_ActiveSync_Message_Folder objects from within this class. | |
_getIdentityFromAddress ( ) : string | Return the current user's From/Reply_To address. | |
_getLastVerb ( string $mid ) : array | Return the last verb executed for the specified Message-ID. | |
_getMailFolder ( string $sid, array $fl, array $f ) : Horde_ActiveSync_Message_Folder | Return a folder object representing an email folder. Attempt to detect special folders appropriately. | |
_getMailFolders ( ) : array | Return the list of mail server folders. | |
_getMaillogChanges ( Horde_ActiveSync_Folder_Imap $folder, integer $ts ) : Horde_ActiveSync_Folder_Imap | Get verb changes from the maillog. | |
_getPolicyFromPerms ( boolean $deviceinfo = false ) : array | Return a policy array suitable for transforming into either wbxml or xml to send to the device in the provision response. | |
_getPolicyValue ( $policy, $allowed ) | ||
_mungeCert ( string $cert ) : string | Removes the beginning/ending delimiters from the certificate. | |
_parseFolderId ( string $id, boolean $checkEmail = false ) : string | array | Parse a folderid. | |
_searchGal ( array $query ) : array | Perform a search of the Global Address Book. | |
_searchMailbox ( array $query ) : array | Perform a search of the email store. | |
_smartStatMessage ( string $folderid, string $id, boolean $hint ) : message | Stat a backend item, optionally using the cached value if available. |
public __construct ( array $params = [] ) | ||
$params | array | Configuration parameters: - logger: (Horde_Log_Logger) The logger. DEFAULT: none (No logging). - state: (Horde_ActiveSync_State_Base) The state driver. DEFAULT: none (REQUIRED). - connector: (Horde_Core_ActiveSync_Connector) The connector object for communicating with the registry. DEFAULT: none (REQUIRED) - auth: (Horde_Core_ActiveSync_Auth) The auth object. DEFAULT: none (REQUIRED). - imap: (Horde_ActiveSync_Imap_Adapter) The IMAP adapter if email support is desired. DEFAULT: none (No email support will be provided). - cache: (Horde_Cache) A cache object to store certain types of data, such as mailbox search results. @since 2.12.0 |
protected _buildNonMailFolder ( string $id, stirng $parent, integer $type, string $name ) : Horde_ActiveSync_Message_Folder | ||
$id | string | The folder's server id. |
$parent | stirng | The folder's parent id. |
$type | integer | The folder type. |
$name | string | The folder description. |
return | Horde_ActiveSync_Message_Folder | The folder object. |
protected _endBuffer ( ) |
protected _getFolder ( string $id, array $params = [] ) : Horde_ActiveSync_Message_Folder | ||
$id | string | The folder's server id. |
$params | array | Additional folder parameters: - class: The collection class, a Horde_ActiveSync::CLASS_* constant - primary: This folder is the 'default' collection for this class. - display: The display name for FOLDER_TYPE_USER folders. |
return | Horde_ActiveSync_Message_Folder | The folder object. |
protected _getIdentityFromAddress ( ) : string | ||
return | string | A RFC822 valid email string. |
protected _getLastVerb ( string $mid ) : array | ||
$mid | string | The Message-ID. |
return | array | The most recent history log entry array for $mid. |
protected _getMailFolders ( ) : array | ||
return | array | An array of Horde_ActiveSync_Message_Folder objects. |
protected _getMaillogChanges ( Horde_ActiveSync_Folder_Imap $folder, integer $ts ) : Horde_ActiveSync_Folder_Imap | ||
$folder | Horde_ActiveSync_Folder_Imap | The folder to search. |
$ts | integer | The timestamp to start from. |
return | Horde_ActiveSync_Folder_Imap | The folder object, with any changes added accordingly. |
protected _getPolicyFromPerms ( boolean $deviceinfo = false ) : array | ||
$deviceinfo | boolean | EAS 14.1 DEVICESETTINGS sent with PROVISION. |
return | array |
protected _mungeCert ( string $cert ) : string | ||
$cert | string | The certificate text. |
return | string | The certificate text, with delimiters removed. |
protected _searchGal ( array $query ) : array | ||
$query | array | A query array. @see self::getSearchResults() |
return | array | The results array. @see self::getSearchResults() |
protected _searchMailbox ( array $query ) : array | ||
$query | array | A query array. @see self::getSearchResults() |
return | array | The results array. @see self::getSearchResults() |
public authenticate ( string $username, string $password, string $domain = null ) : mixed | ||
$username | string | The username to authenticate as (as passed by the device). |
$password | string | The password |
$domain | string | The user domain (unused in this driver). |
return | mixed | Boolean true on success, boolean false on credential failure or Horde_ActiveSync::AUTH_REASON_* constant on policy failure. |
public autoDiscover ( array $params = [] ) : array | ||
$params | array | Optional array of parameters. |
return | array | Either an array of autodiscover parameters that the ActiveSync server will use to build the response, or the raw XML response contained in the raw_xml key. |
public static buildFbString ( stdClass $fb, Horde_Date $start, Horde_Date $end ) : string | ||
$fb | stdClass | The fb information. An object containing: - s: The start of the period covered. - e: The end of the period covered. - b: An array of busy periods. |
$start | Horde_Date | The start of the period requested by the client. |
$end | Horde_Date | The end of the period requested by the client. |
return | string | The EAS freebusy string. |
public changeFolder ( string $old_name, string $new_name, string $parent, string $uid = null, integer $type = null ) : Horde_ActiveSync_Message_Folder | ||
$old_name | string | The server's existing folder id. |
$new_name | string | The new display name. |
$parent | string | The folder's parent server id, if needed. |
$uid | string | The existing folder uid, if this is an edit. @since 2.5.0 (@todo Look at this for H6. It's here now to save an extra DB lookup for data we already have.) |
$type | integer | The EAS Folder type. @since 2.12.0 |
return | Horde_ActiveSync_Message_Folder |
public changeMessage ( string $folderid, string $id, Horde_ActiveSync_Message_Base $message, Horde_ActiveSync_Device $device ) : array | boolean | ||
$folderid | string | The server id of the message's folder. |
$id | string | The server's uid for the message if this is a change to an existing message, false if new. |
$message | Horde_ActiveSync_Message_Base | The activesync message. |
$device | Horde_ActiveSync_Device | The device information @since 2.5.0 |
return | array | boolean | A stat array if successful, otherwise false. Contains the following keys: - id: (mixed) The UID of the message/item. - mod: (mixed) A value to indicate the last modification. - flags: (array) An array of flag chagnes, empty array if no changes. - categories: (array|boolean) An array of EAS categories for email messages that exist as IMAP flags, false if no changes. - atchash: (array|boolean) An array of clientid->filereference mappings for file attachment changes made to appointment or draft email folders. @since 2.27.0 - conversationid: (hex encoded opaque value) The conversationid value if adding Draft email message. @since 2.28.0 - conversationindex: (integer) The conversation index value if adding Draft email message @since 2.28.0 |
public createDeviceCallback ( Horde_ActiveSync_Device $device ) : boolean | integer | ||
$device | Horde_ActiveSync_Device | |
return | boolean | integer | True on success (device allowed to be created) or error code on failure. |
public deleteFolder ( string $id, string $parent = Horde_ActiveSync::FOLDER_ROOT ) | ||
$id | string | The server's folder id. |
$parent | string | The folder's parent, if needed. @deprecated |
public deleteMessage ( string $folderid, array $ids, boolean $instanceids = false ) : array | ||
$folderid | string | The folder id |
$ids | array | The message ids to delete |
$instanceids | boolean | If true, $ids is a hash of instanceids => uids. @since 2.23.0 |
return | array | An array of succesfully deleted messages (currently only guarenteed for email messages). |
public deviceCallback ( Horde_ActiveSync_Device $device ) : boolean | integer | ||
$device | Horde_ActiveSync_Device | The device object. |
return | boolean | integer | True on success (device allowed to be created) or error code on failure. |
public getAttachment ( string $name, array $options = [] ) : array | ||
$name | string | The attachment identifier. For this driver, this consists of 'mailbox:uid:mimepart' |
$options | array | Any options requested. Currently supported: - stream: (boolean) Return a stream resource for the mime contents. DEFAULT: true (Return a stream resource for the 'data' value). |
return | array | The attachment in the form of an array with the following structure: array('content-type' => {the content-type of the attachement}, 'data' => {the raw attachment data}) |
public getFolderList ( ) : array | ||
return | array | An array of folder stats @see self::statFolder() |
public getFolders ( ) : array | ||
return | array | An array of Horde_ActiveSync_Message_Folder objects. |
public getFreebusy ( $user, array $options = [] ) | ||
$options | array |
public getMessage ( string $folderid, string $id, array $collection ) : Horde_ActiveSync_Message_Base | ||
$folderid | string | The server's folder id this message is from |
$id | string | The server's message id |
$collection | array | The colletion data. May contain things like: - mimesupport: (integer) Indicates if the device has MIME support. DEFAULT: 0 (No MIME support) - truncation: (integer) Non-MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation) - mimetruncation: (integer) MIME truncation limit. Anything larger than this amount of bytes will be truncated. DEFAULT: 0 (No truncation) - bodyprefs: (array) The bodypref array from the device. - type: (integer) The Horde_ActiveSync::FOLDER_TYPE_* for this collection. |
return | Horde_ActiveSync_Message_Base | The message data |
public getProvisioning ( Horde_ActiveSync_Device $device = null ) : mixed | ||
$device | Horde_ActiveSync_Device | The device object. @since 2.16.0 |
return | mixed | The value of the provisiong support flag. |
public getSearchResults ( string $type, array $query ) : array | ||
$type | string | The search type; ['gal'|'mailbox'] |
$query | array | The search query. An array containing: - query: (array) The search query. Contains at least: 'query' and 'range'. The rest depends on the type of search being performed. DEFAULT: none, REQUIRED - range: (string) A range limiter. DEFAULT: none (No range used). - rebuildresults: (boolean) If true, invalidate any cached search. DEFAULT: Use cached search results if available. - deeptraversal: (boolean) If true, traverse sub folders. @todo NOT IMPLEMENTED YET. |
return | array | An array containing: - rows: An array of search results, limited by $query['range']. - status: The search store status code. - total: The total number of matches (not limited by $query['range'] |
public getServerChanges ( Horde_ActiveSync_Folder_Base $folder, integer $from_ts, integer $to_ts, integer $cutoffdate, boolean $ping, boolean $ignoreFirstSync = false, integer $maxitems = 100, boolean $refreshFilter = false ) : array | ||
$folder | Horde_ActiveSync_Folder_Base | The ActiveSync folder object to request changes for. |
$from_ts | integer | The starting timestamp |
$to_ts | integer | The ending timestamp |
$cutoffdate | integer | The earliest date to retrieve back to. |
$ping | boolean | If true, returned changeset may not contain the full changeset, but rather only a single change, designed only to indicate *some* change has taken place. The value should not be used to determine *what* change has taken place. |
$ignoreFirstSync | boolean | If true, will not trigger an initial sync if $from_ts is 0. Needed to avoid race conditions when we don't have any history data. @since 2.6.0 @todo If we can pass the synckey ( perhaps as part of $folder), we can just look for synckey 0 to know when we CAN trigger an initial sync without this flag. |
$maxitems | integer | Maximum number of recipients for a RI collection. @since 2.12.0 |
$refreshFilter | boolean | Force a SOFTDELETE operation and check for new items within the (newly changed) current FilterType interval. @since 2.19.0 |
return | array | An array of hashes that contain the ids of items that have changed in the specified collection along with a 'type' flag that indicates the type of change. |
public getSettings ( array $settings, stdClass $device ) : array | ||
$settings | array | An array of settings to return. Currently supported: - oof: The out of office message information. @todo - userinformation: UserInformation requests. - emailaddresses: User's From email addresses. - primarysmtpaddress: (@deprecated) The SMTP address used for the default account. Only supported in EAS >= 14.1 using accounts. - status: EAS status code. - accounts: Array with each entry containing emailaddresses, fullname for additional identities. The primary address should be the first in the emailaddresses array. |
$device | stdClass | The device to obtain settings for. |
return | array | The requested settings. |
public getSyncStamp ( string $collection, integer $last = null ) : integer | boolean | ||
$collection | string | The collection id we are currently requesting. |
$last | integer | The last syncstamp, if known. Used to help sanity check the state. |
return | integer | boolean | The SyncStamp or false if an error is encountered. |
public getUsernameFromEmail ( string $email ) : string | ||
string | The email address | |
return | string | The username to use to authenticate to Horde with. |
public getWasteBasket ( $class ) : string | boolean | ||
return | string | boolean | Returns name of the trash folder, or false if not using a trash folder. |
public itemOperationsEmptyFolder ( array $params ) | ||
$params | array | An array of parameters: - folderid: The backend folderid of the mailbox to empty. - subfolders: IGNORED for now. |
public itemOperationsFetchMailbox ( string $longid, array $bodyprefs, integer $mimesupport ) : Horde_ActiveSync_Message_Base | ||
$longid | string | The unique search result identifier. Consists of mailbox:uid E.g, INBOX:110 |
$bodyprefs | array | The bodypreference array. |
$mimesupport | integer | Mimesupport flag. A Horde_ActiveSync::MIME_SUPPORT_* constant. |
return | Horde_ActiveSync_Message_Base | The message requested. |
public itemOperationsGetAttachmentData ( string $filereference ) : Horde_ActiveSync_Message_AirSyncBaseFileAttachment | ||
$filereference | string | The attachment identifier. |
return | Horde_ActiveSync_Message_AirSyncBaseFileAttachment |
public meetingResponse ( array $response ) : string | ||
$response | array | The response data. Contains: - requestid: The identifier of the meeting request. Used by the server to fetch the original meeting request details. - response: The user's response to the request. One of the response code constants. - folderid: The collection id that contains the meeting request. - |
return | string | The UID of any created calendar entries, otherwise false. |
public modifyDeviceCallback ( Horde_ActiveSync_Device $device ) : Horde_ActiveSync_Device | ||
$device | Horde_ActiveSync_Device | The device object. |
return | Horde_ActiveSync_Device | The possibly modified device object. |
public moveMessage ( string $folderid, array $ids, string $newfolderid ) : array | ||
$folderid | string | Existing folder id. |
$ids | array | Message UIDs to move. @todo For H6 this should take a single id. We can't bulk move them for other reasons. |
$newfolderid | string | The new folder id to move to. |
return | array | An array of successfully moved messages with the old UIDs as keys and new UIDs as values. |
public resolveRecipient ( string $type, string $search, array $opts = [] ) : array | ||
$type | string | The type of recipient request. e.g., 'certificate' |
$search | string | The email to resolve. |
$opts | array | Any options required to perform the resolution. - 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. |
return | array | An array of results containing any of the following: - type: (string) The type of result a GAL entry or personal address book entry. A Horde_ActiveSync::RESOLVE_RESULT constant. - displayname: (string) The display name of the contact. - emailaddress: (string) The emailaddress. - entries: (array) An array of certificates. - availability: (string) A EAS style FB string. - picture: (Horde_ActiveSync_Message_ResolveRecipientsPicture) |
public sendMail ( mixed $rfc822, integer | boolean $forward = false, integer | boolean $reply = false, string $parent = false, boolean $save = true, Horde_ActiveSync_Message_SendMail $message = null ) : boolean | ||
$rfc822 | mixed | The rfc822 mime message, a string or stream resource. |
$forward | integer | boolean | The UID of the message, if forwarding or true if forwarding and EAS >= 14.0 |
$reply | integer | boolean | The UID of the message if replying or true if replying and EAS >= 14.0 |
$parent | string | The collection id of parent message if forwarding/replying. |
$save | boolean | Save in sent messages. |
$message | Horde_ActiveSync_Message_SendMail | The entire message object for EAS 14+ requests. @since 2.5.0 |
return | boolean |
public setLogger ( Horde_Log_Logger $logger ) | ||
$logger | Horde_Log_Logger | The logger. |
public setSettings ( array $settings, stdClass $device ) : array | ||
$settings | array | The settings to store. Currently supported: - oof: (array) The Out of Office message. |
$device | stdClass | The device to store settings for. |
return | array | An array of status responses for each set request. e.g.,: array('oof' => Horde_ActiveSync_Request_Settings::STATUS_SUCCESS); |
public statFolder ( string $id, mixed $parent = '0', mixed $mod = null, string $serverid = null, integer $type = null ) : a | ||
$id | string | The folder's EAS uid |
$parent | mixed | The parent folder (or 0 if none). |
$mod | mixed | Modification indicator. For folders, this is the display name of the folder, since that's the only thing that can change. |
$serverid | string | The backend serverid for this folder. |
$type | integer | The EAS folder type, a Horde_ActiveSync::FOLDER_TYPE_* contant. @since 2.12.0 |
return | a | stat hash: - id: The activesync folder identifier. - mod: The modification value. - parent: The folder's parent id. - serverid: The backend server's folder name for this folder. - type: The EAS folder type. @since 2.12.0 |
protected Horde_Core_ActiveSync_Auth $_auth | ||
return | Horde_Core_ActiveSync_Auth |
protected Horde_Core_ActiveSync_Connector $_connector | ||
return | Horde_Core_ActiveSync_Connector |
protected array $_displayMap | ||
return | array |
protected array $_folders | ||
return | array |
protected Horde_ActiveSync_Imap_Adapter $_imap | ||
return | Horde_ActiveSync_Imap_Adapter |
protected array $_verbs | ||
return | array |