Updates for SSL Certificates
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user