You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
980 B
PHP

<?php
namespace Eater\Glim\Handler\Panel\Servers\Edit;
use Eater\Glim\Handler\Session;
use Eater\Glim\Model\ServerQuery;
class Action extends Session
{
protected $shouldHaveSuperuser = true;
public function handle()
{
$server = ServerQuery::create()->findOneByFingerprint($this->attr('fingerprint'));
$server->setFqdn($this->post('fqdn'));
$server->setExternalIp($this->post('external-ip'));
# Details
$server->setLocation($this->post('location'));
$server->setSpeed($this->post('speed'));
# Config
$server->setInternalIp($this->post('internal-ip'));
$server->setNetmask($this->post('netmask'));
$server->setPort($this->post('post'));
$server->setProtocol($this->post('protocol'));
$server->setFirstDns($this->post('first-dns'));
$server->setSecondDns($this->post('second-dns'));
$server->save();
$this->json([ 'success'=> true ]);
}
}