Major work to domain and hosting
Minor updates for ADSL services Updates to Sort::MAsort() Move core OSB items under application/ Moved ACCOUNT functions under application Minor updates to task
This commit is contained in:
24
modules/host/classes/model/host/server.php
Normal file
24
modules/host/classes/model/host/server.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports OSB Web Hosting
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Product
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Host_Server extends ORMOSB {
|
||||
public function manage_button($u,$p,$d) {
|
||||
$c = sprintf('Service_Host_%s',$this->provision_plugin);
|
||||
if (! class_exists($c))
|
||||
return '';
|
||||
|
||||
$po = new $c($this->id);
|
||||
|
||||
return $po->manage_button($u,$p,$d);
|
||||
}
|
||||
}
|
||||
?>
|
57
modules/host/classes/model/service/plugin/host.php
Normal file
57
modules/host/classes/model/service/plugin/host.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports Services
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Hosting
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Service_Plugin_Host extends Model_Service_Plugin {
|
||||
protected $_table_name = 'service__hosting';
|
||||
protected $_created_column = FALSE;
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'domain_tld'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'),
|
||||
'host_server'=>array('far_key'=>'host_server_id','foreign_key'=>'id'),
|
||||
);
|
||||
protected $_belongs_to = array(
|
||||
'service'=>array(),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'domain_name'=>array(
|
||||
array('strtoupper',array(':value')),
|
||||
),
|
||||
'host_expire'=>array(
|
||||
array('Config::date',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
// Required abstract functions
|
||||
public function service_view() {
|
||||
return View::factory('service/user/plugin/host/view')
|
||||
->set('so',$this);
|
||||
}
|
||||
|
||||
public function name() {
|
||||
return sprintf('%s.%s',$this->display('domain_name'),$this->domain_tld->display('name'));
|
||||
}
|
||||
|
||||
protected function _admin_update() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This provides us with a manage button to jump to the hosting server
|
||||
* to manage the domain.
|
||||
*/
|
||||
public function manage_button() {
|
||||
return ($this->host_username AND $this->host_password) ? $this->host_server->manage_button($this->host_username,$this->host_password,$this->name()) : '';
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user