m3 Security Fixes

This commit is contained in:
Mark Gregory
2026-09-16 17:14:26 +01:00
parent 1602bdd72e
commit d68687f062
78 changed files with 1297 additions and 1228 deletions
@@ -28,7 +28,7 @@ class M3GetPDFFromCacheController extends Controller
$pdfFilePath = Config::get('arrays.PdfPath');
try {
# Initialise Vars
$PDFArray = $trackingno = $carrier = $ICM688M1 = [];
$PDFArray = $trackingno = $carrier = $ICM688M1 = [];
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
// dd($SHUSER);
@@ -40,7 +40,7 @@ class M3GetPDFFromCacheController extends Controller
->select('R428US','R428CO', 'R428WH','R428PL')
->where('R428US','=',$SHUSER)
->first();
$R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : '';
$COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : ''; # Company
$PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : ''; # Plant
@@ -50,7 +50,7 @@ class M3GetPDFFromCacheController extends Controller
# Warehouse Table
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// ->where('WDCO',$userCO)->where('WDPL',$userPL)->where('WDWHS',$userWH)
# Get URL PARAMS
$urlParams = count($request->all())>0 ? $request->all() : '';
// dump($urlParams);
@@ -78,7 +78,7 @@ class M3GetPDFFromCacheController extends Controller
// dump($ICM695M1Agg);
$aggno = isset($ICM695M1Agg->AYTRUCK) ? trim($ICM695M1Agg->AYTRUCK) : '';
if($aggno!="" && $aggno!="0") {
if($aggno!="" && $aggno!="0") {
// dump($aggno);
$aggmsg="This delivery note is part of aggregation $aggno ";
@@ -117,7 +117,7 @@ class M3GetPDFFromCacheController extends Controller
if (count($ICM695M1)>0) {
$tmpCacheArr = $carrier = $trackingno = [];
# Loop the Results from $ICM595M1TMP
# Loop the Results from $ICM595M1TMP
foreach ($ICM695M1 as $key => $ICM695M1R) {
$WHS = trim($ICM695M1R->AYWHS);
$COMPANY = trim($ICM695M1R->AYCO);
@@ -177,7 +177,7 @@ class M3GetPDFFromCacheController extends Controller
}
}
}
// dump($tmpCacheArr);
// dump($tmpCacheArr);
# Get unique values from array $PDFArray
$tmpCacheArr = collect($tmpCacheArr)->unique();
@@ -194,7 +194,7 @@ class M3GetPDFFromCacheController extends Controller
// $base64PDF = $pdfFile;
$base64PDF = base64_encode($pdfFile);
// dd($base64PDF);
$PDFArray[] = $base64PDF;
$PDFArray[] = $base64PDF;
}
}
// dump($PDFArray);
@@ -206,7 +206,7 @@ class M3GetPDFFromCacheController extends Controller
}
catch (\Throwable $th) {
// Log::error($th);
}
}
# dump($PDFArray);
# dump($AYMACPKR);
# dump($IC670M);