APPOINTMENTS_FOLDER_UID
APPOINTMENTS_FOLDER_UID
Server folder ids for non-email folders.
We use the @ modifiers to avoid issues in the (fringe) case of having email folders named like contacts etc...
Horde backend.
Provides the communication between horde data and ActiveSync server.
$_connector : \Horde_Core_ActiveSync_Connector
Horde connector instance
$_auth : \Horde_Core_ActiveSync_Auth
Authentication object
__construct(array $params = array())
Const'r
array | $params | Configuration parameters:
|
authenticate(string $username, string $password, string $domain = null) : mixed
Authenticate to Horde
string | $username | The username to authenticate as (as passed by the device). |
string | $password | The password |
string | $domain | The user domain (unused in this driver). |
Boolean true on success, boolean false on credential failure or Horde_ActiveSync::AUTHREASON* constant on policy failure.
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).
string | $user | The username to sync as on the backend. |
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.
$class |
Returns name of the trash folder, or false if not using a trash folder.
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.
string | $old_name | The server's existing folder id. |
string | $new_name | The new display name. |
string | $parent | The folder's parent server id, if needed. |
string | $uid | 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.) |
integer | $type | The EAS Folder type. @since 2.12.0 |
deleteFolder(string $id, string $parent = \Horde_ActiveSync::FOLDER_ROOT)
Delete a folder on the server.
string | $id | The server's folder id. |
string | $parent | The folder's parent, if needed. @deprecated |
Horde_ActiveSync_Exception
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.
string | $id | The folder's EAS uid |
mixed | $parent | The parent folder (or 0 if none). |
mixed | $mod | Modification indicator. For folders, this is the display name of the folder, since that's the only thing that can change. |
string | $serverid | The backend serverid for this folder. |
integer | $type | The EAS folder type, a Horde_ActiveSync::FOLDERTYPE* contant. @since 2.12.0 |
stat hash:
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.
\Horde_ActiveSync_Folder_Base | $folder | The ActiveSync folder object to request changes for. |
integer | $from_ts | The starting timestamp |
integer | $to_ts | The ending timestamp |
integer | $cutoffdate | The earliest date to retrieve back to. |
boolean | $ping | 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. |
boolean | $ignoreFirstSync | 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. |
integer | $maxitems | Maximum number of recipients for a RI collection. @since 2.12.0 |
boolean | $refreshFilter | Force a SOFTDELETE operation and check for new items within the (newly changed) current FilterType interval. @since 2.19.0 |
Thrown when the requested collection appears to be no longer available. For H6, we should have the application APIs be responsible for differentiating between deleted/not-visible.
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.
getMessage(string $folderid, string $id, array $collection) : \Horde_ActiveSync_Message_Base
Obtain an ActiveSync message from the backend.
string | $folderid | The server's folder id this message is from |
string | $id | The server's message id |
array | $collection | The colletion data. May contain things like:
|
Horde_Exception_NotFound
The message data
getAttachment(string $name, array $options = array()) : array
Return the specified attachment.
string | $name | The attachment identifier. For this driver, this consists of 'mailbox:uid:mimepart' |
array | $options | Any options requested. Currently supported:
|
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})
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'.
string | $longid | The unique search result identifier. Consists of mailbox:uid E.g, INBOX:110 |
array | $bodyprefs | The bodypreference array. |
integer | $mimesupport | Mimesupport flag. A Horde_ActiveSync::MIMESUPPORT* constant. |
The message requested.
itemOperationsGetAttachmentData(string $filereference) : \Horde_ActiveSync_Message_AirSyncBaseFileAttachment
Return the specified attachement data for an ITEMOPERATIONS request.
string | $filereference | The attachment identifier. |
itemOperationsGetDocumentLibraryLink(string $linkid, array $cred) : array
Return a documentlibrary item.
string | $linkid | The linkid |
array | $cred | A credential array:
|
An array containing the data and metadata:
deleteMessage(string $folderid, array $ids, boolean $instanceids = false) : array
Delete a message
string | $folderid | The folder id |
array | $ids | The message ids to delete |
boolean | $instanceids | If true, $ids is a hash of instanceids => uids. @since 2.23.0 |
An array of succesfully deleted messages (currently only guarenteed for email messages).
moveMessage(string $folderid, array $ids, string $newfolderid) : array
Move message
string | $folderid | Existing folder id. |
array | $ids | Message UIDs to move. @todo For H6 this should take a single id. We can't bulk move them for other reasons. |
string | $newfolderid | The new folder id to move to. |
An array of successfully moved messages with the old UIDs as keys and new UIDs as values.
changeMessage(string $folderid, string $id, \Horde_ActiveSync_Message_Base $message, \Horde_ActiveSync_Device $device) : array|boolean
Add/Edit a message
string | $folderid | The server id of the message's folder. |
string | $id | The server's uid for the message if this is a change to an existing message, false if new. |
\Horde_ActiveSync_Message_Base | $message | The activesync message. |
\Horde_ActiveSync_Device | $device | The device information @since 2.5.0 |
A stat array if successful, otherwise false. Contains the following keys:
getSearchResults(string $type, array $query) : array
Returns array of items which contain contact information
string | $type | The search type; ['gal'|'mailbox'] |
array | $query | The search query. An array containing:
|
An array containing:
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.
mixed | $rfc822 | The rfc822 mime message, a string or stream resource. |
integer|boolean | $forward | The UID of the message, if forwarding or true if forwarding and EAS >= 14.0 |
integer|boolean | $reply | The UID of the message if replying or true if replying and EAS >= 14.0 |
string | $parent | The collection id of parent message if forwarding/replying. |
boolean | $save | Save in sent messages. |
\Horde_ActiveSync_Message_SendMail | $message | The entire message object for EAS 14+ requests. @since 2.5.0 |
getSpecialFolderNameByType(string $type) : string|boolean
Return the server id of the specified special folder type.
string | $type | The self::SPECIAL_* constant. |
The folder's server id or false on failure.
None found |
statMailMessage(string $folderid, integer|array $id) : array
Build a stat structure for an email message.
string | $folderid | The mailbox name. |
integer|array | $id | The message(s) to stat (IMAP UIDs). |
None found |
getCurrentPolicy(boolean|array $device = false) : array
Return the security policies.
boolean|array | $device | The device information sent by EAS 14.1 set to false otherwise. |
An array of provisionable properties and values.
None found |
getProvisioning(\Horde_ActiveSync_Device $device = null) : mixed
Returns the provisioning support for the current request.
\Horde_ActiveSync_Device | $device | The device object. @since 2.16.0 |
The value of the provisiong support flag.
None found |
getSettings(array $settings, \stdClass $device) : array
Return settings from the backend for a SETTINGS request.
array | $settings | An array of settings to return. Currently supported:
|
\stdClass | $device | The device to obtain settings for. |
The requested settings.
todo |
H6: return information keyed by the common names given in wbxml schema for the settings command (use constants) and return as a Horde_ActiveSync_Message_Oof object. |
---|
setSettings(array $settings, \stdClass $device) : array
Set backend settings from a SETTINGS request.
array | $settings | The settings to store. Currently supported:
|
\stdClass | $device | The device to store settings for. |
An array of status responses for each set request. e.g.,: array('oof' => Horde_ActiveSync_Request_Settings::STATUS_SUCCESS);
None found |
autoDiscover(array $params = array()) : 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.
array | $params | Optional array of parameters. |
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.
None found |
getUsernameFromEmail(string $email) : string
Attempt to guess a username based on the email address passed from EAS Autodiscover requests.
string | The email address |
The username to use to authenticate to Horde with.
None found |
resolveRecipient(string $type, string $search, array $opts = array()) : array
Handle ResolveRecipient requests
string | $type | The type of recipient request. e.g., 'certificate' |
string | $search | The email to resolve. |
array | $opts | Any options required to perform the resolution.
|
An array of results containing any of the following:
None found |
buildFbString(\stdClass $fb, \Horde_Date $start, \Horde_Date $end) : string
Build a EAS style FB string. Essentially, each digit represents 1/2 hour.
The values are as follows: 0 - Free 1 - Tentative 2 - Busy 3 - OOF 4 - No data available.
Though currently we only provide a Free/Busy/Unknown differentiation.
\stdClass | $fb | The fb information. An object containing:
|
\Horde_Date | $start | The start of the period requested by the client. |
\Horde_Date | $end | The end of the period requested by the client. |
The EAS freebusy string.
since | 2.4.0 |
---|
meetingResponse(array $response) : string
Handle meeting responses.
array | $response | The response data. Contains:
|
Horde_Exception_NotFound
The UID of any created calendar entries, otherwise false.
None found |
createDeviceCallback(\Horde_ActiveSync_Device $device) : boolean|integer
Callback method called before new device is created for a user. Allows final check of permissions.
\Horde_ActiveSync_Device | $device |
True on success (device allowed to be created) or error code on failure.
None found |
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.
.
\Horde_ActiveSync_Device | $device | The device object. |
True on success (device allowed to be created) or error code on failure.
None found |
modifyDeviceCallback(\Horde_ActiveSync_Device $device) : \Horde_ActiveSync_Device
Allow modification of device properties before request processing continues.
\Horde_ActiveSync_Device | $device | The device object. |
The possibly modified device object.
None found |
getFreebusy( $user, array $options = array())
Request freebusy information from the server
$user | ||
array | $options |
None found |
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.
string | $collection | The collection id we are currently requesting. |
integer | $last | The last syncstamp, if known. Used to help sanity check the state. |
The SyncStamp or false if an error is encountered.
since | 2.6.0 |
---|
_getFolder(string $id, array $params = array()) : \Horde_ActiveSync_Message_Folder
Factory for creating new Horde_ActiveSync_Message_Folder objects from within this class.
For BC reasons, we need to still accept the *_FOLDER_UID constants and they should represent folders that are multiplexed.
string | $id | The folder's server id. |
array | $params | Additional folder parameters:
|
The folder object.
None found |
_parseFolderId(string $id, boolean $checkEmail = false) : string|array
Parse a folderid.
string | $id | The folder id. |
boolean | $checkEmail | Verify $id is not an Email collection. |
A parsed folder array or HordeActiveSync::CLASS* constant.
None found |
_buildNonMailFolder(string $id, \stirng $parent, integer $type, string $name) : \Horde_ActiveSync_Message_Folder
Helper to build a folder object for non-email folders.
string | $id | The folder's server id. |
\stirng | $parent | The folder's parent id. |
integer | $type | The folder type. |
string | $name | The folder description. |
The folder object.
None found |
_smartStatMessage(string $folderid, string $id, boolean $hint) : \message
Stat a backend item, optionally using the cached value if available.
string | $folderid | The folder id |
string | $id | The message id |
boolean | $hint | Use the cached data, if available? |
stat hash
None found |
_getMailFolders() : array
Return the list of mail server folders.
An array of Horde_ActiveSync_Message_Folder objects.
None found |
_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.
string | $sid | The server name. |
array | $fl | The complete folder list. |
array | $f | An array describing the folder. |
None found |
_searchMailbox(array $query) : array
Perform a search of the email store.
array | $query | A query array. @see self::getSearchResults() |
The results array. @see self::getSearchResults()
None found |
_searchGal(array $query) : array
Perform a search of the Global Address Book.
array | $query | A query array. @see self::getSearchResults() |
The results array. @see self::getSearchResults()
None found |
_mungeCert(string $cert) : string
Removes the beginning/ending delimiters from the certificate.
string | $cert | The certificate text. |
The certificate text, with delimiters removed.
None found |
_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.
boolean | $deviceinfo | EAS 14.1 DEVICESETTINGS sent with PROVISION. |
None found |
_getIdentityFromAddress() : string
Return the current user's From/Reply_To address.
A RFC822 valid email string.
None found |
_getMaillogChanges(\Horde_ActiveSync_Folder_Imap $folder, integer $ts) : \Horde_ActiveSync_Folder_Imap
Get verb changes from the maillog.
\Horde_ActiveSync_Folder_Imap | $folder | The folder to search. |
integer | $ts | The timestamp to start from. |
The folder object, with any changes added accordingly.
None found |