M3 Security Fixes for Pass 39

This commit is contained in:
Mark Gregory
2026-09-17 12:52:29 +01:00
parent b8ca1e7717
commit 34e13a0bf0
16 changed files with 13 additions and 70 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ class DeleteOldLabels extends Command
$daysOld = 180; // Number of days to consider a file old : 180 =Six Months
$filesToDeleteArr = [];
foreach ($subFolders as $key => $subFolder) {
foreach ($subFolders as $subFolder) {
$labelsDirectory = $labelsDirectoryTmp . $subFolder;
$this->info('Getting Files From Directory: ' . $labelsDirectory);
-1
View File
@@ -153,7 +153,6 @@ class GenerateGS1Cmd extends Command
// If remainder is 0, check digit is 0; otherwise, subtract remainder from 10
$checkDigit = ($remainder == 0) ? 0 : 10 - $remainder;
$gs1_128_bc = $gs1_128_bc_1 . $checkDigit;
$gs1_128_bc_desc = '(00)' . $packageType . $manufactID . $gS1SEQUENCEID . $checkDigit;
$data = [
@@ -173,7 +173,6 @@ class CloseShipment extends Controller
}
$iCM695M1TMP = $iCM695M1PREP->get();
// Log::channel('dailyCron')->info($iCM695M1TMP);
// PFC if MACKPKR already Closed : Case 671
$iCM695M1TMPCOL = collect($iCM695M1TMP);
@@ -383,7 +382,6 @@ class CloseShipment extends Controller
$commoditiesTmp = isset($responseData->commodities) ? $responseData->commodities : '';
if ($commoditiesTmp != '') {
$commodities = $commoditiesTmp; // json_encode($commoditiesTmp);
// dump( $commodities);
} else {
$commodities = '';
$errorMsgs = $errorMsgs . ' Could not find Commodities; ';
@@ -251,7 +251,6 @@ class M3Controller extends Controller
}
// Get Products : commodities And Write ICM666M
$tmpProd = '';
$products = $jsonFile['Contents']['Commodities'];
foreach ($products as $key => $product) {
$quantity = isset($product['Quantity']) ? $product['Quantity'] : '';
@@ -418,7 +417,6 @@ class M3Controller extends Controller
// Call PGM ICM700CSBM
if ($warehouse != '' && $pickerNumber != '' && $company != '') {
$pGMERRORS = '';
$aWREQN = '';
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -75,10 +75,6 @@ class M3GetPDFFromCacheController extends Controller
$aggmsg = "This delivery note is part of aggregation $aggno ";
$iCM688M1 = DB::connection(config('m3.connection', 'pgsql'))->select("select A4MACPKR from ICM688M1 where A4SHPAGGCD='$aggno'");
// foreach($iCM688M1 as $key => $ICM688M1R) {
// $aggmsg.=' <a href="M3GetPDFFromCache?MACPKR='.$ICM688M1R->A4MACPKR.'&COMPANY='.$cOMPANY.'&PLANT='.$pLANT.'&WHS='.$wHS.'">'.$ICM688M1R->A4MACPKR.'</a>';
// }
// $aggmsg.=" )";
// 654 add 'AYSPR15A01', 'AYSPR30A01', 'AYTRUCK' carrier and tracking# and agg#
$iCM695M1 = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
@@ -102,12 +98,10 @@ class M3GetPDFFromCacheController extends Controller
->get();
}
$allLabels = [];
if (count($iCM695M1) > 0) {
$tmpCacheArr = $carrier = $trackingno = [];
// Loop the Results from $ICM595M1TMP
foreach ($iCM695M1 as $key => $ICM695M1R) {
foreach ($iCM695M1 as $ICM695M1R) {
$wHS = trim($ICM695M1R->AYWHS);
$cOMPANY = trim($ICM695M1R->AYCO);
$aYMACPKR = trim($ICM695M1R->AYMACPKR);
@@ -119,13 +113,10 @@ class M3GetPDFFromCacheController extends Controller
// Make Key and Test Validity
if ($aYMACPKR != '' && $cOMPANY != '' && $wHS != '') {
$carrierLabel = '';
$contentLabel = '';
$packingList = '';
$cacheKeyPackingList = $cacheKeyCarrierLabel = $cacheKeyContentLabel = '';
// Get Unique Keys
foreach ($docTypes as $key => $value) {
foreach ($docTypes as $value) {
// Check Parcel vs LTL
if ($value == 'ContentLabel') {
$dOCNUMT = $dOCNUM;
@@ -166,7 +157,7 @@ class M3GetPDFFromCacheController extends Controller
// Get unique values from array $pDFArray
$tmpCacheArr = collect($tmpCacheArr)->unique();
foreach ($tmpCacheArr as $key => $value) {
foreach ($tmpCacheArr as $value) {
$pdfFileName = $pdfFilePath . $value . '.pdf';
if (File::exists($pdfFileName)) {
@@ -183,9 +174,8 @@ class M3GetPDFFromCacheController extends Controller
}
}
} catch (\Throwable $th) {
report($th);
}
// dump($iC670M);
// dump($iCM695M1);
return view('m3::liberty-theme.pages.M3GetPDF', ['IC670M' => $iC670M, 'PDFArray' => $pDFArray, 'AYMACPKR' => $aYMACPKR, 'WHDDA' => $wHDDA, 'aggmsg' => $aggmsg, 'carrier' => $carrier, 'trackingno' => $trackingno, 'ICM688M1' => $iCM688M1, 'COMPANY' => $cOMPANY, 'PLANT' => $pLANT, 'WHS' => $wHS]);
// compact('IC670M','ViewTitle')
@@ -18,7 +18,6 @@ class MFOrdersController extends Controller
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
->where('R428US', '=', strtoupper(m3_user()))
->first();
$user = $iCM428M->R428US;
$co = $iCM428M->R428CO;
$whs = $iCM428M->R428WH;
$plant = $iCM428M->R428PL;
@@ -107,7 +107,6 @@ class execSummaryController extends Controller
$reportDate = $firstDay->modify('first day of this month')->format('Ymd');
$toreportDate = $firstDay->modify('last day of this month')->format('Ymd');
// $toreportDate =$lastDay->modify('last day of this month')->format('Ymd');
// Build SQL
$selectContent = "with tempfile as (
@@ -127,7 +126,6 @@ class execSummaryController extends Controller
$selectContent = '';
break;
}
// dump($toreportDate);
$execSummaryRes = DB::connection(config('m3.connection', 'pgsql'))->select($selectContent);
} else {
@@ -31,8 +31,6 @@ class fillBOLController extends Controller
dd($error);
}
// dd($test);
$newfile = "BOL-{$bOL['BOL_number']}.pdf";
var_dump($newfile);
@@ -43,8 +41,6 @@ class fillBOLController extends Controller
dd($error);
}
// dd($test);
$result = $pdf->fillForm([
'DTESHIPED.1' => date('d/m/Y'),
'invoice_number' => $bOL['BOL_number'],
@@ -32,7 +32,7 @@ class pendingClosureController extends Controller
$iCM698Ma = [];
$iCM699Ma = [];
foreach ($iCM705M1 as $key => $val) {
foreach ($iCM705M1 as $val) {
$sqlstmt1 = "select LGUSER,LGCONFDT,LGCONFTM
from ICM698M
where LGCO='$val->APCO' and LGWHS='$val->APWHS'and LGURL='op605api.php'
@@ -42,7 +42,7 @@ class pendingClosureController extends Controller
$iCM698Ma[$val->APMANIFEST]['TMSUSER'] = '';
$iCM698Ma[$val->APMANIFEST]['TMSDATE'] = '';
$iCM698Ma[$val->APMANIFEST]['TMSTIME'] = '';
foreach ($iCM698M as $key2 => $val2) {
foreach ($iCM698M as $val2) {
$iCM698Ma[$val->APMANIFEST]['TMSUSER'] = $val2->LGUSER;
$iCM698Ma[$val->APMANIFEST]['TMSDATE'] = $val2->LGCONFDT;
$iCM698Ma[$val->APMANIFEST]['TMSTIME'] = $val2->LGCONFTM;
@@ -52,7 +52,7 @@ class pendingClosureController extends Controller
WHERE SHMACPKR='$val->APMANIFEST' AND SHCO='$co' AND SHWHS='$whs'
AND SHSOURCE='CloseShipmentCoChargeAPI' AND SHERROR='' AND SHTYPE='M3-Req-out' limit 1";
$iCM699MSel = DB::connection(config('m3.connection', 'pgsql'))->select($iCM699MSel1);
foreach ($iCM699MSel as $key2 => $val2) {
foreach ($iCM699MSel as $val2) {
$iCM699Ma[$val2->SHMACPKR]['SHDT'] = $val2->SHDT;
$iCM699Ma[$val2->SHMACPKR]['SHTIME'] = $val2->SHTIME;
}
@@ -73,7 +73,7 @@ class pendingClosureController extends Controller
// AND APSPARE2!=''
// dump($sqlstmt3);
$uproccessedOrders = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt3);
foreach ($uproccessedOrders as $key => $UproccessedOrder) {
foreach ($uproccessedOrders as $UproccessedOrder) {
$unprocessedArr[] = '<a class="btn btn-link mb-1" target="_blank" href="' . url('MFOrders', ['id' => trim($UproccessedOrder->APMANIFEST)]) . '"> ' .
trim($UproccessedOrder->APMANIFEST) . '</a>';
}
@@ -107,6 +107,7 @@ class pendingClosureController extends Controller
'message' => 'Manifest Closing submitted',
]);
} catch (\Throwable $th) {
report($th);
}
}
@@ -228,7 +228,6 @@ class userControlController extends Controller
}
// Successful Call
else {
// $AWREQN = $result['io_param']["var0"];
if ($request->ACTION == 'P') {
echo "<script>alert('The password has been reset to QAZ1WSX2 for '" . $request->USERID . "'. The user will need to enter a new password on next green screen connection.');</script>";
}
@@ -257,18 +256,12 @@ class userControlController extends Controller
$pGMERRORS = '';
// echo "request="; var_dump($request);
// echo "B3<br>";
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
$conn = app(PostgresProgramBridge::class);
// echo "B4<br>";
} catch (\Throwable $e) {
// echo "B5<br>";
// Determine reason for failure.
// Probably database authentication error or invalid or unreachable database.
// ## $conn->setOptions(array('persistent' => false, 'stateless' => true, 'debug' => true,'debugLogFile' => '/www/sentm3test/htdocs/storage/logs/toolkit_debug.log'));
$code = $e->getCode();
$msg = $e->getMessage();
@@ -9,7 +9,6 @@ use DB;
use Dompdf\Dompdf;
use File;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Log;
use Modules\M3\Services\PostgresProgramBridge;
use PDF;
@@ -25,7 +24,6 @@ class utilitiesContoller extends Controller
// Get The Next ID by Calling POM002C
$pGMERRORS = '';
$aWREQN = '';
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -85,7 +83,6 @@ class utilitiesContoller extends Controller
if ($pGMERRORS != '') {
dump($pGMERRORS);
} else {
}
// Get Execution Time
$time = microtime(true) - $start;
@@ -101,10 +98,6 @@ class utilitiesContoller extends Controller
// Parse PDF file and build necessary objects.
$parser = new Parser;
// $text = $pdf->getText();
// dump("Text Only");
// dump($text);
$pdfFile = File::get('/www/sentm3test/htdocs/labels/' . $pdfFileName . '.pdf');
// Transform content to base64
@@ -413,17 +406,6 @@ class utilitiesContoller extends Controller
{
print_r('>>> Generate PDF');
// $builder->setFilename('barcode.png');
// $builder->setImageFormat('png');
// $builder->setWidth(500);
// $builder->setHeight(150);
// $builder->setFontPath('FreeSans.ttf');
// $builder->setFontSize(15);
// $builder->setBackgroundColor(255, 255, 255);
// $builder->setPaintColor(0, 0, 0);
// Barcode\Builder::build()->setWidth(600)->setBackgroundColor(100, 100, 100)->output('(10)123456(400)11');
// return response($image)->header('Content-Type', 'image/png');
$data = [
'from' => 'Any Vendor<br>123 Any Street<br>SomeTown, ST 01234',
'ship_to' => 'True Value Hardware<br>123 Any Street<br>SomeTown, ST 01234',
@@ -5,7 +5,7 @@ Chart.defaults.global.defaultFontColor = '#292b2c';
// Area Chart Example
let ctx = document.getElementById("myAreaChart");
if (ctx) {
let myLineChart = new Chart(ctx, {
new Chart(ctx, {
type: 'line',
data: {
labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"],
@@ -5,7 +5,7 @@ Chart.defaults.global.defaultFontColor = '#292b2c';
// Bar Chart Example
let ctx = document.getElementById("myBarChart");
if (ctx) {
let myLineChart = new Chart(ctx, {
new Chart(ctx, {
type: 'bar',
data: {
labels: ["January", "February", "March", "April", "May", "June"],
@@ -5,7 +5,7 @@ Chart.defaults.global.defaultFontColor = '#292b2c';
// Pie Chart Example
let ctx = document.getElementById("myPieChart");
if (ctx){
let myPieChart = new Chart(ctx, {
new Chart(ctx, {
type: 'pie',
data: {
labels: ["Blue", "Red", "Yellow", "Green"],
@@ -436,14 +436,6 @@ legend + * {
-webkit-appearance: textfield;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
-3
View File
@@ -63,9 +63,6 @@ select:focus[data-flux-control] {
@apply outline-hidden ring-2 ring-accent ring-offset-2 ring-offset-accent-foreground;
}
/* \[:where(&)\]:size-4 {
@apply size-4;
} */
@layer components {
.wms-app-shell {