This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/host_server/classes/controller/hostserver.php
2011-08-26 04:30:58 +10:00

106 lines
2.4 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Host Server functions
*
* @package OSB
* @subpackage HostServer
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_HostServer extends Controller {
// protected $_control = array(
// array('Product Categories'=>'product_category'),
// );
public function action_plesk_addclienttest($id) {
$ao = ORM::factory('account',$id);
$plesk = new Plesk;
$result = $plesk->addclient($ao);
print_r(array('s'=>(string)$result,'r'=>(string)$result->add->result));
}
/**
* Add a domain for the client
*
* @param int $id Hosting ID (in OSB)
* @return unknown_type
*/
public function action_plesk_adddomaintest($id) {
$so = ORM::factory('service',$id);
$plesk = new Plesk;
$result = $plesk->adddomain($so);
print_r(array('s'=>(string)$result,'r'=>(string)$result->add->result));
}
public function action_plesk_addclient($id) {
}
public function action_plesk_getclient($id) {
$ao = ORM::factory('account',$id);
$plesk = new Plesk;
print_r($plesk->get_client($ao)->as_array());
}
public function action_plesk_getservice($id) {
$so = ORM::factory('service',$id);
$plesk = new Plesk;
$result = $plesk->get_service($so);
print_r(array('s'=>(string)$result,'r'=>(string)$result->get));
}
/**
* Set the Limits for the client
*
* @param int $id Client ID (in plesk)
* @return unknown_type
*/
public function action_plesk_setlimits() {
$plesk = new Plesk;
$result = $plesk->setlimits();
print_r(array('s'=>(string)$result,'r'=>(string)$result->set->result));
}
/**
* Set the IP for the client
*
* @param int $id Client ID (in plesk)
* @return unknown_type
*/
public function action_plesk_setip($id) {
$plesk = new Plesk;
$result = $plesk->setip($id);
print_r(array('s'=>(string)$result,'r'=>(string)$result->set));
}
/**
* Disable mail for a domain
*
* @param int $id Domain ID (in plesk)
* @return unknown_type
*/
public function action_plesk_disablemail($id) {
$plesk = new Plesk;
$result = $plesk->disablemail($id);
print_r(array('s'=>(string)$result,'r'=>(string)$result));
}
public function action_plesk_settraffic() {
die();
$plesk = new Plesk;
$result = $plesk->set_traffic();
print_r(array('s'=>(string)$result,'r'=>(string)$result));
}
}
?>