Removed redundant functions, some Standardisation work

This commit is contained in:
Deon George
2016-08-15 21:23:18 +10:00
parent 24bb4a701b
commit 07de13f678
82 changed files with 367 additions and 590 deletions

View File

@@ -122,12 +122,12 @@ class Controller_Reseller_Ssl extends Controller_Ssl {
}
public function action_renew() {
$so = ORM::factory('Service',Request::current()->param('id'));
$so = ORM::factory('Service',$this->request->param('id'));
if (! $so->loaded() OR ! Auth::instance()->authorised($so->account))
throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it');
$so->plugin()->renew();
$so->plugin()->renew($this->request->query('force'));
HTTP::redirect(URL::link('user','service/view/'.$so->id));
}

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_SSL extends ORM_OSB {
class Model_SSL extends ORM {
protected $_updated_column = FALSE;
}
?>

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_SSL_CA extends ORM_OSB {
class Model_SSL_CA extends ORM {
protected $_updated_column = FALSE;
// Relationships

View File

@@ -47,14 +47,6 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
return (! $this->_so) ? ($format ? 'Not Issued' : 0) : $this->_so->get_valid_to($format);
}
public function name($variable=NULL) {
return ($this->cert AND $this->ca->loaded()) ? sprintf('%s:%s',$this->ca->subject(),$this->display('cert')) : $this->display('csr');
}
public function namesub($variable=NULL) {
return $this->ca->dn();
}
public function password() {} // Not used
public function username() {} // Not used
@@ -156,6 +148,14 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
return 'Unknown';
}
public function name($variable=NULL) {
return ($this->cert AND $this->ca->loaded()) ? sprintf('%s:%s',$this->ca->subject(),$this->display('cert')) : $this->display('csr');
}
public function namesub($variable=NULL) {
return $this->ca->dn();
}
/**
* Renew an SSL Certificate
*/
@@ -180,7 +180,7 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
$res = openssl_csr_sign($this->csr,$this->ca->sign_cert,$this->ca->sign_pk,$days,array(
'config'=>$ssl_conf['config'],
'x509_extensions'=>$this->service->product->plugin()->extensions,
'digest_alg'=>'sha1',
'digest_alg'=>$ssl_conf['digest'],
),time());
if ($res AND openssl_x509_export($res,$cert)) {