find media section

This commit is contained in:
CHIEFSOFT\ameye
2023-08-11 06:49:41 -04:00
parent 53c93905ca
commit 869a46c561
+10 -3
View File
@@ -28,6 +28,11 @@ class WrenchMedia extends BaseController
return $endpoints; return $endpoints;
} }
const WRENCH_FILE_PROFILE = 100;
const WRENCH_FILE_MYFILE = 200;
const WRENCH_FILE_CONTRACTS = 300;
const WRENCH_FILE_FAMILY = 400;
public function apigate(){ public function apigate(){
$call_backend = false; $call_backend = false;
$uriSegments = explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); $uriSegments = explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
@@ -41,10 +46,10 @@ class WrenchMedia extends BaseController
$fileSection = $uriSegments[$segLen-2]; $fileSection = $uriSegments[$segLen-2];
$fileUID = $uriSegments[$segLen-1]; $fileUID = $uriSegments[$segLen-1];
$supportedSections = ['profile','myfile','contracts','family']; $supportedSections = ['profile'=>100,'myfile'=>200,'contracts'=>300,'family'=>400];
if (!in_array($fileSection, $supportedSections)) { if (!in_array($fileSection, $supportedSections)) {
// section not supported // section not supported
return; // return;
} }
/* /*
@@ -54,12 +59,14 @@ class WrenchMedia extends BaseController
//We can check cache for the file or //We can check cache for the file or
// OR // OR
// WE need to ask backend for this file now / // WE need to ask backend for this file now /
$call_backend = true; // $call_backend = true;
$data = [ $data = [
'action' => WRENCHBOARD_GET_MEDIA, 'action' => WRENCHBOARD_GET_MEDIA,
'sessionid' => $sessionId, 'sessionid' => $sessionId,
'file_section' => $fileSection, 'file_section' => $fileSection,
'file_uid' => $fileUID, 'file_uid' => $fileUID,
'file_section_no' =>$supportedSections$fileSection]
]; ];
if ($data["action"] !=''){ if ($data["action"] !=''){