summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r--admin/WebConsole/includes/restfunctions.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index d9ea9a44..ec5927ac 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -25,6 +25,9 @@ define('OG_REST_PARAM_RUN', 'run');
define('OG_REST_PARAM_TYPE', 'type');
define('OG_REST_PARAM_STATE', 'state');
+$conf_file = parse_ini_file('../../etc/ogAdmRepo.cfg');
+define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['ApiToken']);
+
function common_request($command, $type, $data = null) {
$json = json_encode($data);
@@ -33,6 +36,9 @@ function common_request($command, $type, $data = null) {
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curl, CURLOPT_HTTPHEADER, array(
+ OG_REST_API_TOKEN,
+ ));
switch ($type) {
default: