From c9463cca0fade17127bdb7b2a16815b3b644646f Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 3 Jun 2023 18:30:52 -0400 Subject: [PATCH] Config file use --- www-api/app/Controllers/WrenchApi.php | 6 ++++++ www-api/public/svs/user/userve.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/www-api/app/Controllers/WrenchApi.php b/www-api/app/Controllers/WrenchApi.php index 59dc8d21..4c03ee14 100644 --- a/www-api/app/Controllers/WrenchApi.php +++ b/www-api/app/Controllers/WrenchApi.php @@ -473,6 +473,7 @@ class WrenchApi extends BaseController $raw_json = file_get_contents('php://input'); $raw_array = json_decode($raw_json, true); $raw_array["call_backend"] = $call_backend; + $out["system_primary_uploads"] = $this->getSiteConfigurations("system.primary_uploads"); $out = ( new \App\Models\UploadManager() )->reciveUpload($raw_array, $local_out); $call_backend = $out["call_backend"]; $raw_array["message"] = $out["message"]; @@ -515,6 +516,11 @@ class WrenchApi extends BaseController } + private function getSiteConfigurations($config_item){ + $wrenchboard = new \App\Models\BackendModel(); + return $wrenchboard->cfgReadChar($config_item); + } + private function dummyData($raw_array) { return [ diff --git a/www-api/public/svs/user/userve.php b/www-api/public/svs/user/userve.php index 0aa98cf0..09ebbf96 100755 --- a/www-api/public/svs/user/userve.php +++ b/www-api/public/svs/user/userve.php @@ -141,6 +141,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $in = flatten(json_decode(file_get_contents('php://input'), true)); //$in = json_decode($raw_json, true); $in["call_backend"] = $call_backend; + $out["system_primary_uploads"] = getSiteConfigurations($wrenchboard,"system.primary_uploads"); $out = reciveUpload($in, $local_out); $call_backend = $out["call_backend"]; $in["message"] = $out["message"]; @@ -470,6 +471,11 @@ else $out['internal_return'] = 100; // to match the other } +function getSiteConfigurations($wrenchboard,$config_item){ + return $wrenchboard->cfgReadChar($config_item); +} + +// system.primary_uploads header("HTTP/1.1 200 OK"); header("Status: 200 OK");