From: Michael J. Rubinsky Date: Thu, 29 Apr 2010 18:44:23 +0000 (-0400) Subject: Allow specifying a user to filter on when querying partnered devices. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b7b77ffc9fdd75208b5842c69522ba1cc99d2001;p=horde.git Allow specifying a user to filter on when querying partnered devices. --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php b/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php index bda48feb4..d68874095 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php @@ -26,7 +26,8 @@ * device_agent - The user agent string sent by the device * device_ping - The device's current PING state information. * device_policykey - The current policykey for this device - * deivce_rwstatus - The current remote wipe status for this device + * device_rwstatus - The current remote wipe status for this device + * device_user - The user this device belongs to. * * * Copyright 2010 The Horde Project (http://www.horde.org) @@ -505,11 +506,16 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base * @return array An array of device hashes * @throws Horde_ActiveSync_Exception */ - public function listDevices() + public function listDevices($user = null) { $sql = 'SELECT * from ' . $this->_syncDeviceTable; + $values = array(); + if ($user) { + $sql .= ' WHERE device_user = ?'; + $values[] = $user; + } try { - return $this->_db->selectAll($sql); + return $this->_db->selectAll($sql, $values); } catch (Horde_Db_Exception $e) { throw new Horde_ActiveSync_Exception($e); }