Bug 24369: Add AccessControlAllowOrigin syspref
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 9 Jan 2020 13:42:43 +0000 (10:42 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 5 Mar 2020 12:59:31 +0000 (12:59 +0000)
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_24369_CORS.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref

diff --git a/installer/data/mysql/atomicupdate/bug_24369_CORS.perl b/installer/data/mysql/atomicupdate/bug_24369_CORS.perl
new file mode 100644 (file)
index 0000000..e746319
--- /dev/null
@@ -0,0 +1,13 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do(q{
+        INSERT IGNORE INTO `systempreferences`
+            (`variable`, `value`, `options`, `explanation`, `type`)
+        VALUES
+            ('AccessControlAllowOrigin', '', NULL, 'Set the Access-Control-Allow-Origin header to the specified value', 'Free');
+    });
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 24369 - Add CORS support to Koha)\n";
+}
index 40f7a47..49b6633 100644 (file)
@@ -1,4 +1,5 @@
 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('AccessControlAllowOrigin', '', NULL, 'Set the Access-Control-Allow-Origin header to the specified value', 'Free'),
 ('AccountAutoReconcile','0',NULL,'If enabled, patron balances will get reconciled automatically on each transaction.','YesNo'),
 ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
 ('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
index ae99ace..4fa3414 100644 (file)
@@ -1,4 +1,10 @@
 Web services:
+    General:
+        -
+            - "Set the Access-Control-Allow-Origin header to"
+            - pref: 'AccessControlAllowOrigin'
+              class: Text
+            - "."
     REST API:
         -
             - pref: RESTBasicAuth