From a26efff49528e33012829a76278aa5d4019a48df Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 29 Oct 2013 15:56:33 +0100 Subject: [PATCH] When removing a device, remove device data from syncroton database --- plugins/kolab_activesync/kolab_activesync.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/kolab_activesync/kolab_activesync.php b/plugins/kolab_activesync/kolab_activesync.php index ccd1d5c1..05e1f354 100644 --- a/plugins/kolab_activesync/kolab_activesync.php +++ b/plugins/kolab_activesync/kolab_activesync.php @@ -400,6 +400,15 @@ class kolab_activesync extends rcube_plugin } } } + + // remove device data from syncroton database + $db = $this->rc->get_dbh(); + $table = $db->table_name('syncroton_device'); + + if (in_array($table, $db->list_tables())) { + $db->query("DELETE FROM $table WHERE owner_id = ? AND deviceid = ?", + $this->rc->user->ID, $id); + } } return $result;