forkbb/app/Models/Pages/Admin/Host.php
2018-04-21 20:59:38 +07:00

36 lines
871 B
PHP

<?php
namespace ForkBB\Models\Pages\Admin;
use ForkBB\Models\Pages\Admin;
class Host extends Admin
{
/**
* Подготавливает данные для шаблона
*
* @param array $args
* @param string $method
*
* @return Page
*/
public function view(array $args, $method)
{
$this->c->Lang->load('admin_host');
$ip = \filter_var($args['ip'], \FILTER_VALIDATE_IP);
if (false === $ip) {
return $this->c->Message->message('Bad request', false); // ??????
}
$host = @\gethostbyaddr($ip);
$this->nameTpl = 'message';
$this->titles = \ForkBB\__('Info');
$this->message = \ForkBB\__('Host info', $ip, $host, $this->c->Router->link('AdminHost', ['ip' => $ip]));
$this->back = true;
return $this;
}
}