Skip to content

Commit

Permalink
Revert "Allow Windows 8 Mail app to connect without provisioning."
Browse files Browse the repository at this point in the history
This reverts commit 65e1132c09238f85d20f5d945906db1dc0ddd557.

Conflicts:
	framework/ActiveSync/lib/Horde/ActiveSync/Device.php
  • Loading branch information
mrubinsk committed Oct 8, 2013
1 parent 574106c commit 3bb95ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
3 changes: 1 addition & 2 deletions framework/ActiveSync/lib/Horde/ActiveSync.php
Expand Up @@ -745,9 +745,8 @@ public function handleRequest($cmd, $devId)
// Device might exist, but with a new (additional) user account
if ($this->_state->deviceExists($devId)) {
$device = $this->_state->loadDeviceInfo($devId);
$device->headers = $this->_request->getHeaders();
} else {
$device = new Horde_ActiveSync_Device($this->_state, $this->_request->getHeaders());
$device = new Horde_ActiveSync_Device($this->_state);
}
$device->policykey = 0;
$device->userAgent = $this->_request->getHeader('User-Agent');
Expand Down
38 changes: 4 additions & 34 deletions framework/ActiveSync/lib/Horde/ActiveSync/Device.php
Expand Up @@ -34,7 +34,7 @@
* @property array properties The device properties, sent in DEVICEINFO.
* @property string announcedVersion The most last EAS supported versions
* announced to the device.
* @property array headers Current request headers.
*
*/
class Horde_ActiveSync_Device
{
Expand All @@ -60,35 +60,23 @@ class Horde_ActiveSync_Device
*/
protected $_state;

/**
* Request headers
*
* @var array
*/
protected $_headers;

/**
* Const'r
*
* @param Horde_ActiveSync_State_Base $state The state driver.
* @param array $data The current device data.
*/
public function __construct(Horde_ActiveSync_State_Base $state, array $data = array(), array $headers = array())
public function __construct(Horde_ActiveSync_State_Base $state, array $data = array())
{
$this->_state = $state;
$this->_properties = $data;
$this->_headers = $headers;
}

/**
* Getter
*/
public function &__get($property)
{
if ($property == 'headers') {
return $this->_headers;
}

return $this->_properties[$property];
}

Expand All @@ -97,11 +85,7 @@ public function &__get($property)
*/
public function __set($property, $value)
{
if ($value == 'headers') {
$this->_headers = $value;
} else {
$this->_properties[$property] = $value;
}
$this->_properties[$property] = $value;
}

/**
Expand Down Expand Up @@ -146,28 +130,14 @@ public function isNonProvisionable()
{
// Outlook? The specs say that "Windows Communication Apps" should
// provide the 'OS' parameter of the ITEMSETTINGS data equal to 'Windows',
// but Outlook 2013 doesn't even send the ITEMSETTINGS command, so we
// but Outlook 2013 doesn't even sent the ITEMSETTINGS command, so we
// need to check the userAgent header. Early versions used Microsoft.Outlook,
// but after some update it was changed to 'Outlook/15.0'
if (strpos($this->deviceType, 'MicrosoftOutlook') !== false ||
strpos($this->userAgent, 'Outlook') !== false) {
return true;
}

// X-MS-WL header check for Outlook and Windows 8 Mail.
if (!empty($this->_headers['x-ms-wl']) &&
(strpos($this->_headers['x-ms-wl'], 'WindowsMail') !== false ||
strpos($this->_headers['x-ms-wl'], 'Outlook') !== false)) {

return true;
}
}

// Last chance to catch Windows 8 Mail.
if (strpos($this->_deviceType, 'WindowsMail') !== false) {
return true;
}

return false;
}

Expand Down

0 comments on commit 3bb95ac

Please sign in to comment.