From 4b6cd04f1dbbfef8c4af42d76c4aad1c36547e22 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Tue, 6 Oct 2020 14:24:03 +0200 Subject: #988 Read API token from new json config This patch reads configuration from the new json file instead of using the legacy '.cfg' file. --- admin/WebConsole/includes/restfunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php index 4067f697..13f6e3a7 100644 --- a/admin/WebConsole/includes/restfunctions.php +++ b/admin/WebConsole/includes/restfunctions.php @@ -86,8 +86,8 @@ define('OG_SCHEDULE_COMMAND', 'command'); define('OG_SCHEDULE_PROCEDURE', 'procedure'); define('OG_SCHEDULE_TASK', 'task'); -$conf_file = parse_ini_file(__DIR__ . '/../../etc/ogserver.cfg'); -define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['APITOKEN']); +$conf_file = json_decode(file_get_contents(__DIR__ . '/../../etc/ogserver.json'), true); +define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['rest']['api_token']); function common_request($command, $type, $data = null) { -- cgit v1.2.3-18-g5258