Sync: forbid sync access to existing templates

This commit is contained in:
Thomas Gelf 2015-07-24 15:30:09 +02:00
parent 7edc5f37b3
commit f65e880aaa
1 changed files with 13 additions and 0 deletions

View File

@ -130,6 +130,19 @@ class Sync
$dba = $db->getDbAdapter(); $dba = $db->getDbAdapter();
$dba->beginTransaction(); $dba->beginTransaction();
foreach ($objects as $object) { foreach ($objects as $object) {
if ($object->isTemplate()) {
if ($object->hasBeenModified()) {
throw new \Exception(
sprintf(
'Sync is not allowed to modify template "%s"',
$object->object_name
)
);
}
continue;
}
if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') { if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
/* /*
// TODO: Check against ALL sources // TODO: Check against ALL sources