exit;
}
while (1) {
- $el = $this->_decoder->getElement();
+ $el = $this->_decoder->getElementContent();
+ $collection['supported'][] = $el;
if ($el[Horde_ActiveSync_Wbxml::EN_TYPE] == Horde_ActiveSync_Wbxml::EN_TYPE_ENDTAG) {
break;
}
if ($this->_statusCode == self::STATUS_SUCCESS) {
/* Initialize the state */
$state = &$this->_driver->getStateObject($collection);
- $state->getDeviceInfo($devId);
+ $device = $state->getDeviceInfo($devId);
+ if (!empty($collection['supported'])) {
+ /* Initial sync and we have SUPPORTED data - save it */
+ if (empty($device->supported)) {
+ $device->supported = array();
+ }
+ $device->supported[$collection['class']] = $collection['supported'];
+ $state->setDeviceInfo($devId, $device);
+ }
try {
$state->loadState($collection['synckey'], 'sync');
} catch (Horde_ActiveSync_Exception $e) {
}
$this->_devId = $devId;
- $query = 'SELECT device_type, device_agent, device_ping, device_policykey, device_rwstatus, device_user FROM '
+ $query = 'SELECT device_type, device_agent, device_ping, device_policykey, device_rwstatus, device_user, device_supported FROM '
. $this->_syncDeviceTable . ' WHERE device_id = ?';
try {
$result = $this->_db->selectOne($query, array($devId));
$this->_deviceInfo->deviceType = $result['device_type'];
$this->_deviceInfo->userAgent = $result['device_agent'];
$this->_deviceInfo->id = $devId;
- $this->deviceInfo->user = $result['device_user'];
+ $this->_deviceInfo->user = $result['device_user'];
+ $this->_deviceInfo->supported = unserilize($result['device_supported']);
if ($result['device_ping']) {
$this->_pingState = unserialize($result['device_ping']);
} else {
$this->_db->execute($query, array($devId));
$query = 'INSERT INTO ' . $this->_syncDeviceTable
- . '(device_type, device_agent, device_ping, device_policykey, device_rwstatus, device_id, device_user)'
- . ' VALUES(?, ?, ?, ?, ?, ?, ?)';
+ . '(device_type, device_agent, device_ping, device_policykey, device_rwstatus, device_id, device_user, device_supported)'
+ . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?)';
+
+ $values = array($data->deviceType,
+ $data->userAgent,
+ '',
+ $data->policykey,
+ $data->rwstatus,
+ $devId,
+ $data->user,
+ (!empty($data->supported) ? $data->supported : ''));
- $values = array($data->deviceType, $data->userAgent, '', $data->policykey, $data->rwstatus, $devId, $data->user);
$this->_devId = $devId;
return $this->_db->insert($query, $values);