Added getDNS() to plesk
This commit is contained in:
parent
5f5d8a906a
commit
c8fb3253aa
@ -20,6 +20,7 @@ class Controller_Task_Host extends Controller_Task {
|
||||
switch (Request::current()->action()) {
|
||||
case 'getclient':
|
||||
case 'getdomain':
|
||||
case 'getdns':
|
||||
case 'getreseller':
|
||||
case 'gettraffic':
|
||||
case 'provision':
|
||||
@ -85,6 +86,18 @@ class Controller_Task_Host extends Controller_Task {
|
||||
print_r($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DNS Details from Host Server
|
||||
*/
|
||||
public function action_getdns() {
|
||||
$result = $this->hpo->cmd_getdns($this->so,'/tmp/z');
|
||||
|
||||
#if ($result->loaded())
|
||||
# $this->verify('d',$result);
|
||||
|
||||
print_r($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Reseller
|
||||
*/
|
||||
|
@ -66,6 +66,29 @@ class Host_Plugin_Plesk_10 extends Host_Plugin_Plesk {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a DNS Configuration
|
||||
*/
|
||||
public function cmd_getdns(Model_Service $so,$file='') {
|
||||
$do = $this->cmd_getdomain($so);
|
||||
|
||||
$this->init();
|
||||
$domain = $this->packet->add_node('dns');
|
||||
$get = $domain->add_node('get_rec');
|
||||
$filter = $get->add_node('filter');
|
||||
$filter->add_node('site-id',$do->id);
|
||||
|
||||
$result = $this->server_command($this->xml);
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Unable to get PLESK Domain data - Error :error',array(':error'=>(string)$result));
|
||||
|
||||
$this->_object = $this->collapse($result);
|
||||
if ($file)
|
||||
file_put_contents($file,(string)$result);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Domain Configuration
|
||||
*/
|
||||
|
@ -99,6 +99,7 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Unable to get PLESK Client data - Error :error',array(':error'=>(string)$result));
|
||||
|
||||
$this->_object['id'] = $result->id->value();
|
||||
foreach ($items as $k)
|
||||
foreach ($result->get($k) as $a=>$b)
|
||||
$this->_object[$k] = $this->collapse($b);
|
||||
@ -106,6 +107,29 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a DNS Configuration
|
||||
*/
|
||||
public function cmd_getdns(Model_Service $so,$file='') {
|
||||
$do = $this->cmd_getdomain($so);
|
||||
|
||||
$this->init();
|
||||
$domain = $this->packet->add_node('dns');
|
||||
$get = $domain->add_node('get_rec');
|
||||
$filter = $get->add_node('filter');
|
||||
$filter->add_node('domain_id',$do->id);
|
||||
|
||||
$result = $this->server_command($this->xml);
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Unable to get PLESK Domain data - Error :error',array(':error'=>(string)$result));
|
||||
|
||||
$this->_object = $this->collapse($result);
|
||||
if ($file)
|
||||
file_put_contents($file,(string)$result);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Domain Configuration
|
||||
*/
|
||||
@ -126,6 +150,7 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Unable to get PLESK Domain data - Error :error',array(':error'=>(string)$result));
|
||||
|
||||
$this->_object['id'] = $result->id->value();
|
||||
foreach ($items as $k)
|
||||
foreach ($result->get($k) as $a=>$b)
|
||||
$this->_object[$k] = $this->collapse($b);
|
||||
|
Reference in New Issue
Block a user