Added disable mail

This commit is contained in:
Deon George
2012-07-23 22:21:13 +10:00
parent 25602454b7
commit f1f28cd746
2 changed files with 60 additions and 10 deletions

View File

@@ -21,12 +21,14 @@ class Controller_Task_Host extends Controller_Task {
case 'getclient':
case 'getdomain':
case 'getdns':
case 'getmail':
case 'getreseller':
case 'gettraffic':
case 'migrate':
case 'provision':
case 'resetpw':
case 'setdisablemail':
case 'setexpire':
case 'setpasswd':
$this->so = ORM::factory('service',$this->request->param('id'));
if (! $this->so->loaded())
@@ -101,6 +103,16 @@ class Controller_Task_Host extends Controller_Task {
echo (string)$result->_object;
}
/**
* Get Mail Details from Host Server
*/
public function action_getmail() {
$result = $this->hpo->cmd_getmail($this->so);
echo (string)$result->_xml;
echo (string)$result->_object;
}
/**
* Get Reseller
*/
@@ -257,16 +269,13 @@ class Controller_Task_Host extends Controller_Task {
print_r((string)$result);
}
public function action_resetpw() {
$pw = PWGen::get(TRUE);
/**
* Provision a Hosting Service
*/
public function action_setdisablemail() {
$result = $this->hpo->cmd_disablemail($this->so);
$spho = $this->so->plugin();
$spho->host_password = $pw;
if (! ($result = $this->hpo->setpasswd($this->so,$pw)) OR ! $result->loaded() OR ! $spho->save())
throw new Kohana_Exception('Unable to set password.');
echo _('Password Reset Success');
echo (string)$result->_object;
}
public function action_setexpire() {
@@ -277,5 +286,17 @@ class Controller_Task_Host extends Controller_Task {
} else
echo (string)$result->_object;
}
public function action_setpasswd() {
$pw = PWGen::get(TRUE);
$spho = $this->so->plugin();
$spho->host_password = $pw;
if (! ($result = $this->hpo->setpasswd($this->so,$pw)) OR ! $result->loaded() OR ! $spho->save())
throw new Kohana_Exception('Unable to set password.');
echo _('Password Reset Success');
}
}
?>