Some clients send a PROVISION command even when it's not told to do so by the server.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Apr 2010 14:24:44 +0000 (10:24 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Apr 2010 14:27:24 +0000 (10:27 -0400)
We must check our provision setting when we receive a PROVISION request, and send back
a NOT_DEFINED status code if no policy exists on the server.

framework/ActiveSync/lib/Horde/ActiveSync/Request/Provision.php

index 319d602..0e77778 100644 (file)
@@ -100,6 +100,11 @@ class Horde_ActiveSync_Request_Provision extends Horde_ActiveSync_Request_Base
                 return $this->_globalError(self::STATUS_PROTERROR);
             }
 
+            /* Check to be sure that we *need* to PROVISION */
+            if ($this->_provisioning === false) {
+                $policyStatus = self::STATUS_NOTDEFINED;
+            }
+
             /* POLICYKEY is only sent by client in phase 3 */
             if ($this->_decoder->getElementStartTag(SYNC_PROVISION_POLICYKEY)) {
                 $policykey = $this->_decoder->getElementContent();