*/
public function handleRequest($cmd, $devId)
{
+ /* Don't bother with everything else if all we want are Options */
+ if ($cmd == 'Options') {
+ self::activeSyncHeader();
+ self::versionHeader();
+ self::commandsHeader();
+ return true;
+ }
+
/* Check that this device is known */
+ if (is_null($devId)) {
+ throw new Horde_ActiveSync_Exception('Device failed to send device id.');
+ }
$state = $this->_driver->getStateObject();
if (!empty($devId) && !$state->deviceExists($devId)) {
$get = $this->_request->getGetParams();
* header - which is against the specification. Check the user agent
* for Android (maybe need version sniffing in the future) and set the
* policykey to null for those devices. */
- $this->_device = $this->_state->getDeviceInfo($this->_devId);
- if (strpos($this->_device->agent, 'Android') !== false) {
+ $this->_device = $this->_state->getDeviceInfo($this->_device->id);
+ if (strpos($this->_device->userAgent, 'Android') !== false) {
$sentKey = null;
}
/* Don't attempt if we don't care */
if ($this->_provisioning !== false) {
$state = $this->_driver->getStateObject();
- $storedKey = $state->getPolicyKey($this->_devId);
+ $storedKey = $state->getPolicyKey($this->_device->id);
/* Loose provsioning should allow a blank key */
if ((empty($storedKey) || $storedKey != $sentKey) &&
($this->_provisioning !== 'loose' ||
*/
public function handle()
{
- $this->_version = $activeSync->getProtocolVersion();
+ $this->_version = $this->_activeSync->getProtocolVersion();
$this->_logger->info('Request received from device: ' . $this->_device->id . ' Supporting protocol version: ' . $this->_version);
}
+++ /dev/null
-<?php
-/**
- * ActiveSync Handler for OPTIONS requests
- *
- * Copyright 2009 - 2010 The Horde Project (http://www.horde.org)
- *
- * @author Michael J. Rubinsky <mrubinsk@horde.org>
- * @package Horde_ActiveSync
- */
-/**
- * Zarafa Deutschland GmbH, www.zarafaserver.de
- * This file is distributed under GPL v2.
- * Consult LICENSE file for details
- */
-class Horde_ActiveSync_Request_Options extends Horde_ActiveSync_Request_Base
-{
- public function handle()
- {
- Horde_ActiveSync::activeSyncHeader();
- Horde_ActiveSync::versionHeader();
- Horde_ActiveSync::commandsHeader();
-
- return true;
- }
-
-}
return $this->_globalError(self::STATUS_PROTERROR);
}
if ($status == self::STATUS_CLIENT_SUCCESS) {
- $this->_state->setDeviceRWStatus($this->_devId, Horde_ActiveSync::RWSTATUS_WIPED);
+ $this->_state->setDeviceRWStatus($this->_device->id, Horde_ActiveSync::RWSTATUS_WIPED);
}
}
}
send it to the client. */
if (!$phase2) {
/* Verify intermediate key */
- if ($this->_state->getPolicyKey($this->_devId) != $policykey) {
+ if ($this->_state->getPolicyKey($this->_device->id) != $policykey) {
$policyStatus = self::STATUS_POLKEYMISM;
} else {
/* Set the final key */
$policykey = $this->_state->generatePolicyKey();
- $this->_state->setPolicyKey($this->_devId, $policykey);
+ $this->_state->setPolicyKey($this->_device->id, $policykey);
}
} elseif (empty($policykey)) {
// This is phase2 - we need to set the intermediate key
$policykey = $this->_state->generatePolicyKey();
- $this->_state->setPolicyKey($this->_devId, $policykey);
+ $this->_state->setPolicyKey($this->_device->id, $policykey);
}
$this->_encoder->startTag(Horde_ActiveSync::PROVISION_PROVISION);
$this->_encoder->endTag();
/* Wipe data if status is pending or wiped */
- $rwstatus = $this->_state->getDeviceRWStatus($this->_devId);
+ $rwstatus = $this->_state->getDeviceRWStatus($this->_device->id);
if ($rwstatus == Horde_ActiveSync::RWSTATUS_PENDING || $rwstatus == Horde_ActiveSync::RWSTATUS_WIPED) {
$this->_encoder->startTag(Horde_ActiveSync::PROVISION_REMOTEWIPE, false, true);
- $this->_state->setDeviceRWStatus($this->_devId, Horde_ActiveSync::RWSTATUS_WIPED);
+ $this->_state->setDeviceRWStatus($this->_device->id, Horde_ActiveSync::RWSTATUS_WIPED);
} else {
$this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICIES);
$this->_encoder->startTag(Horde_ActiveSync::PROVISION_POLICY);
<file name="FolderSync.php" role="php" />
<file name="Sync.php" role="php" />
<file name="Ping.php" role="php" />
- <file name="Options.php" role="php" />
<file name="Provision.php" role="php" />
<file name="GetItemEstimate.php" role="php" />
<file name="SendMail.php" role="php" />
<install name="lib/Horde/ActiveSync/Request/FolderSync.php" as="Horde/ActiveSync/Request/FolderSync.php" />
<install name="lib/Horde/ActiveSync/Request/Sync.php" as="Horde/ActiveSync/Request/Sync.php" />
<install name="lib/Horde/ActiveSync/Request/Ping.php" as="Horde/ActiveSync/Request/Ping.php" />
- <install name="lib/Horde/ActiveSync/Request/Options.php" as="Horde/ActiveSync/Request/Options.php" />
<install name="lib/Horde/ActiveSync/Request/Provision.php" as="Horde/ActiveSync/Request/Provision.php" />
<install name="lib/Horde/ActiveSync/Request/GetItemEstimate.php" as="Horde/ActiveSync/Request/GetItemEstimate.php" />
<install name="lib/Horde/ActiveSync/Request/SendMail.php" as="Horde/ActiveSync/Request/SendMail.php" />