Updates for SSL Certificates

This commit is contained in:
Deon George
2011-12-27 00:52:46 +11:00
parent 7fdba208eb
commit fe317b9cb0
7 changed files with 80 additions and 27 deletions

View File

@@ -27,6 +27,9 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
'csr'=>array(
array('SSL::csrsubject',array(':value')),
),
'cert'=>array(
array('SSL::subject',array(':value')),
),
);
// Required abstract functions
@@ -36,7 +39,7 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
}
public function name() {
return $this->display('csr');
return $this->display($this->cert ? 'cert' : 'csr');
}
// @todo This needs to be validated for this model
@@ -47,12 +50,12 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
return $this->service->product->plugin();
}
public function valid_from() {
return SSL::from($this->cert);
public function valid_from($format=FALSE) {
return SSL::from($this->cert,$format);
}
public function valid_to() {
return SSL::expire($this->cert);
public function valid_to($format=FALSE) {
return SSL::expire($this->cert,$format);
}
public function serial_num() {
@@ -96,7 +99,7 @@ class Model_Service_Plugin_SSL extends Model_Service_Plugin {
}
public function download_button() {
if (! preg_match('/client/',$this->ssl->extensions))
if (! $this->service->active OR ! preg_match('/client/',$this->ssl->extensions) OR $this->valid_to() < time())
return '';
// @todo Do some password validation

View File

@@ -33,5 +33,8 @@ class Model_SSL_CA extends ORMOSB {
public function issuer() {
return SSL::issuer($this->sign_cert);
}
// @todo SAVE: auto work out the parent_ssl_ca_id
}
?>