From b496d01ccae014e611472056d28561e821b84464 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 27 Jul 2021 15:27:09 +0000 Subject: [PATCH] wip #4614 @0.5 --- .htaccess | 4 ++-- inc/ws/Controlleur/class.ws.services.php | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index 96e71e3bd..ecf24c6f8 100644 --- a/.htaccess +++ b/.htaccess @@ -4,8 +4,6 @@ Options +FollowSymlinks AddDefaultCharset UTF-8 AddCharset UTF-8 log - - # Static # ExpiresActive On @@ -14,6 +12,8 @@ AddCharset UTF-8 log Header merge Access-Control-Allow-Origin "*" + Header append Access-Control-Allow-Methods "POST,GET,OPTIONS,PUT,DELETE" + Header append Access-Control-Allow-Headers "Content-Type,Accept,x-requested-with" diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 7d6682dec..02af9fd7b 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -1376,9 +1376,13 @@ class wsServices extends cubeFlashGateway exit; } - public static function yslSurvey() + public function yslSurvey() { + + global $core; + $this->outputXML = false; + try { $c = $core->con->openCursor('ysl_survey'); $c->fluidbook_id = $_POST['Fluidbook_ID']; @@ -1394,6 +1398,9 @@ class wsServices extends cubeFlashGateway $res = '0'; } ob_end_clean(); + header('Access-Control-Allow-Origin: *'); + header('Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE'); + header('Access-Control-Allow-Headers: Content-Type,Accept,x-requested-with'); header('Content-Type: text/plain'); die($res); } -- 2.39.5