From f8822505f25334dec7fbdd03e733c4ff30bc5945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 15 Jun 2012 15:45:41 +0200 Subject: [PATCH] Feature #4899 add crossdomain file when server is localhost --- main/document/create_paint.php | 19 ++++++++++++++++++- main/document/edit_paint.php | 21 +++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/main/document/create_paint.php b/main/document/create_paint.php index 809886d835..c076b0689c 100644 --- a/main/document/create_paint.php +++ b/main/document/create_paint.php @@ -143,7 +143,24 @@ $target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php'; $target=$target_path; $locktarget="true"; $locktitle="false"; -$credentials="true"; + +if ($_SERVER['HTTP_HOST']=="localhost") { + $path_and_file= api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml'; + if (!file_exists($path_and_file)) { + $crossdomain=' + + + + + + ';//more open domain="*" + @file_put_contents($path_and_file, $crossdomain); + } + $credentials="true"; +} +else { + $credentials="false"; +} echo ''; \ No newline at end of file diff --git a/main/document/edit_paint.php b/main/document/edit_paint.php index 91bdaee3cb..5ca3c9e06d 100644 --- a/main/document/edit_paint.php +++ b/main/document/edit_paint.php @@ -6,7 +6,7 @@ * @package chamilo.document * @todo used the document_id instead of the curdirpath * - * @author Juan Carlos Ra�a Trabado + * @author Juan Carlos Raña Trabado * @since 30/january/2011 */ /** @@ -151,7 +151,24 @@ $target=$target_path; $locktarget="true"; $locktitle="false"; -$credentials="true"; + +if ($_SERVER['HTTP_HOST']=="localhost") { + $path_and_file= api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml'; + if (!file_exists($path_and_file)) { + $crossdomain=' + + + + + + ';//more open domain="*" + @file_put_contents($path_and_file, $crossdomain); + } + $credentials="true"; +} +else { + $credentials="false"; +} //make temp images $temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';