M3 Security Fixes for Pass 39

This commit is contained in:
Mark Gregory
2026-09-17 13:08:40 +01:00
parent e0d8e1a725
commit 34c3460760
63 changed files with 655 additions and 503 deletions
@@ -12,13 +12,9 @@ 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)
@@ -197,6 +193,7 @@ class userControlController extends Controller
}
}
// Add LIB
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
@@ -212,9 +209,11 @@ 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, [], []);
@@ -224,7 +223,6 @@ class userControlController extends Controller
echo "<script>alert($pGMERRORS);</script>";
return 'error';
exit();
}
// Successful Call
else {
@@ -256,6 +254,7 @@ class userControlController extends Controller
$pGMERRORS = '';
// echo "B3<br>";
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -300,7 +299,6 @@ class userControlController extends Controller
}
}
private static function programBridgeConnectionError(\Throwable $exception): string
{
$code = (int) $exception->getCode();
@@ -311,4 +309,5 @@ class userControlController extends Controller
default => 'error profile5',
};
}
}