Move Domain_Controller::NUMBER_MAX to Address::ADDRESS_FIELD_MAX

This commit is contained in:
2024-04-12 15:29:11 +10:00
parent 77df5746be
commit 1e08c2f6f7
8 changed files with 24 additions and 27 deletions

View File

@@ -10,9 +10,6 @@ use App\Models\{Address,Domain,Zone};
class DomainController extends Controller
{
// http://ftsc.org/docs/frl-1002.001
public const NUMBER_MAX = 0x7fff;
/**
* Add or edit a domain
*/

View File

@@ -242,8 +242,8 @@ class SystemController extends Controller
'point_id' => [
'required',
function($attribute,$value,$fail) use ($request) {
if (! is_numeric($value) || $value > DomainController::NUMBER_MAX)
$fail(sprintf('Point numbers must be between 0 and %d',DomainController::NUMBER_MAX));
if (! is_numeric($value) || $value > Address::ADDRESS_FIELD_MAX)
$fail(sprintf('Point numbers must be between 0 and %d',Address::ADDRESS_FIELD_MAX));
// Check that the host doesnt already exist
$o = Address::where(function($query) use ($request,$value) {