Rework service, change module_method configuration

This commit is contained in:
Deon George
2013-06-04 21:50:41 +10:00
parent 1a40f95b30
commit 951845f6c6
35 changed files with 780 additions and 1022 deletions

View File

@@ -78,7 +78,7 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
public function service_view() {
return View::factory('service/user/plugin/ssl/view')
->set('so',$this);
->set('o',$this);
}
/**
@@ -110,11 +110,14 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
if (! $this->service->status OR ! preg_match('/client/',$this->service->product->plugin()->extensions) OR $this->valid_to() < time())
return '';
// @todo Do some password validation
$output = Form::open(URL::link('user','ssl/download'));
$output = Form::open(URL::link('user','ssl/download'),array('class'=>'form-inline'));
$output .= Form::hidden('sid',$this->service->id);
$output .= _('Choose a password').': '.Form::password('passwd','').'<br/><br/>';
$output .= Form::submit('download','Download',array('class'=>'form_button'));
$output .= '<div class="input-append">';
$output .= Form::password('passwd','',array('label'=>_('Choose a password'),'placeholder'=>'Password','required','nocg'=>TRUE,'pattern'=>'.{6,}','title'=>'Minimum 6 chars'));
$output .= Form::button('download','Download',array('class'=>'btn btn-default','nocg'=>TRUE));
$output .= '</div>';
$output .= Form::close();
return $output;
}

View File

@@ -1,11 +1,13 @@
<!-- //@todo To translate -->
<table class="box-full">
<tr>
<td style="width: 40%;">Validity Days</td>
<td class="data" style="width: 60%;" colspan="2"><?php echo $po->display('days'); ?></td>
</tr>
<tr>
<td>Type</td>
<td class="data"><?php echo $po->display('extensions'); ?></td>
</tr>
</table>
<fieldset class="span6">
<legend>SSL Features</legend>
<div class="dl-horizontal">
<dt>Validatity Days</dt>
<dd><?php echo $po->display('days'); ?></dd>
<dt>Type</dt>
<dd><?php echo $po->display('extensions'); ?></dd>
</div> <!-- /dl-horizontal -->
</fieldset>

View File

@@ -1,56 +1,41 @@
<!-- //@todo To translate -->
<table class="box-full">
<tr>
<td class="head" colspan="3">Service Details</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td>
<table width="100%">
<tr>
<td style="width: 25%;">Subject</td>
<td style="width: 75%;" class="data"><?php echo $so->dn(); ?></td>
</tr>
<tr>
<td>Issuer</td>
<td class="data"><?php echo $so->issuerdn(); ?></td>
</tr>
<tr>
<td>CA</td>
<td class="data"><?php echo $so->SSL_CA->loaded() ? $so->SSL_CA->subject() : $so->issuer(); ?></td>
</tr>
<tr>
<td>Valid From</td>
<td class="data"><?php echo $so->valid_from(TRUE); ?></td>
</tr>
<tr>
<td>Valid To</td>
<td class="data"><?php echo $so->valid_to(TRUE); ?></td>
</tr>
<tr>
<td>Serial Number</td>
<td class="data"><?php echo $so->serial(); ?></td>
</tr>
<tr>
<td>Version</td>
<td class="data"><?php echo $so->version(); ?></td>
</tr>
<tr>
<td>Hash</td>
<td class="data"><?php echo $so->hash(); ?></td>
</tr>
<tr>
<td>Algorithm</td>
<td class="data"><?php echo $so->algorithm(); ?></td>
</tr>
<tr>
<td>Certificate</td>
<td class="data"><pre><?php echo $so->cert; ?></pre></td>
</tr>
</table>
</td>
<td style="text-align: right;"><?php echo $so->download_button(); ?></td>
</tr>
</table>
<fieldset class="span5">
<legend>Service Details</legend>
<div class="dl-horizontal">
<dt>Subject</dt>
<dd><?php echo $o->dn(); ?></dd>
<dt>Issuer</dt>
<dd><?php echo $o->issuerdn(); ?></dd>
<dt>CA</dt>
<dd><?php echo $o->SSL_CA->loaded() ? $o->SSL_CA->subject() : $o->issuer(); ?></dd>
<dt>Valid From</dt>
<dd><?php echo $o->valid_from(TRUE); ?></dd>
<dt>Valid To</dt>
<dd><?php echo $o->valid_to(TRUE); ?></dd>
<dt>Serial Number</dt>
<dd><?php echo $o->serial(); ?></dd>
<dt>Version</dt>
<dd><?php echo $o->version(); ?></dd>
<dt>Hash</dt>
<dd><?php echo $o->hash(); ?></dd>
<dt>Algorithm</dt>
<dd><?php echo $o->algorithm(); ?></dd>
</div> <!-- dl-horizontal -->
</fieldset>
<fieldset class="span6">
<legend>Certificate</legend>
<pre><?php echo $o->cert; ?></pre>
<?php echo $o->download_button(); ?>
</fieldset>