Show users hub connection details for their domains
This commit is contained in:
@@ -131,6 +131,36 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
|
||||
}
|
||||
}
|
||||
|
||||
function our_hostname(Address $o): string
|
||||
{
|
||||
$our = our_address($o->domain)->first();
|
||||
|
||||
switch ($our->role_id) {
|
||||
case Address::NODE_ZC:
|
||||
$domain = collect(explode('.',gethostname()))->forget(0)
|
||||
->prepend(sprintf('z%d',$our->zone->zone_id));
|
||||
break;
|
||||
|
||||
case Address::NODE_NC:
|
||||
$domain = collect(explode('.',gethostname()))->forget(0)
|
||||
->prepend(sprintf('z%d',$our->zone->zone_id))
|
||||
->prepend(sprintf('n%d',$our->host_id));
|
||||
break;
|
||||
|
||||
case Address::NODE_HC:
|
||||
$domain = collect(explode('.',gethostname()))->forget(0)
|
||||
->prepend(sprintf('z%d',$our->zone->zone_id))
|
||||
->prepend(sprintf('n%d',$our->host_id))
|
||||
->prepend(sprintf('f%d',$our->node_id));
|
||||
break;
|
||||
|
||||
default:
|
||||
$domain = collect(explode('.',gethostname()));
|
||||
}
|
||||
|
||||
return $domain->join('.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of nodes that collect mail directly from us
|
||||
*
|
||||
|
Reference in New Issue
Block a user