EndpointController: remove peer detection

This commit is contained in:
Thomas Gelf 2016-02-17 16:47:03 +01:00
parent b6a8ce7acc
commit 017f4b09d1

View File

@ -9,7 +9,7 @@ class EndpointController extends ObjectController
public function init()
{
parent::init();
if ($this->isPeer()) {
if ($this->object && $this->object->hasApiUser()) {
$params['endpoint'] = $this->object->object_name;
$this->getTabs()->add('inspect', array(
@ -19,19 +19,4 @@ class EndpointController extends ObjectController
));
}
}
protected function isPeer()
{
if (! $this->object) return false;
$apiconfig = $this->Config()->getSection('api');
$host = $apiconfig->get('address');
$port = $apiconfig->get('port');
if ($host === $this->object->host
&& $port === $this->object->port
) {
return true;
}
}
}