Mail routing parent/children, domain name validation, nodelist import changes and other fixes
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\Http\Controllers\DomainController;
|
||||
use App\Traits\ScopeActive;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class System extends Model
|
||||
{
|
||||
@@ -61,12 +62,12 @@ class System extends Model
|
||||
/**
|
||||
* Return the system's address in the same zone
|
||||
*
|
||||
* @param Address $o
|
||||
* @return Address
|
||||
* @param Zone $o
|
||||
* @return Collection
|
||||
*/
|
||||
public function match(Address $o): Address
|
||||
public function match(Zone $o): Collection
|
||||
{
|
||||
return $this->addresses->where('zone_id',$o->zone_id)->first();
|
||||
return $this->addresses->where('zone_id',$o->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,6 +86,8 @@ class System extends Model
|
||||
return sprintf('RC-%s-%05d',$o->zone->domain->name,$o->region_id);
|
||||
|
||||
case DomainController::NODE_NC;
|
||||
return sprintf('NC-%s-%05d',$o->zone->domain->name,$o->host_id);
|
||||
|
||||
case DomainController::NODE_HC;
|
||||
case NULL:
|
||||
default:
|
||||
|
Reference in New Issue
Block a user