Fixes from live website

This commit is contained in:
Deon George
2013-04-20 11:40:44 +10:00
parent 13982be9f6
commit 79c76995b9
22 changed files with 283 additions and 55 deletions

View File

@@ -0,0 +1,81 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides CPANEL support
*
* @package Host
* @category Plugins
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
abstract class Host_Plugin_Cpanel extends Host_Plugin {
// Service Object
# protected $protocol = '1.6.0.0';
# protected $path = 'enterprise/control/agent.php';
# protected $packet;
# protected $xml;
# protected $_loaded = FALSE;
// Manage UI Login Attributes
protected $url = 'login';
protected $login_acnt_field = '';
protected $login_user_field = 'user';
protected $login_pass_field = 'pass';
// Our required abstract classes
public function serialize() {
return (string)$this->_object;
}
public function unserialize($s) {
$this->_object = XML::factory(NULL,NULL,$s);
}
public function __get($index) {
echo __METHOD__;die();
}
public function admin_update() {
echo __METHOD__;die();
}
public function manage_button(Model_Service_Plugin_Host $spho,$t) {
return $this->render_button($t,$spho->service_id,$spho->username_value(),substr(md5($spho->password_value()),0,8));
}
public function admin_manage_button(Model_Host_Server $hso,$t) {
return $this->render_button($t,$hso->id,substr(md5($hso->manage_username),0,8),substr(md5($hso->manage_password),0,8));
}
protected function render_button($t,$sid,$u,$p) {
$debug = FALSE;
$output = '';
$output .= Form::open(
$debug ? 'debug/site' : sprintf('%s/%s',$this->hso->manage_url,$this->url),
array('target'=>'w24','method'=>'post','id'=>sprintf('id_%s_%s',$sid,$t))
);
$output .= Form::input($this->login_user_field,$u,array('type'=>'hidden','id'=>sprintf('u_%s_%s',$sid,$t)));
$output .= Form::input($this->login_pass_field,$p,array('type'=>'hidden','id'=>sprintf('p_%s_%s',$sid,$t)));
$output .= Form::close();
$output .= Form::button('submit',_('Manage'),array('class'=>'form_button','value'=>sprintf('%s:%s',$sid,$t)));
return $output;
}
protected function init() {
echo __METHOD__;die();
}
protected function server_command(XML $xml) {
echo __METHOD__;die();
}
public function loaded() {
return $this->_loaded;
}
private function render(XML $xml) {
echo __METHOD__;die();
}
}
?>

View File

@@ -0,0 +1,100 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides CPANEL client support
*
* @package Host
* @category Plugins
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Host_Plugin_Cpanel_11 extends Host_Plugin_Cpanel {
# protected $protocol = '1.6.3.0';
// @todo Get these default "templates" values out of the DB
private $_template = array(
);
/**
* Get a Client Configuration
*/
public function cmd_getclient(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Get a DNS Configuration
*/
public function cmd_getdns(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Get Mail Configuration
*/
public function cmd_getmail(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Get a Domain Configuration
*/
public function cmd_getdomain(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Get Reseller
*/
public function cmd_getreseller(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Get Domain Traffic
*/
public function cmd_gettraffic(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Disable Mail
*/
public function cmd_disablemail(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
/**
* Provision a hosting service
* @todo To implement
*/
public function provision(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
public function add_client(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
public function add_dnsdata(Model_Service $so,XML $dns) {
throw new Kohana_Exception('Not Implemented');
}
public function add_domain(Model_Service $so) {
throw new Kohana_Exception('Not Implemented');
}
public function newitem(Model_Service $so,$type) {
throw new Kohana_Exception('Not Implemented');
}
public function setexpire(Model_Service $so,$date=NULL) {
throw new Kohana_Exception('Not Implemented');
}
public function setpasswd(Model_Service $so,$pw) {
throw new Kohana_Exception('Not Implemented');
}
}
?>