/**
* Return a policy array suitable for transforming into either wbxml or xml
* to send to the device in the provision response.
*
* @param boolean $deviceinfo EAS 14.1 DEVICESETTINGS sent with PROVISION.
*
* @return array
*/
protected function _getPolicyFromPerms($deviceinfo = false)
{
$prefix = 'horde:activesync:provisioning:';
$policy = array();
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
if (!$perms->exists('horde:activesync:provisioning')) {
return $policy;
}
$policies = new Horde_ActiveSync_Policies(null, $this->_version);
$properties = $policies->getAvailablePolicies();
foreach ($properties as $property) {
if ($perms->exists($prefix . $property)) {
$p = $perms->getPermissions($prefix . $property, $this->_user);
$policy[$property] = $this->_getPolicyValue($property, $p);
}
}
return $policy;
}