Open Source Billing

This commit is contained in:
Deon George
2013-10-10 13:44:53 +11:00
commit b02d70adf0
2344 changed files with 392978 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class will take care of Domain Registrars.
*
* @package Domain
* @category Service
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
abstract class Service_Domain {
protected $so;
protected $fetchresult = NULL;
// @todo These options should be centrally defined
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,
);
/**
* Setup this class. We need to get our supplier details out of the database.
*/
public function __construct($sid) {
$this->so = ORM::factory('Domain_Registrar',$sid);
}
/**
* Our HTML button that will enable us to manage this domain.
*/
abstract public function manage_button(Model_Service_Plugin_Domain $spdo,$t);
/**
* Return an instance of this class
*
* @return HeadImage
*/
public static function instance($supplier) {
$sc = sprintf('%s_%s',get_called_class(),$supplier);
if (! class_exists($sc))
throw new Kohana_Exception('Class doesnt exist for :supplier',array(':supplier'=>$supplier));
else
return new $sc;
}
}
?>

View File

@@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is able to interact with TPP
*
* @package Domain
* @category Service
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Service_Domain_Manual extends Service_Domain {
private $login_acnt_field = '';
private $login_user_field = '';
private $login_pass_field = '';
// Our required abstract classes
public function manage_button(Model_Service_Plugin_Domain $spdo,$t) {
return _('Please contact us');
}
}
?>

View File

@@ -0,0 +1,34 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is able to interact with TPP
*
* @package Domain
* @category Service
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Service_Domain_PlanetDomain extends Service_Domain {
private $login_acnt_field = '';
private $login_user_field = 'login.username';
private $login_pass_field = 'login.password';
// Our required abstract classes
public function manage_button(Model_Service_Plugin_Domain $spdo,$t) {
$output = '';
$output .= Form::open(
sprintf('%s/%s',$this->so->whitelabel_url,'newdnr/action/user/login.jsp'),
array('target'=>'pd','method'=>'post','id'=>sprintf('id_%s_%s',$spdo->service_id,$t))
);
$output .= Form::input($this->login_user_field,$spdo->username_value(),array('type'=>'hidden','id'=>sprintf('u_%s_%s',$spdo->service_id,$t)));
$output .= Form::input($this->login_pass_field,substr(md5($spdo->password_value()),0,8),array('type'=>'hidden','id'=>sprintf('p_%s_%s',$spdo->service_id,$t)));
$output .= Form::input('page.next',sprintf('/newdnr/action/dns/getDNSDetails.jsp?domain.name=%s',$d),array('type'=>'hidden'));
$output .= Form::close();
$output .= Form::button('submit',_('Manage'),array('class'=>'form_button','value'=>sprintf('%s:%s',$spdo->service_id,$t)));
return $output;
}
}
?>

View File

@@ -0,0 +1,34 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is able to interact with TPP
*
* @package Domain
* @category Service
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Service_Domain_TPP extends Service_Domain {
private $login_acnt_field = '';
private $login_user_field = 'login';
private $login_pass_field = 'password';
// Our required abstract classes
public function manage_button(Model_Service_Plugin_Domain $spdo,$t) {
$debug = FALSE;
$output = '';
$output .= Form::open(
$debug ? 'debug/site' : sprintf('%s/%s',$this->so->whitelabel_url,'execute/logon'),
array('target'=>'tpp','method'=>'post','id'=>sprintf('id_%s_%s',$spdo->service_id,$t))
);
$output .= Form::input($this->login_user_field,$spdo->username_value(),array('type'=>'hidden','id'=>sprintf('u_%s_%s',$spdo->service_id,$t)));
$output .= Form::input($this->login_pass_field,substr(md5($spdo->password_value()),0,8),array('type'=>'hidden','id'=>sprintf('p_%s_%s',$spdo->service_id,$t)));
$output .= Form::close();
$output .= Form::button('submit',_('Manage'),array('class'=>'form_button','value'=>sprintf('%s:%s',$spdo->service_id,$t)));
return $output;
}
}
?>