Commit 8a72d5f7 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1257 Remove statically configured shared folders from the list sent

to ASDevice->SetAdditionalFolderList().

Released under the Affero GNU General Public License (AGPL) version 3.
parent 78896d3a
......@@ -683,7 +683,18 @@ class ZPushAdmin {
return false;
}
$status = $device->SetAdditionalFolderList($set_store, $set_folders);
// check if any of the folders sent is in the statically configured list
$set_folders_checked = array();
$current_folders = ZPush::GetAdditionalSyncFolders();
foreach($set_folders as $f) {
if (isset($current_folders[$f['folderid']]) && substr($current_folders[$f['folderid']]->serverid, 0, 1) == DeviceManager::FLD_ORIGIN_CONFIG) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPushAdmin::AdditionalFolderSetList(): Ignoring folder '%s' id '%s' as it's a statically configured folder", $f['name'], $f['folderid']));
continue;
}
$set_folders_checked[] = $f;
}
$status = $device->SetAdditionalFolderList($set_store, $set_folders_checked);
if ($status && $device->GetData() !== false) {
ZPush::GetStateMachine()->SetState($device->GetData(), $devid, IStateMachine::DEVICEDATA);
}
......
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