M3 Security Fixes for Pass 40
This commit is contained in:
@@ -17,7 +17,9 @@ use Str;
|
||||
class CloseShipment extends Controller
|
||||
{
|
||||
private const ZERO_PAD = '000000';
|
||||
|
||||
private const JSON_CONTENT_TYPE = 'application/json';
|
||||
|
||||
private const NULL_M3_RESPONSE = 'M3 API responded with null value';
|
||||
|
||||
// CloseShipmentCoChargeAPI : with URL PARAMS COCharge
|
||||
@@ -54,7 +56,6 @@ class CloseShipment extends Controller
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
$dELIVERYNO = $mANIFEST != '' ? $mANIFEST : self::ZERO_PAD;
|
||||
|
||||
|
||||
if ($urlParams != '') {
|
||||
// Write to Logs : JSON
|
||||
$jSONIN = json_encode([
|
||||
@@ -216,7 +217,6 @@ class CloseShipment extends Controller
|
||||
}
|
||||
$iCM695M1TMP = $iCM695M1TMPF;
|
||||
|
||||
|
||||
$freightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
|
||||
->selectRaw('TRIM(ARCODE) as FREIGHTTERMS,ARCHARGE as BILLABLE')
|
||||
->get();
|
||||
@@ -605,10 +605,10 @@ class CloseShipment extends Controller
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
'Connection' => 'close',
|
||||
])
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
'Connection' => 'close',
|
||||
])
|
||||
->withToken($token)
|
||||
->withBody($jSONCS, self::JSON_CONTENT_TYPE)
|
||||
->timeout(Config::get('arrays.curlTimeOut'))
|
||||
@@ -826,10 +826,10 @@ class CloseShipment extends Controller
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
'Connection' => 'close',
|
||||
])
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
'Connection' => 'close',
|
||||
])
|
||||
->withToken($token)
|
||||
->withBody($jSONCS, self::JSON_CONTENT_TYPE)
|
||||
->timeout(Config::get('arrays.curlTimeOut'))
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Modules\M3\Http\Controllers\API;
|
||||
use Config;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
use Modules\M3\Helpers\Helper;
|
||||
use Modules\M3\Http\Controllers\Controller;
|
||||
use Modules\M3\Services\PostgresProgramBridge;
|
||||
@@ -14,6 +13,7 @@ use Str;
|
||||
class M3Controller extends Controller
|
||||
{
|
||||
private const FIELD_PREFIX = 'Field: ';
|
||||
|
||||
private const M3_LIST_SUFFIX = ' M3-Lis-JSN';
|
||||
|
||||
// Split Data and Write to ICM666M2
|
||||
|
||||
@@ -15,6 +15,7 @@ use Str;
|
||||
class ReplenAPI extends Controller
|
||||
{
|
||||
private const ZERO_PAD = '000000';
|
||||
|
||||
private const JSON_CONTENT_TYPE = 'application/json';
|
||||
|
||||
// M3Replenishement with URL Params
|
||||
@@ -53,7 +54,7 @@ class ReplenAPI extends Controller
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
$pART = explode(',', $pARTNO);
|
||||
foreach ($pART as $key => $value) {
|
||||
foreach ($pART as $value) {
|
||||
$pARTS[] = ['PART' => $value, 'LOT' => ''];
|
||||
}
|
||||
|
||||
@@ -84,9 +85,9 @@ class ReplenAPI extends Controller
|
||||
$token = $ionToken;
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
])
|
||||
'accept' => self::JSON_CONTENT_TYPE,
|
||||
'Content-Type' => self::JSON_CONTENT_TYPE,
|
||||
])
|
||||
->withToken($token)
|
||||
->withBody($jSON, self::JSON_CONTENT_TYPE)
|
||||
->timeout(Config::get('arrays.curlTimeOut'))
|
||||
@@ -130,7 +131,7 @@ class ReplenAPI extends Controller
|
||||
}
|
||||
|
||||
$dataToWrite2 = [];
|
||||
foreach ($responseTMP as $key => $value) {
|
||||
foreach ($responseTMP as $value) {
|
||||
$dataToWrite = [];
|
||||
|
||||
foreach ($value as $key2 => $content) {
|
||||
@@ -145,15 +146,15 @@ class ReplenAPI extends Controller
|
||||
}
|
||||
|
||||
// Delete Old Records from IC630M
|
||||
foreach ($dataToWrite2 as $key => $value) {
|
||||
$iCM630MDeleteSQL = DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')
|
||||
foreach ($dataToWrite2 as $value) {
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')
|
||||
->where('LLCO', $cO)
|
||||
->where('LLWHNO', $wHS)
|
||||
->where('LLPPN', trim($value['PartNumber']))
|
||||
->delete();
|
||||
}
|
||||
|
||||
foreach ($dataToWrite2 as $key => $value) {
|
||||
foreach ($dataToWrite2 as $value) {
|
||||
// Check if Location exist in DE640M $value['Location']
|
||||
$dE640MSQLSEL = DB::connection(config('m3.connection', 'pgsql'))->table('de640m')
|
||||
->where('LVCO', $cO)
|
||||
|
||||
@@ -16,8 +16,11 @@ use Str;
|
||||
class TransferAPI extends Controller
|
||||
{
|
||||
private const ZERO_PAD = '000000';
|
||||
|
||||
private const JSON_CONTENT_TYPE = 'application/json';
|
||||
|
||||
private const ORDER_CATEGORY_LABEL = ' Order Category: ';
|
||||
|
||||
private const NO_URL_PARAMETERS = 'No URL Parameters Sent';
|
||||
|
||||
// TransferAPIURL : with URL PARAMS
|
||||
|
||||
@@ -6,7 +6,6 @@ use Config;
|
||||
use DB;
|
||||
use File;
|
||||
use Illuminate\Http\Request;
|
||||
use Smalot\PdfParser\Parser;
|
||||
use Str;
|
||||
|
||||
class M3GetPDFFromCacheController extends Controller
|
||||
@@ -96,7 +95,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
if (count($iCM695M1) > 0) {
|
||||
$tmpCacheArr = $carrier = $trackingno = [];
|
||||
// Loop the Results from $ICM595M1TMP
|
||||
|
||||
@@ -242,8 +242,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
// MAK Store the File to Storage
|
||||
app(SpreadsheetExport::class)->store($iCM688M2Col, $prevMonthFile, 'publicCL');
|
||||
|
||||
|
||||
|
||||
return back();
|
||||
} catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
|
||||
@@ -176,7 +176,6 @@ class ReplenishSettingsController extends Controller
|
||||
// $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
|
||||
// dd($rEFCAT658);
|
||||
|
||||
|
||||
return Datatables::of($rEFCAT658)->addIndexColumn()->make(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use Str;
|
||||
class execSummaryController extends Controller
|
||||
{
|
||||
private const WAREHOUSE_IN_CLAUSE = "' and a5whs in (";
|
||||
|
||||
public static function index(Request $request)
|
||||
{
|
||||
$iC670M = collect();
|
||||
|
||||
@@ -10,8 +10,11 @@ use Str;
|
||||
class execSummaryLineController extends Controller
|
||||
{
|
||||
private const WAREHOUSE_IN_CLAUSE = "' and a5whs in (";
|
||||
|
||||
private const FIRST_DAY_THIS_MONTH = 'first day of this month';
|
||||
|
||||
private const LAST_DAY_THIS_MONTH = 'last day of this month';
|
||||
|
||||
private const ONE_YEAR_AGO = '-1 year';
|
||||
|
||||
public static function index(Request $request)
|
||||
|
||||
@@ -6,7 +6,6 @@ use Illuminate\Http\Request;
|
||||
use mikehaertl\pdftk\Pdf;
|
||||
use Storage;
|
||||
|
||||
|
||||
class fillBOLController extends Controller
|
||||
{
|
||||
public static function index(Request $request)
|
||||
@@ -32,7 +31,6 @@ class fillBOLController extends Controller
|
||||
dd($error);
|
||||
}
|
||||
|
||||
|
||||
$newfile = "BOL-{$bOL['BOL_number']}.pdf";
|
||||
var_dump($newfile);
|
||||
|
||||
@@ -43,7 +41,6 @@ class fillBOLController extends Controller
|
||||
dd($error);
|
||||
}
|
||||
|
||||
|
||||
$result = $pdf->fillForm([
|
||||
'DTESHIPED.1' => date('d/m/Y'),
|
||||
'invoice_number' => $bOL['BOL_number'],
|
||||
|
||||
@@ -12,9 +12,13 @@ use Modules\M3\Services\PostgresProgramBridge;
|
||||
class userControlController extends Controller
|
||||
{
|
||||
private const AUTH_FAILURE_MESSAGE = 'Could not connect due to wrong user or password.';
|
||||
|
||||
private const DATABASE_NOT_FOUND_MESSAGE = 'Database not found. Try WRKRDBDIRE to check.';
|
||||
|
||||
private const CONNECTION_ERROR_PREFIX = 'Could not connect. Error: ';
|
||||
|
||||
private const PROGRAM_ERROR_PREFIX = 'Error calling program. Code: ';
|
||||
|
||||
private const MESSAGE_SEPARATOR = ' Msg: ';
|
||||
|
||||
public static function index(Request $request)
|
||||
@@ -193,7 +197,6 @@ class userControlController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add LIB
|
||||
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
|
||||
@@ -209,11 +212,9 @@ class userControlController extends Controller
|
||||
// Add Delivery Note Param
|
||||
// $params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn','','00000087125');
|
||||
|
||||
|
||||
// Start Time Tracking
|
||||
// $start = microtime(true);
|
||||
|
||||
|
||||
// Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4')
|
||||
// ICM700C EWOBJTST ICM700C ICM700CSBM
|
||||
$result = $conn->PgmCall('ICMCHGPRF', 'EWOBJ', $params, [], []);
|
||||
@@ -254,12 +255,10 @@ class userControlController extends Controller
|
||||
|
||||
$pGMERRORS = '';
|
||||
|
||||
|
||||
// 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) {
|
||||
$code = $e->getCode();
|
||||
$msg = $e->getMessage();
|
||||
@@ -279,12 +278,10 @@ class userControlController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// $params[] = $conn->AddParameterChar('in', 10, 'userid','USRPRF',$request->USERID);
|
||||
// $params[] = $conn->AddParameterChar('in', 9, 'sts','STATUS','*ENABLED');
|
||||
// $params[] = $conn->AddParameterChar('in', 4, 'pwdexp','PWDEXP','*NO');
|
||||
|
||||
$result = $conn->CLCommand('QSYS/CHGUSRPRF USRPRF(' . $request->R428US_PWD . ') PASSWORD(' . $request->NEW_PASSWORD . ') STATUS(*ENABLED) PWDEXP(*NO)');
|
||||
// echo "<script>alert('After CHGUSRPRF');</script>";
|
||||
|
||||
if (! $result) {
|
||||
$pGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
|
||||
@@ -299,6 +296,7 @@ class userControlController extends Controller
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static function programBridgeConnectionError(\Throwable $exception): string
|
||||
{
|
||||
$code = (int) $exception->getCode();
|
||||
@@ -309,5 +307,4 @@ class userControlController extends Controller
|
||||
default => 'error profile5',
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ class userPickingStats4 extends Controller
|
||||
}
|
||||
|
||||
// #$min_work_hours_for_break = 4;
|
||||
$min_work_hours_for_break = implode(',', Config::get('arrays.min_work_hours_for_break'));
|
||||
|
||||
// #$ignore_picks_that_last_longer_than_this_many_hours = 8;
|
||||
$ignore_picks_that_last_longer_than_this_many_hours = implode(',', Config::get('arrays.ignore_picks_that_last_longer_than_this_many_hours'));
|
||||
|
||||
@@ -13,7 +13,7 @@ class userPickingStats5 extends Controller
|
||||
{
|
||||
public static function index(Request $request)
|
||||
{
|
||||
[$userArray, $co, $whs] = self::loadUsers();
|
||||
[$userArray] = self::loadUsers();
|
||||
[$starting, $ending, $days] = self::dateRange($request);
|
||||
$user = $request->user;
|
||||
$statistics = [];
|
||||
|
||||
@@ -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;
|
||||
@@ -65,7 +64,6 @@ class utilitiesContoller extends Controller
|
||||
// Add Delivery Note Param
|
||||
$params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn', '', '00000087125');
|
||||
|
||||
|
||||
// Start Time Tracking
|
||||
$start = microtime(true);
|
||||
|
||||
@@ -100,7 +98,6 @@ class utilitiesContoller extends Controller
|
||||
// Parse PDF file and build necessary objects.
|
||||
$parser = new Parser;
|
||||
|
||||
|
||||
$pdfFile = File::get('/www/sentm3test/htdocs/labels/' . $pdfFileName . '.pdf');
|
||||
|
||||
// Transform content to base64
|
||||
@@ -246,7 +243,7 @@ class utilitiesContoller extends Controller
|
||||
$gS1SEQUENCE = isset($gS1SEQUENCESel) ? $gS1SEQUENCESel : 0;
|
||||
|
||||
// Loop PackagesArray : Build Table for PDF and Insert to ICM695m3
|
||||
foreach ($gSArray['PackagesArray'] as $key => $value) {
|
||||
foreach ($gSArray['PackagesArray'] as $value) {
|
||||
$table_style = $packageNum < $packageCount ? ' style="page-break-after: always;" ' : '';
|
||||
|
||||
$a2INTBOX = trim($value);
|
||||
@@ -394,7 +391,6 @@ class utilitiesContoller extends Controller
|
||||
// DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')
|
||||
// ->insert(['A2CO'=> $cOMPANY,'A2WHS'=> $wHS,'A2MACPKR'=> $macpkr,'A2GS1LABEL'=> $gs1_128_bc]);
|
||||
|
||||
|
||||
return json_encode(['result' => 'success', 'GS1File' => $gS1FileNameNoRoot]);
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
@@ -409,8 +405,6 @@ class utilitiesContoller extends Controller
|
||||
{
|
||||
print_r('>>> Generate PDF');
|
||||
|
||||
|
||||
|
||||
$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',
|
||||
@@ -499,7 +493,6 @@ class utilitiesContoller extends Controller
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
|
||||
// Initialize Dompdf
|
||||
$dompdf = new Dompdf;
|
||||
$dompdf->loadHtml($html);
|
||||
@@ -577,7 +570,6 @@ class utilitiesContoller extends Controller
|
||||
$response = $controller->processShipment($myRequest);
|
||||
|
||||
$responseData = $response->getData();
|
||||
// dump($responseJSON);
|
||||
|
||||
$error = isset($responseData->error) ? $responseData->error : '';
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Modules\M3\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Str;
|
||||
|
||||
class whsePerfDetailsController extends Controller
|
||||
{
|
||||
@@ -14,14 +13,6 @@ class whsePerfDetailsController extends Controller
|
||||
$date_in = isset($request->date) ? date('Y-m-d', strtotime($request->date)) : date('Y-m-d');
|
||||
$for = isset($request->for) ? $request->for : 'a';
|
||||
|
||||
$username = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// Get Logged User CO & WH & PL
|
||||
$iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
|
||||
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
|
||||
->where('R428US', '=', $username)
|
||||
->first();
|
||||
|
||||
|
||||
$all = "tempfile4 as (
|
||||
select a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype, sum(dollarvalue) as dollarvalue, sum(weight) as weight, max(source) as source
|
||||
from tempfile3
|
||||
|
||||
Reference in New Issue
Block a user