Commit 01649ac6 authored by Manfred Kutas's avatar Manfred Kutas

ZP-77 Use magic setter method for saving policies' hash in device data.

Change Exception message to notify that policies changed.

Released under the Affero GNU General Public License (AGPL) version 3.
parent a2f2c159
......@@ -444,15 +444,6 @@ class ASDevice extends StateObject {
return $foundMessage;
}
/**
* Saves the policies' hash in the device data.
* @param string $policies Policies' hash
*/
public function setPolicies($policies) {
$this->policies = $policies;
}
/**----------------------------------------------------------------------------------------------------------
* HierarchyCache and ContentData operations
*/
......
......@@ -273,7 +273,7 @@ class DeviceManager {
$policies = $this->getProvisioningPolicies();
$p->Load($policies);
// save policies' hash
$this->device->setPolicies(md5(serialize($policies)));
$this->device->SetPolicies(md5(serialize($policies)));
unset($policies);
return $p;
}
......
......@@ -541,7 +541,7 @@ class SyncCollections implements Iterator {
// if a PolicyKey was sent use it. If not, compare with the ReferencePolicyKey
if (PROVISIONING === true && $policyKey !== false && ZPush::GetDeviceManager()->ProvisioningRequired($policyKey, true))
// the hierarchysync forces provisioning
throw new StatusException("SyncCollections->CheckForChanges(): PolicyKey changed. Provisioning required.", self::ERROR_WRONG_HIERARCHY);
throw new StatusException("SyncCollections->CheckForChanges(): Policies or PolicyKey changed. Provisioning required.", self::ERROR_WRONG_HIERARCHY);
// Check if a hierarchy sync is necessary
if (ZPush::GetDeviceManager()->IsHierarchySyncRequired())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment