Added getDNS() to plesk

This commit is contained in:
Deon George 2012-07-03 23:05:08 +10:00
parent 5f5d8a906a
commit c8fb3253aa
3 changed files with 61 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class Controller_Task_Host extends Controller_Task {
switch (Request::current()->action()) { switch (Request::current()->action()) {
case 'getclient': case 'getclient':
case 'getdomain': case 'getdomain':
case 'getdns':
case 'getreseller': case 'getreseller':
case 'gettraffic': case 'gettraffic':
case 'provision': case 'provision':
@ -85,6 +86,18 @@ class Controller_Task_Host extends Controller_Task {
print_r($result); 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 * Get Reseller
*/ */

View File

@ -66,6 +66,29 @@ class Host_Plugin_Plesk_10 extends Host_Plugin_Plesk {
return $this; 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 * Get a Domain Configuration
*/ */

View File

@ -99,6 +99,7 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
if (! $this->loaded()) if (! $this->loaded())
throw new Kohana_Exception('Unable to get PLESK Client data - Error :error',array(':error'=>(string)$result)); 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 ($items as $k)
foreach ($result->get($k) as $a=>$b) foreach ($result->get($k) as $a=>$b)
$this->_object[$k] = $this->collapse($b); $this->_object[$k] = $this->collapse($b);
@ -106,6 +107,29 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
return $this; 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 * Get a Domain Configuration
*/ */
@ -126,6 +150,7 @@ class Host_Plugin_Plesk_9 extends Host_Plugin_Plesk {
if (! $this->loaded()) if (! $this->loaded())
throw new Kohana_Exception('Unable to get PLESK Domain data - Error :error',array(':error'=>(string)$result)); 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 ($items as $k)
foreach ($result->get($k) as $a=>$b) foreach ($result->get($k) as $a=>$b)
$this->_object[$k] = $this->collapse($b); $this->_object[$k] = $this->collapse($b);