Added CORS(Cross-Origin Resource Sharing) support for the VICIdial agent PHP scripts. see the CORS_SUPPORT.txt doc for more information.

git-svn-id: svn://192.168.202.10@3459 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-06-18 03:24:05 +00:00
parent 062d318dc0
commit e2e0505570
35 changed files with 491 additions and 72 deletions
+11 -3
View File
@@ -1,7 +1,7 @@
<?php
# vdc_script_display.php
#
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of the SCRIPT tab in the agent interface
#
@@ -42,10 +42,12 @@
# 191013-2145 - Fixes for PHP7
# 191031-1158 - Added Script2 feature
# 201117-2107 - Changes for better compatibility with non-latin data input
# 210616-2100 - Added optional CORS support, see options.php for details
#
$version = '2.14-36';
$build = '201117-2107';
$version = '2.14-37';
$build = '210616-2100';
$php_script = 'vdc_script_display.php';
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -264,6 +266,12 @@ if (isset($_GET["LOGINvarFIVE"])) {$LOGINvarFIVE=$_GET["LOGINvarFIVE"];}
if (isset($_GET["script_span"])) {$script_span=$_GET["script_span"];}
elseif (isset($_POST["script_span"])) {$script_span=$_POST["script_span"];}
# if options file exists, use the override values for the above variables
# see the options-example.php file for more information
if (file_exists('options.php'))
{
require_once('options.php');
}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1