2012-06-26 14:28:18 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class provides HOST Plugin Support
|
|
|
|
*
|
2013-03-19 22:35:19 +00:00
|
|
|
* @package Host
|
2012-06-26 14:28:18 +00:00
|
|
|
* @category Plugins
|
|
|
|
* @author Deon George
|
2013-03-19 22:35:19 +00:00
|
|
|
* @copyright (c) 2009-2013 Open Source Billing
|
|
|
|
* @license http://dev.osbill.net/license.html
|
2012-06-26 14:28:18 +00:00
|
|
|
*/
|
|
|
|
abstract class Host_Plugin implements Serializable {
|
|
|
|
protected $hso; // Our Host Serve Object
|
|
|
|
protected $_object;
|
|
|
|
|
|
|
|
protected $curlopts = array(
|
|
|
|
CURLOPT_CONNECTTIMEOUT => 60,
|
|
|
|
CURLOPT_FAILONERROR => TRUE,
|
|
|
|
CURLOPT_FOLLOWLOCATION => FALSE,
|
|
|
|
CURLOPT_HEADER => FALSE,
|
|
|
|
CURLOPT_HTTPPROXYTUNNEL => FALSE,
|
|
|
|
CURLOPT_RETURNTRANSFER => TRUE,
|
|
|
|
CURLOPT_TIMEOUT => 30,
|
|
|
|
CURLOPT_SSL_VERIFYHOST => FALSE,
|
|
|
|
CURLOPT_SSL_VERIFYPEER => FALSE,
|
|
|
|
CURLOPT_VERBOSE => FALSE,
|
|
|
|
);
|
|
|
|
|
|
|
|
// Required abstract classes
|
2012-07-12 05:10:53 +00:00
|
|
|
abstract public function __get($key);
|
2012-06-26 14:28:18 +00:00
|
|
|
abstract public function admin_update();
|
|
|
|
|
|
|
|
abstract public function manage_button(Model_Service_Plugin_Host $spho,$t);
|
|
|
|
abstract public function admin_manage_button(Model_Host_Server $hso,$t);
|
|
|
|
abstract protected function render_button($t,$sid,$u,$p);
|
|
|
|
|
|
|
|
public function __construct(Model_Host_Server $hso) {
|
|
|
|
$this->hso = $hso;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function value($key,$value=NULL) {
|
|
|
|
// If value is NULL, we are a getter
|
|
|
|
if (is_null($value))
|
|
|
|
return isset($this->hso->provision_plugin_data[$key]) ? $this->hso->provision_plugin_data[$key] : NULL;
|
|
|
|
else
|
|
|
|
$this->hso->provision_plugin_data[$key] = $value;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|