Commit 432dee8a authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1205 Fixed issue so the highest restriction is used.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 2953d8fd
...@@ -705,7 +705,7 @@ class DeviceManager { ...@@ -705,7 +705,7 @@ class DeviceManager {
$maxDevice = $this->device->GetSyncFilterType(); $maxDevice = $this->device->GetSyncFilterType();
// ALL has a value of 0, all limitations have higher integer values, see SYNC_FILTERTYPE_ALL definition // ALL has a value of 0, all limitations have higher integer values, see SYNC_FILTERTYPE_ALL definition
if ($maxDevice !== false && $maxDevice < $maxAllowed) { if ($maxDevice !== false && $maxDevice > SYNC_FILTERTYPE_ALL && ($maxAllowed == SYNC_FILTERTYPE_ALL || $maxDevice < $maxAllowed)) {
$maxAllowed = $maxDevice; $maxAllowed = $maxDevice;
} }
......
...@@ -917,8 +917,9 @@ class ZPushAdminCLI { ...@@ -917,8 +917,9 @@ class ZPushAdminCLI {
echo "Last sync:\t\t". ($device->GetLastSyncTime() ? strftime("%Y-%m-%d %H:%M", $device->GetLastSyncTime()) : "never")."\n"; echo "Last sync:\t\t". ($device->GetLastSyncTime() ? strftime("%Y-%m-%d %H:%M", $device->GetLastSyncTime()) : "never")."\n";
$filterType = (defined('SYNC_FILTERTIME_MAX') && SYNC_FILTERTIME_MAX > SYNC_FILTERTYPE_ALL) ? SYNC_FILTERTIME_MAX : SYNC_FILTERTYPE_ALL; $filterType = (defined('SYNC_FILTERTIME_MAX') && SYNC_FILTERTIME_MAX > SYNC_FILTERTYPE_ALL) ? SYNC_FILTERTIME_MAX : SYNC_FILTERTYPE_ALL;
if ($device->GetSyncFilterType() != false && $device->GetSyncFilterType() < $filterType) { $maxDevice = $device->GetSyncFilterType();
$filterType = $device->GetSyncFilterType(); if ($maxDevice !== false && $maxDevice > SYNC_FILTERTYPE_ALL && ($filterType == SYNC_FILTERTYPE_ALL || $maxDevice < $filterType)) {
$filterType = $maxDevice;
} }
switch($filterType) { switch($filterType) {
case SYNC_FILTERTYPE_1DAY: case SYNC_FILTERTYPE_1DAY:
......
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