m3 Security Fixes

This commit is contained in:
Mark Gregory
2026-09-16 17:16:25 +01:00
parent d68687f062
commit 8f37245e13
64 changed files with 4247 additions and 4426 deletions
+7 -5
View File
@@ -2,16 +2,18 @@
namespace Modules\M3\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Config;
class ShipTo extends Model
{
protected $table = 'ICM665M';
public $timestamps = false;
protected $primaryKey = ['AUSHSHZP', 'AUSHWHS'];
protected $uniqueKey = ['AUSHSHZP', 'AUSHWHS'];
public $incrementing = false;
protected $fillable = [
@@ -23,7 +25,7 @@ class ShipTo extends Model
'AUSHSHST',
'AUSHSHZP',
'AUSHSHCT',
'AUSHWHS'
'AUSHWHS',
];
public function save(array $options = [])
@@ -42,11 +44,11 @@ class ShipTo extends Model
{
$query = self::query();
# Check if the combination of AUSHSHZP and AUSHWHS already exists
// Check if the combination of AUSHSHZP and AUSHWHS already exists
$existingRecord = $query->where('AUSHSHZP', $this->AUSHSHZP)
->where('AUSHWHS', $this->AUSHWHS);
# If this is an existing record being updated, exclude itself from the check
// If this is an existing record being updated, exclude itself from the check
if ($this->exists) {
$existingRecord->where($this->getKeyName(), '!=', $this->getKey());
}