From: Michael J. Rubinsky Date: Wed, 31 Mar 2010 18:36:27 +0000 (-0400) Subject: Move (and implement) the set/getDeviceRWStatus methods to the state object X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cf4b778d14a57998f1bb70fa2a9c55199de13119;p=horde.git Move (and implement) the set/getDeviceRWStatus methods to the state object --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php b/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php index 5af6015de..e2a133602 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php @@ -523,34 +523,6 @@ abstract class Horde_ActiveSync_Driver_Base } /** - * Return a device wipe status - * - * @param string $user - * @param string $pass - * @param string $devid - * @return int - */ - public function getDeviceRWStatus($devid) - { - return false; - } - - /** - * Set a new rw status for the device - * - * @param string $user - * @param string $pass - * @param string $devid - * @param string $status - * - * @return boolean - */ - public function setDeviceRWStatus($devid, $status) - { - return false; - } - - /** * * @return unknown_type */ diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php index 5324de3a5..dd6260ec4 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php @@ -194,12 +194,12 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base } $this->_encoder->endTag();//policy $this->_encoder->endTag(); //policies - $rwstatus = $this->_driver->getDeviceRWStatus($this->_devId); + $rwstatus = $state->getDeviceRWStatus($this->_devId); //wipe data if status is pending or wiped if ($rwstatus == self::RWSTATUS_PENDING || $rwstatus == self::RWSTATUS_WIPED) { $this->_encoder->startTag(SYNC_PROVISION_REMOTEWIPE, false, true); - $this->_driver->setDeviceRWStatus($this->_devId, self::RWSTATUS_WIPED); + $state->setDeviceRWStatus($this->_devId, self::RWSTATUS_WIPED); //$rwstatus = SYNC_PROVISION_RWSTATUS_WIPED; } diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php b/framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php index 7b2736277..c55c8030f 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php @@ -204,6 +204,26 @@ abstract class Horde_ActiveSync_State_Base abstract public function setPolicyKey($devId, $key); /** + * Return a device remotewipe status + * + * @param string $devId The device id + * + * @return int + */ + abstract public function getDeviceRWStatus($devId); + + + /** + * Set a new remotewipe status for the device + * + * @param string $devid + * @param string $status + * + * @return boolean + */ + abstract public function setDeviceRWStatus($devid, $status); + + /** * Obtain the device object. * * @param string $devId diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/State/File.php b/framework/ActiveSync/lib/Horde/ActiveSync/State/File.php index b430658e0..bdeb277a8 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/State/File.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/State/File.php @@ -533,6 +533,34 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base } /** + * Return a device wipe status + * + * @param string $devId + * + * @return integer + */ + public function getDeviceRWStatus($devId) + { + $info = $this->getDeviceInfo($devId); + return $info['rwstatus']; + } + + /** + * Set a new remotewipe status for the device + * + * @param string $devId + * @param integer $status + * + * @return boolean + */ + public function setDeviceRWStatus($devId, $status) + { + $info = $this->getDeviceInfo($devId); + $info['rwstatus'] = $status; + $this->setDeviceInfo($devId, $info); + } + + /** * Get list of server changes * * @param integer $flags