From d66c2c2f73f0fff94e03e93e3897b4011ff236e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Sun, 21 Nov 2010 18:19:16 +0000 Subject: [PATCH] Fix SyncML device info handling --- phpgwapi/inc/horde/Horde/SyncML/State.php | 2 +- phpgwapi/inc/horde/Horde/SyncML/State_egw.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML/State.php b/phpgwapi/inc/horde/Horde/SyncML/State.php index 9cd991b56b..2c5ce94e51 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State.php @@ -458,7 +458,7 @@ class Horde_SyncML_State { function setClientDeviceInfo($clientDeviceInfo) { $this->_clientDeviceInfo = $clientDeviceInfo; - $this->_clientDeviceInfo['persistent'] = false; + unset($this->_clientDeviceInfo['persistent']); } function setDeletedItems($_type, $_deletedItems) diff --git a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php index 4ea9426085..c2b909bcfb 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php @@ -238,7 +238,7 @@ class EGW_SyncML_State extends Horde_SyncML_State 'tzid' => $syncml_prefs[$deviceTimezone], 'charset' => $syncml_prefs[$deviceCharSet], 'devId' => $deviceID, - 'persistent' => true, + 'persistent' => $deviceID, 'dataStore' => unserialize($row['dev_datastore']), ); return $this->_clientDeviceInfo; @@ -635,7 +635,7 @@ class EGW_SyncML_State extends Horde_SyncML_State return false; } - if (empty($this->_clientDeviceInfo['persistent'])) { + if (!isset($this->_clientDeviceInfo['persistent'])) { // the device information was updated if(!isset($this->size_dev_hwversion)) { @@ -683,7 +683,7 @@ class EGW_SyncML_State extends Horde_SyncML_State $deviceID = $GLOBALS['egw']->db->get_last_insert_id('egw_syncmldevinfo', 'dev_id'); } - $this->_clientDeviceInfo['persistent'] = true; + $this->_clientDeviceInfo['persistent'] = $deviceID; } $data = $where = array ( @@ -694,7 +694,7 @@ class EGW_SyncML_State extends Horde_SyncML_State $GLOBALS['egw']->db->delete('egw_syncmldeviceowner', $where, __LINE__, __FILE__, 'syncml'); - $data['owner_devid'] = $deviceID; + $data['owner_devid'] = $this->_clientDeviceInfo['persistent']; $GLOBALS['egw']->db->insert('egw_syncmldeviceowner', $data, $where, __LINE__, __FILE__, 'syncml');