From dc1ec6df7df3198bcb8113021a77a2756268bc57 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 22 Feb 2012 12:18:30 +0100 Subject: [PATCH 1/2] Fix cache asynchro --- lib/classes/cache/databox.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/classes/cache/databox.class.php b/lib/classes/cache/databox.class.php index 50bc397ba0..6c5296fa66 100644 --- a/lib/classes/cache/databox.class.php +++ b/lib/classes/cache/databox.class.php @@ -104,6 +104,11 @@ class cache_databox $field->delete_data_from_cache(); } + foreach($record->get_subdefs() as $subdef) + { + $subdef->delete_data_from_cache(); + } + break; case 'structure': $appbox->delete_data_from_cache(\appbox::CACHE_LIST_BASES); From 2cb18c5d787643db583c7336cdeece52db2099c5 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 22 Feb 2012 12:22:50 +0100 Subject: [PATCH 2/2] Download elements without watermark when pushed --- lib/classes/set/export.class.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index 20dc58fd58..d9c6897616 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -535,10 +535,8 @@ class set_export extends set_abstract 'path' => $sd[$name]->get_path() , 'file' => $sd[$name]->get_file() ); - if (!$user->ACL()->has_right_on_base( - $download_element->get_base_id() - , "nowatermark" - ) + if (!$user->ACL()->has_right_on_base($download_element->get_base_id(), "nowatermark") + && !$user->ACL()->has_preview_grant($download_element) && $sd[$name]->get_type() == media_subdef::TYPE_IMAGE) { $path = recordutils_image::watermark( @@ -951,11 +949,12 @@ class set_export extends set_abstract if (is_file($file)) { - $testPath = function($file, $registry){ - return strpos($file, $registry->get('GV_RootPath').'tmp/download/') !== false - || strpos($file, $registry->get('GV_RootPath').'tmp/lazaret/') !== false + $testPath = function($file, $registry) + { + return strpos($file, $registry->get('GV_RootPath') . 'tmp/download/') !== false + || strpos($file, $registry->get('GV_RootPath') . 'tmp/lazaret/') !== false || strpos($file, $registry->get('GV_X_Accel_Redirect')) !== false; - }; + }; if ($registry->get('GV_modxsendfile') && $testPath($file, $registry)) {