M3 Security Fixes for Pass 34

This commit is contained in:
Mark Gregory
2026-09-17 12:04:08 +01:00
parent 0a05f05843
commit e1824f399e
69 changed files with 1804 additions and 1791 deletions
@@ -14,17 +14,17 @@ class userProfileController extends Controller
// Get Current USER
$loggedUser = strtoupper(m3_user());
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
$iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL', 'R428FIRST', 'R428FAMILY')
->where('R428US', '=', $loggedUser)
->where('R42821A', '=', 'Y')
->first();
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
$iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Check if user is eligible for Profile update
if (isset($ICM428M->R428US)) {
return view('m3::liberty-theme.pages.userProfile', compact('ICM428M', 'IC670M'));
if (isset($iCM428M->R428US)) {
return view('m3::liberty-theme.pages.userProfile', ['ICM428M' => $iCM428M, 'IC670M' => $iC670M]);
} else {
abort(404);
}
@@ -34,18 +34,18 @@ class userProfileController extends Controller
public static function updateUserProfile(Request $request)
{
$R428US = isset($request->R428US) ? trim($request->R428US) : '';
$R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
$r428US = isset($request->R428US) ? trim($request->R428US) : '';
$r428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
$R428CO = substr($R428DPW, 0, 3);
$R428PL = substr($R428DPW, 3, 3);
$R428WH = substr($R428DPW, 6, 3);
$r428CO = substr($r428DPW, 0, 3);
$r428PL = substr($r428DPW, 3, 3);
$r428WH = substr($r428DPW, 6, 3);
if ($R428US != '') {
if ($r428US != '') {
// Update record to ICM428M
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
where R428US='$R428US'");
set R428CO='$r428CO', R428PL='$r428PL', R428WH='$r428WH'
where R428US='$r428US'");
return redirect('/userprofile')->with('success', 'Profile updated successfully!');
} else {
@@ -57,18 +57,18 @@ class userProfileController extends Controller
public static function updateUserProfileAjax(Request $request)
{
$R428US = isset($request->R428US) ? trim($request->R428US) : '';
$R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
$r428US = isset($request->R428US) ? trim($request->R428US) : '';
$r428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
$R428CO = substr($R428DPW, 0, 3);
$R428PL = substr($R428DPW, 3, 3);
$R428WH = substr($R428DPW, 6, 3);
$r428CO = substr($r428DPW, 0, 3);
$r428PL = substr($r428DPW, 3, 3);
$r428WH = substr($r428DPW, 6, 3);
if ($R428US != '') {
if ($r428US != '') {
// Update record to ICM428M
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
where R428US='$R428US'");
set R428CO='$r428CO', R428PL='$r428PL', R428WH='$r428WH'
where R428US='$r428US'");
return response()->json(['success' => true]);
} else {