Optimised Service Display, extended SSL module functionality
This commit is contained in:
@@ -86,6 +86,7 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
|
||||
|
||||
/**
|
||||
* Return all our CA Certs for this certificate
|
||||
* @deprecated Use chain() instead.
|
||||
*/
|
||||
public function cacerts() {
|
||||
$result = array();
|
||||
@@ -100,15 +101,34 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Certificate Chain
|
||||
*
|
||||
* @return array Of SSL_CA Objects representing the Chain
|
||||
*/
|
||||
public function chain() {
|
||||
$result = array();
|
||||
|
||||
// Get the first parent CA certificate
|
||||
$po = $this->ca;
|
||||
|
||||
while ($po AND $po->loaded()) {
|
||||
array_push($result,$po);
|
||||
$po = ($po->validParent()) ? $po->parent : NULL;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function download_button() {
|
||||
if (! $this->service->status OR ! preg_match('/client/',$this->service->product->plugin()->extensions) OR $this->valid_to() < time())
|
||||
if (! $this->pk OR ! $this->service->status OR ! preg_match('/client/',$this->service->product->plugin()->extensions) OR $this->valid_to() < time())
|
||||
return '';
|
||||
|
||||
$output = Form::open(URL::link('user','ssl/download'),array('class'=>'form-inline'));
|
||||
$output .= Form::hidden('sid',$this->service->id);
|
||||
$output .= '<div class="input-append">';
|
||||
$output .= Form::password('passwd','',array('placeholder'=>_('Choose a password'),'required','nocg'=>TRUE,'pattern'=>'.{6,}','title'=>'Minimum 6 chars'));
|
||||
$output .= Form::button('download','Download',array('class'=>'btn btn-default','nocg'=>TRUE));
|
||||
$output .= Form::button('download','PKCS12',array('class'=>'btn btn-default','nocg'=>TRUE));
|
||||
$output .= '</div>';
|
||||
$output .= Form::close();
|
||||
|
||||
|
Reference in New Issue
Block a user