diff --git a/application/classes/Database/Mysql.php b/application/classes/Database/MySQLi.php similarity index 89% rename from application/classes/Database/Mysql.php rename to application/classes/Database/MySQLi.php index 5b7e889f..a3e1b64b 100644 --- a/application/classes/Database/Mysql.php +++ b/application/classes/Database/MySQLi.php @@ -12,7 +12,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Database_MySQL extends Kohana_Database_MySQL { +class Database_MySQLi extends Kohana_Database_MySQLi { // MySQL uses a backtick for identifiers protected $_identifier = ''; } diff --git a/application/classes/Database/Query/Builder/Join.php b/application/classes/Database/Query/Builder/Join.php new file mode 100644 index 00000000..975c95f1 --- /dev/null +++ b/application/classes/Database/Query/Builder/Join.php @@ -0,0 +1,21 @@ +_on[] = array($this->_table.'.site_id','=',Site::id()); + + return parent::compile($db); + } +} +?> diff --git a/application/classes/Model/Account.php b/application/classes/Model/Account.php index e8fe2fdb..7174fc01 100644 --- a/application/classes/Model/Account.php +++ b/application/classes/Model/Account.php @@ -50,6 +50,10 @@ class Model_Account extends Model_Auth_UserDefault { return sprintf('%s-%04s',Company::instance()->site(TRUE),$this->id); } + public function activated() { + return $this->has('group'); + } + /** * Get the groups that an account belongs to */ @@ -135,7 +139,7 @@ class Model_Account extends Model_Auth_UserDefault { if (empty($result[$mmo->id])) $result[$mmo->id] = $mmo; - Sort::MAsort($result,'module->name,menu_display'); + Sort::MAsort($result,array('module->name','menu_display')); return $result; } diff --git a/application/config/database.php b/application/config/database.php index 896a3e43..30faa4b1 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -12,7 +12,7 @@ return array ( - 'default' => array + 'old' => array ( 'type' => 'mysql', 'connection' => array( @@ -39,5 +39,46 @@ return array 'compress' => FALSE, 'profiling' => TRUE, ), + 'pdo' => array( + 'type' => 'PDO', + 'connection' => array( + /** + * The following options are available for PDO: + * + * string dsn Data Source Name + * string username database username + * string password database password + * boolean persistent use persistent connections? + */ + 'dsn' => 'mysql:host=localhost;dbname=database', + 'username' => 'username', + 'password' => 'password', + 'persistent' => FALSE, + ), + /** + * The following extra options are available for PDO: + * + * string identifier set the escaping identifier + */ + 'table_prefix' => 'ab_', + 'charset' => 'utf8', + 'caching' => FALSE, + ), + 'default' => array( + 'type' => 'MySQLi', + 'connection' => array( + 'hostname' => 'localhost', + 'username' => 'username', + 'password' => 'password', + 'persistent' => FALSE, + 'database' => 'database', + 'ssl' => NULL, + ), + 'table_prefix' => 'ab_', + 'charset' => 'utf8', + 'caching' => FALSE, + 'compress' => FALSE, + 'profiling' => TRUE, + ), ); ?> diff --git a/application/config/session.php b/application/config/session.php new file mode 100644 index 00000000..c0bfec9b --- /dev/null +++ b/application/config/session.php @@ -0,0 +1,18 @@ + array( + 'name'=>'OSB', + ), +); +?> diff --git a/application/media/guide/img/logo-small.png b/application/media/guide/img/logo-small.png new file mode 100644 index 00000000..2fc13978 Binary files /dev/null and b/application/media/guide/img/logo-small.png differ diff --git a/modules/lnapp b/modules/lnapp index 3bbab271..c5b2785e 160000 --- a/modules/lnapp +++ b/modules/lnapp @@ -1 +1 @@ -Subproject commit 3bbab271e75e079e8c3d5371064153cabdd3c98d +Subproject commit c5b2785e82ed2bf914e7df3107373e24098df794 diff --git a/modules/service/classes/Controller/Admin/Service.php b/modules/service/classes/Controller/Admin/Service.php index ed53de57..8026cd31 100644 --- a/modules/service/classes/Controller/Admin/Service.php +++ b/modules/service/classes/Controller/Admin/Service.php @@ -100,10 +100,11 @@ $(document).ready(function() { }); '); +// @todo Move this to automatically add this if a date format is used Block::factory() ->type('form-horizontal') ->title('Add/View Charge') - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->body(View::factory('service/admin/add')); } @@ -169,7 +170,7 @@ $(document).ready(function() { Block::factory() ->type('form-horizontal') ->title(sprintf('%s: %s %s',_('Update Service'),$id,$so->name())) - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->body(View::factory('service/admin/edit') ->set('o',$so) ->set('plugin_form',$so->plugin_edit()) diff --git a/modules/service/classes/Model/Service.php b/modules/service/classes/Model/Service.php index 2b45d0de..2abe972a 100644 --- a/modules/service/classes/Model/Service.php +++ b/modules/service/classes/Model/Service.php @@ -156,7 +156,7 @@ class Model_Service extends ORM_OSB { /** * List invoices for this service */ - public function invoice_list($due=FALSE) { + public function invoice_list($due=FALSE,$num=NULL) { $result = array(); $x = $this->invoice->distinct('id'); @@ -165,6 +165,9 @@ class Model_Service extends ORM_OSB { if ($due) $x->where_unprocessed(); + if (! is_null($num)) + $x->limit($num); + foreach ($x->find_all() as $io) if (! $due OR $io->due()) array_push($result,$io); diff --git a/modules/service/views/service/admin/edit.php b/modules/service/views/service/admin/edit.php index 21b91018..f0252f6c 100644 --- a/modules/service/views/service/admin/edit.php +++ b/modules/service/views/service/admin/edit.php @@ -1,42 +1,29 @@ -
+
Update Service -
- status,FALSE,array('label'=>'Active','class'=>'span1')); ?> -
+ status,FALSE,array('label'=>'Active')); ?> -
- recur_schedule,FALSE,array('label'=>'Billing Period','required'));?> -
+ recur_schedule,FALSE,array('label'=>'Billing Period','required'));?> -
-
- display('date_next_invoice'),array('class'=>'span2','label'=>'Date Next Invoice','add-on'=>'','disabled')); ?> -
+ +
+ + +
+ date_next_invoice); ?> - date_next_invoice); ?> -
+ taxable,FALSE,array('label'=>'Taxable')); ?> -
- taxable,FALSE,array('label'=>'Taxable','class'=>'span1')); ?> -
+ suspend_billing,FALSE,array('label'=>'Suspend Billing')); ?> -
- suspend_billing,FALSE,array('label'=>'Suspend Billing','class'=>'span1')); ?> -
- -
- price_override,array('label'=>'Override Price','class'=>'span1')); ?> -
+ price_override,array('label'=>'Override Price')); ?>
-
- - -
+ +
-
+
diff --git a/modules/service/views/service/info.php b/modules/service/views/service/info.php index a7b4b38d..344f37ad 100644 --- a/modules/service/views/service/info.php +++ b/modules/service/views/service/info.php @@ -1,46 +1,44 @@ -
-
- Service Information +
+ Service Information -
-
Account
-
account->name(),$o->account->accnum()); ?>
+
+
Account
+
account->name(),$o->account->accnum()); ?>
- external_billing) : ?> -
External Billed
-
display('external_billing'); ?>
- - -
Service Active
-
display('status'); ?>
+ external_billing) : ?> +
External Billed
+
display('external_billing'); ?>
-
Billing Period
-
display('recur_schedule');?>
+ +
Service Active
+
display('status'); ?>
-
Cost
-
price_override) ? sprintf('%s ',$o->price(TRUE,TRUE,TRUE)) : ''). $o->price(TRUE,TRUE); if ($o->pending_change()) echo ' *'; ?>
+
Billing Period
+
display('recur_schedule');?>
+ +
Cost
+
price_override) ? sprintf('%s ',$o->price(TRUE,TRUE,TRUE)) : ''). $o->price(TRUE,TRUE); if ($o->pending_change()) echo ' *'; ?>
- price) OR ($o->price<=$o->product->price($o->price_group,$o->recur_schedule,'base'))) : ?> -
Service
-
product_id,$o->product->title()); ?>
- - -
Invoiced To
-
invoiced_to(TRUE); ?>
- -
Paid To
-
paid_to(TRUE); ?>
- -
Date Next Invoice
-
suspend_billing ? '%s' : '%s',$o->display('date_next_invoice')); ?>
- -
Current Invoices Due
-
due(TRUE); ?>
+ price) OR ($o->price<=$o->product->price($o->price_group,$o->recur_schedule,'base'))) : ?> +
Service
+
product_id,$o->product->title()); ?>
-
-
- product->feature_summary(); ?> -
+
Invoiced To
+
invoiced_to(TRUE); ?>
+ +
Paid To
+
paid_to(TRUE); ?>
+ +
Date Next Invoice
+
suspend_billing ? '%s' : '%s',$o->display('date_next_invoice')); ?>
+ +
Current Invoices Due
+
due(TRUE); ?>
+ + + + +product->feature_summary(); ?> diff --git a/modules/service/views/service/user/invoice/list.php b/modules/service/views/service/user/invoice/list.php new file mode 100644 index 00000000..0644096d --- /dev/null +++ b/modules/service/views/service/user/invoice/list.php @@ -0,0 +1,18 @@ + +
+ Invoices for this Service + + data($o->invoice_list(FALSE,20)) + ->columns(array( + 'id'=>'ID', + 'void'=>'Void', + 'date_orig'=>'Date', + 'due_date'=>'Due', + 'total(TRUE)'=>'Amount', + 'due(TRUE)'=>'Due', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','invoice/view/')), + )); ?> +
diff --git a/modules/service/views/service/user/invoice/next.php b/modules/service/views/service/user/invoice/next.php new file mode 100644 index 00000000..2d95af65 --- /dev/null +++ b/modules/service/views/service/user/invoice/next.php @@ -0,0 +1,6 @@ + +
+ Next Invoice Charges + + add_service($o)->render('html','body',array('noid'=>TRUE)); ?> +
diff --git a/modules/service/views/service/user/view.php b/modules/service/views/service/user/view.php index 048bb1e9..64b49fad 100644 --- a/modules/service/views/service/user/view.php +++ b/modules/service/views/service/user/view.php @@ -1,104 +1,39 @@ -set('o',$o); ?> -service_view(); ?> +
+set('o',$o); -service_billing->loaded()) : ?> -
-
- Automatic Payment Details + if ($o->status AND ! $o->external_billing) : + echo View::factory('service/user/invoice/next')->set('o',$o); + endif; -
-
Direct Payment
-
service_billing->checkout->display('name'); ?>
- service_billing->checkout_amount)) : ?> -
Standard Amount
-
service_billing->display('checkout_amount'); ?>
- -
-
-
- + if ($o->service_billing->loaded()) : + echo View::factory('service/user/view/payment')->set('o',$o); + endif; +?> +
+ +
+ service_view(); ?> +
+ +
+ set('o',$o); ?> +
charges()) : ?> -
-
- Service Charges to Bill: charges(TRUE,TRUE); ?> - - data($o->charge_list(TRUE)) - ->columns(array( - 'date_orig'=>'Date', - 'description'=>'Description', - 'total(TRUE)'=>'Amount', - )); ?> -
-
+
+ set('o',$o); ?> +
-status AND ! $o->external_billing) : ?> -
-
- Next Invoice Charges - - add_service($o)->render('html','body',array('noid'=>TRUE)); ?> -
-
- - -
-
- Invoices for this Service - - data($o->invoice_list()) - ->columns(array( - 'id'=>'ID', - 'void'=>'Void', - 'date_orig'=>'Date', - 'due_date'=>'Due', - 'total(TRUE)'=>'Amount', - 'due(TRUE)'=>'Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )); ?> -
-
- service_memo->find_all(); if ($x->count()) : ?> -
-
- Service Memos - - data($x) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'account->name()'=>'Account', - 'memo'=>'Memo', - )); ?> -
-
+
+ set('o',$o); ?> +
email()->find_all(); if ($x->count()) : ?> -
-
- Emails about this service - - data($x) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'resolve("subject")'=>'Subject', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','email/view/')), - )) - ->postproc(array( - 'resolve("subject")'=>array('trim'=>45), - )); ?> -
-
+
+ set('o',$o); ?> +
diff --git a/modules/service/views/service/user/view/charges.php b/modules/service/views/service/user/view/charges.php new file mode 100644 index 00000000..15952d54 --- /dev/null +++ b/modules/service/views/service/user/view/charges.php @@ -0,0 +1,12 @@ + +
+ Service Charges to Bill: charges(TRUE,TRUE); ?> + + data($o->charge_list(TRUE)) + ->columns(array( + 'date_orig'=>'Date', + 'description'=>'Description', + 'total(TRUE)'=>'Amount', + )); ?> +
diff --git a/modules/service/views/service/user/view/emails.php b/modules/service/views/service/user/view/emails.php new file mode 100644 index 00000000..1234ae3e --- /dev/null +++ b/modules/service/views/service/user/view/emails.php @@ -0,0 +1,17 @@ +
+ Emails about this service + + data($o->email()->limit(20)->find_all()) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'resolve("subject")'=>'Subject', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','email/view/')), + )) + ->postproc(array( + 'resolve("subject")'=>array('trim'=>45), + )); ?> +
diff --git a/modules/service/views/service/user/view/memos.php b/modules/service/views/service/user/view/memos.php new file mode 100644 index 00000000..382401d3 --- /dev/null +++ b/modules/service/views/service/user/view/memos.php @@ -0,0 +1,13 @@ + +
+ Service Memos + + data($o->service_memo->find_all()) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'account->name()'=>'Account', + 'memo'=>'Memo', + )); ?> +
diff --git a/modules/service/views/service/user/view/payment.php b/modules/service/views/service/user/view/payment.php new file mode 100644 index 00000000..93f17841 --- /dev/null +++ b/modules/service/views/service/user/view/payment.php @@ -0,0 +1,13 @@ + +
+ Automatic Payment Details + +
+
Direct Payment
+
service_billing->checkout->display('name'); ?>
+ service_billing->checkout_amount)) : ?> +
Standard Amount
+
service_billing->display('checkout_amount'); ?>
+ +
+
diff --git a/modules/ssl/classes/Controller/Reseller/Service/Ssl.php b/modules/ssl/classes/Controller/Reseller/Service/Ssl.php index 64da60a7..2553d8d6 100644 --- a/modules/ssl/classes/Controller/Reseller/Service/Ssl.php +++ b/modules/ssl/classes/Controller/Reseller/Service/Ssl.php @@ -10,6 +10,8 @@ * @license http://dev.osbill.net/license.html */ class Controller_Reseller_Service_Ssl extends Controller_Service { + protected $auth_required = TRUE; + protected $secure_actions = array( 'list'=>TRUE, ); diff --git a/modules/ssl/classes/Controller/Reseller/Ssl.php b/modules/ssl/classes/Controller/Reseller/Ssl.php index ca5f4939..f8693f2e 100644 --- a/modules/ssl/classes/Controller/Reseller/Ssl.php +++ b/modules/ssl/classes/Controller/Reseller/Ssl.php @@ -10,6 +10,8 @@ * @license http://dev.osbill.net/license.html */ class Controller_Reseller_SSL extends Controller_SSL { + protected $auth_required = TRUE; + protected $secure_actions = array( 'add'=>TRUE, 'edit'=>TRUE, diff --git a/modules/ssl/classes/Controller/SSL.php b/modules/ssl/classes/Controller/SSL.php deleted file mode 100644 index 6d5a8138..00000000 --- a/modules/ssl/classes/Controller/SSL.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/modules/ssl/classes/Controller/Ssl.php b/modules/ssl/classes/Controller/Ssl.php new file mode 100644 index 00000000..7ffb994a --- /dev/null +++ b/modules/ssl/classes/Controller/Ssl.php @@ -0,0 +1,64 @@ +request->param('id')); + + $this->response->body($o->loaded() ? $o->sign_cert."\n" : NULL); + + $this->response->headers(array('Content-Type' => 'text/plain')); + if ($o->loaded() AND ! is_null($this->request->query('download'))) + $this->response->headers('Content-Disposition','attachment; filename="'.$o->id.'.ca.crt"'); + $this->auto_render = FALSE; + } + + /** + * Render the public certificate of a service + */ + public function action_cert() { + $o = ORM::factory('Service',$this->request->param('id')); + + if ($o->loaded() and ($o->plugin() instanceof Model_Service_Plugin)) + $this->response->body($o->plugin()->cert."\n"); + + $this->response->headers(array('Content-Type' => 'text/plain')); + if ($o->loaded() AND ! is_null($this->request->query('download'))) + $this->response->headers('Content-Disposition','attachment; filename="'.$o->id.'.crt"'); + $this->auto_render = FALSE; + } + + /** + * Render out an SSL CA chain + */ + public function action_chain() { + $result = ''; + + $o = ORM::factory('Service',$this->request->param('id')); + + if ($o->loaded() and $o->plugin() instanceof Model_Service_Plugin_Ssl) { + foreach ($o->plugin()->chain() as $cao) + $result .= $cao->sign_cert."\n"; + } + + $this->response->body($result); + $this->response->headers(array('Content-Type' => 'text/plain')); + if ($o->loaded() AND ! is_null($this->request->query('download'))) + $this->response->headers('Content-Disposition','attachment; filename="ca.crts"'); + $this->auto_render = FALSE; + } +} +?> diff --git a/modules/ssl/classes/Controller/User/Ssl.php b/modules/ssl/classes/Controller/User/Ssl.php index 9bd4d2b6..6afde677 100644 --- a/modules/ssl/classes/Controller/User/Ssl.php +++ b/modules/ssl/classes/Controller/User/Ssl.php @@ -9,9 +9,12 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Controller_User_SSL extends Controller_SSL { +class Controller_User_Ssl extends Controller_Ssl { + protected $auth_required = TRUE; + protected $secure_actions = array( - 'download'=>FALSE, + 'download'=>TRUE, + 'key'=>TRUE, ); public function action_download() { @@ -22,7 +25,7 @@ class Controller_User_SSL extends Controller_SSL { $passwd = $this->request->post('passwd'); - if (strlen($passwd) < Kohana::$config->load('ssl')->minpass_length) { + if (! Auth::instance()->get_user()->isAdmin() AND strlen($passwd) < Kohana::$config->load('ssl')->minpass_length) { SystemMessage::add(array( 'title'=>_('Validation failed'), 'type'=>'error', @@ -50,5 +53,23 @@ class Controller_User_SSL extends Controller_SSL { $this->response->headers('Content-Disposition','attachment; filename="'.basename($file).'"'); $this->response->body($x); } + + /** + * Render the private key of a service + */ + public function action_key() { + $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'); + + if ($so->plugin() instanceof Model_Service_Plugin) + $this->response->body($so->plugin()->pk."\n"); + + $this->response->headers(array('Content-Type' => 'text/plain')); + if ($so->loaded() AND ! is_null($this->request->query('download'))) + $this->response->headers('Content-Disposition','attachment; filename="'.$so->id.'.key"'); + $this->auto_render = FALSE; + } } ?> diff --git a/modules/ssl/classes/Model/Service/Plugin/Ssl.php b/modules/ssl/classes/Model/Service/Plugin/Ssl.php index 28cd78be..e18d5f12 100644 --- a/modules/ssl/classes/Model/Service/Plugin/Ssl.php +++ b/modules/ssl/classes/Model/Service/Plugin/Ssl.php @@ -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 .= '
'; $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 .= '
'; $output .= Form::close(); diff --git a/modules/ssl/classes/SSL.php b/modules/ssl/classes/SSL.php index 5c0c56cf..41bf218a 100644 --- a/modules/ssl/classes/SSL.php +++ b/modules/ssl/classes/SSL.php @@ -108,7 +108,7 @@ class SSL { if ($i++) $result .= ','; - $result .= sprintf('%s=%s',$k,$v); + $result .= sprintf('%s=%s',$k,(is_array($v) ? join(','.$k.'=',$v) : $v)); } return $result; diff --git a/modules/ssl/views/service/admin/plugin/ssl/edit.php b/modules/ssl/views/service/admin/plugin/ssl/edit.php index 74c6000d..bff575f9 100644 --- a/modules/ssl/views/service/admin/plugin/ssl/edit.php +++ b/modules/ssl/views/service/admin/plugin/ssl/edit.php @@ -1,15 +1,7 @@
SSL Certificate Service Details -
- service->plugin()->csr,array('class'=>'span6','label'=>'CSR','placeholder'=>'CSR','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->csr))); ?> -
- -
- service->plugin()->pk,array('class'=>'span6','label'=>'Private Key','placeholder'=>'Private Key','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->pk))); ?> -
- -
- service->plugin()->cert,array('class'=>'span6','label'=>'Public Certificate','placeholder'=>'Public Certificate','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->cert))); ?> -
+ service->plugin()->csr,array('label'=>'CSR','placeholder'=>'CSR','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->csr),'cols'=>Form::textarea_width($o->service->plugin()->csr))); ?> + service->plugin()->pk,array('label'=>'Private Key','placeholder'=>'Private Key','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->pk),'cols'=>Form::textarea_width($o->service->plugin()->pk))); ?> + service->plugin()->cert,array('label'=>'Public Certificate','placeholder'=>'Public Certificate','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->cert),'cols'=>Form::textarea_width($o->service->plugin()->cert))); ?>
diff --git a/modules/ssl/views/service/user/plugin/ssl/view.php b/modules/ssl/views/service/user/plugin/ssl/view.php index 2281f73e..539c8601 100644 --- a/modules/ssl/views/service/user/plugin/ssl/view.php +++ b/modules/ssl/views/service/user/plugin/ssl/view.php @@ -1,62 +1,3 @@ -
-
- Service Details - -
-
DN
-
dn(); ?>
- - isCSR()) : ?> -
Serial Number
-
serial(); ?>
- -
Subject Key Id
-
ski(); ?>
- -
Issuer
-
- validCA() AND $o->authorised($o->ca)) : ?> - ca->id,$o->issuer()); ?> - - issuer(); ?> - -
- -
Issuer Serial
-
aki_keyid(), $o->aki_serial()); ?>
- -
Valid From
-
valid_from(TRUE); ?>
- -
Valid To
-
valid_to(TRUE); ?>
- -
Hash
-
hash(); ?>
- -
Version
-
version(); ?>
- -
Algorithm
-
algorithm(); ?>
- - -
-
-
- -
-
- Certificate - -
cert; ?>
- - download_button(); - if ($ao=Auth::instance()->get_user() AND ($ao->isAdmin() OR $ao->isReseller()) AND $o->service->status AND ($o->valid_to()-(Kohana::$config->load('ssl.min_renew_days')*86400) <= time()) AND $o->service->paid_to() > time()) : - echo Form::open(URL::link('reseller','ssl/renew/'.$o->service->id)); - echo Form::button('submit','Renew',array('class'=>'btn btn-primary')); - endif - ?> -
-
+set('o',$o); ?> +set('o',$o); ?> +set('o',$o); ?> diff --git a/modules/ssl/views/service/user/plugin/ssl/view/certificate.php b/modules/ssl/views/service/user/plugin/ssl/view/certificate.php new file mode 100644 index 00000000..7f56468a --- /dev/null +++ b/modules/ssl/views/service/user/plugin/ssl/view/certificate.php @@ -0,0 +1,18 @@ +
+ Certificate + +
cert; ?>
+ + download_button(); + if ($ao=Auth::instance()->get_user() AND ($ao->isAdmin() OR $ao->isReseller()) AND $o->service->status AND ($o->valid_to()-(Kohana::$config->load('ssl.min_renew_days')*86400) <= time()) AND $o->service->paid_to() > time()) : + echo Form::open(URL::link('reseller','ssl/renew/'.$o->service->id)); + echo Form::button('submit','Renew',array('class'=>'btn btn-primary','nocg'=>TRUE)); + else : ?> + Cert Download + pk) : ?> + Key Download + + +
diff --git a/modules/ssl/views/service/user/plugin/ssl/view/chain.php b/modules/ssl/views/service/user/plugin/ssl/view/chain.php new file mode 100644 index 00000000..b64a867f --- /dev/null +++ b/modules/ssl/views/service/user/plugin/ssl/view/chain.php @@ -0,0 +1,20 @@ +cert) : ?> +
+ Certificate Chain + + data($o->chain()) + ->columns(array( + 'id'=>'ID', + 'subject()'=>'Cert', + 'valid_to(TRUE)'=>'Expires', + 'issuer()'=>'Issuer', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('','/ssl/ca/')), + )); ?> + + Download +
+ + diff --git a/modules/ssl/views/service/user/plugin/ssl/view/details.php b/modules/ssl/views/service/user/plugin/ssl/view/details.php new file mode 100644 index 00000000..97200713 --- /dev/null +++ b/modules/ssl/views/service/user/plugin/ssl/view/details.php @@ -0,0 +1,44 @@ +
+ Service Details + +
+
DN
+
dn(); ?>
+ + isCSR()) : ?> +
Serial Number
+
serial(); ?>
+ +
Subject Key Id
+
ski(); ?>
+ +
Issuer
+
+ validCA() AND $o->authorised($o->ca)) : ?> + ca->id,$o->issuer()); ?> + + issuer(); ?> + +
+ +
Issuer Serial
+
aki_keyid(), $o->aki_serial()); ?>
+ +
Valid From
+
valid_from(TRUE); ?>
+ +
Valid To
+
valid_to(TRUE); ?>
+ +
Hash
+
hash(); ?>
+ +
Version
+
version(); ?>
+ +
Algorithm
+
algorithm(); ?>
+ + +
+