diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-10-06 14:24:03 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-10-06 16:06:28 +0200 |
commit | 4b6cd04f1dbbfef8c4af42d76c4aad1c36547e22 (patch) | |
tree | a10067f3af6d43220586799f0ead21ef49ea474a /admin/WebConsole | |
parent | 953594a30abd60bf0b3bd833bcd81efbb0fd5d85 (diff) |
#988 Read API token from new json config
This patch reads configuration from the new json file instead of using
the legacy '.cfg' file.
Diffstat (limited to 'admin/WebConsole')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 4 |
1 files 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) { |