diff --git a/application/classes/ORM.php b/application/classes/ORM.php
index 74051ba2..a9d12416 100644
--- a/application/classes/ORM.php
+++ b/application/classes/ORM.php
@@ -26,6 +26,8 @@ abstract class ORM extends lnApp_ORM {
$this->where($this->_object_name.'.site_id','=',Company::instance()->site());
// Ensure we Cache our queries
+ // @todo: Disabled as it is not working as expected
+/*
$caching = FALSE;
foreach ($this->_db_pending as $method)
if ($method['name'] == 'cached') {
@@ -35,6 +37,7 @@ abstract class ORM extends lnApp_ORM {
if (! $caching)
$this->cached(Kohana::$config->load('cache.orm.'.$this->_table_name));
+*/
return parent::_build($type);
}
diff --git a/modules/adsl/classes/Adsl/Billing/Exetelvisp.php b/modules/adsl/classes/Adsl/Billing/Exetelvisp.php
index 33ac71fe..2f12b831 100644
--- a/modules/adsl/classes/Adsl/Billing/Exetelvisp.php
+++ b/modules/adsl/classes/Adsl/Billing/Exetelvisp.php
@@ -128,7 +128,7 @@ class ADSL_Billing_Exetelvisp {
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
$result[$service]['credit'] = str_replace('$','',$record[6]);
- } elseif (preg_match('/Excess usage charges for /',$record[3])) {
+ } elseif (preg_match('/Excess usage charges/',$record[3])) {
list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$record[3])));
$result[$service]['excess'] = str_replace('$','',$record[7]);
diff --git a/modules/charge/classes/Model/Charge.php b/modules/charge/classes/Model/Charge.php
index 89650a26..a09ed026 100644
--- a/modules/charge/classes/Model/Charge.php
+++ b/modules/charge/classes/Model/Charge.php
@@ -19,6 +19,10 @@ class Model_Charge extends ORM_OSB implements Invoicable {
'invoice_item'=>array('far_key'=>'id'),
);
+ protected $_compress_column = array(
+ 'attributes',
+ );
+
protected $_nullifempty = array(
'attributes',
);
diff --git a/modules/domain/views/service/user/plugin/domain/view.php b/modules/domain/views/service/user/plugin/domain/view.php
index 50bc859f..fd61b6fd 100644
--- a/modules/domain/views/service/user/plugin/domain/view.php
+++ b/modules/domain/views/service/user/plugin/domain/view.php
@@ -27,6 +27,8 @@
registrar->whitelabel_url,NULL); ?>
Username
registrar_username; ?>
+ Password
+ registrar_password; ?>
diff --git a/modules/host/views/service/user/plugin/host/view.php b/modules/host/views/service/user/plugin/host/view.php
index b4d0e886..c522d40c 100644
--- a/modules/host/views/service/user/plugin/host/view.php
+++ b/modules/host/views/service/user/plugin/host/view.php
@@ -19,6 +19,8 @@
host->whitelabel_url,NULL); ?>
Username
host_username; ?>
+ Password
+ host_password; ?>
diff --git a/modules/invoice/classes/Model/Invoice.php b/modules/invoice/classes/Model/Invoice.php
index 9dd18865..e3072e08 100644
--- a/modules/invoice/classes/Model/Invoice.php
+++ b/modules/invoice/classes/Model/Invoice.php
@@ -222,9 +222,10 @@ class Model_Invoice extends ORM_OSB implements Cartable {
* Check the reminder value
*/
public function remind($key) {
- if (isset($this->reminders[$key]))
- return (is_array($this->reminders[$key])) ? end($this->reminders[$key]) : $this->reminders[$key];
- else
+ if (isset($this->reminders[$key])) {
+ $x = $this->reminders[$key];
+ return is_array($x) ? end($x) : $x;
+ } else
return FALSE;
}
diff --git a/modules/ssl/classes/Controller/Reseller/Ssl.php b/modules/ssl/classes/Controller/Reseller/Ssl.php
index d133853d..ca5f4939 100644
--- a/modules/ssl/classes/Controller/Reseller/Ssl.php
+++ b/modules/ssl/classes/Controller/Reseller/Ssl.php
@@ -20,12 +20,16 @@ class Controller_Reseller_SSL extends Controller_SSL {
);
public function action_list() {
+ $o = ORM::factory('SSL_CA')->where_authorised($this->ao);
+ if ($this->request->param('id') != 'Y')
+ $o->where_active();
+
Block::factory()
->title('SSL CA Certificates')
->title_icon('icon-th-list')
->body(Table::factory()
->jssort('ca')
- ->data(ORM::factory('SSL_CA')->where_authorised($this->ao)->where_active()->find_all())
+ ->data($o->find_all())
->columns(array(
'id'=>'ID',
'sign_cert'=>'Cert',
diff --git a/modules/ssl/classes/Model/Service/Plugin/Ssl.php b/modules/ssl/classes/Model/Service/Plugin/Ssl.php
index 0cd248fe..a123da88 100644
--- a/modules/ssl/classes/Model/Service/Plugin/Ssl.php
+++ b/modules/ssl/classes/Model/Service/Plugin/Ssl.php
@@ -56,8 +56,12 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
public function __call($name,$args) {
$m = 'get_'.$name;
- if (method_exists($this->_so,$m))
+ if ($this->isCSR() AND method_exists($this,$m))
+ return $this->{$m}($args);
+
+ elseif (method_exists($this->_so,$m))
return $this->_so->{$m}($args);
+
else
throw new Kohana_Exception('Unknown method :method',array(':method'=>$name));
}
@@ -72,6 +76,13 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
return $this;
}
+ /**
+ * Is this just a CSR?
+ */
+ public function isCSR() {
+ return ! $this->cert AND $this->csr;
+ }
+
/**
* Return all our CA Certs for this certificate
*/
@@ -103,16 +114,32 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
return $output;
}
+ public function get_dn() {
+ return SSL::csrsubject($this->csr);
+ }
+
+ public function get_valid_to() {
+ // @todo
+ return 'Unknown';
+ }
+
/**
* Renew an SSL Certificate
*/
+ // @todo: Renew renews the expiry date as 1 day too early.
public function renew($force=FALSE) {
- $sslo = SSL::instance($this->cert);
$ssl_conf = Kohana::$config->load('ssl');
- // If our certificate is not old enough skip
- if ($sslo->get_valid_to() > time()+$ssl_conf['min_renew_days']*86400 AND ! $force)
- return FALSE;
+ if ($this->cert) {
+ $sslo = SSL::instance($this->cert);
+
+ // If our certificate is not old enough skip
+ if ($sslo->get_valid_to() > time()+$ssl_conf['min_renew_days']*86400 AND ! $force)
+ return FALSE;
+
+ } elseif (! $this->csr) {
+ throw new Kohana_Exception('Unable to renew, no CERT or CSR');
+ }
$today = mktime(0,0,0,date('n'),date('j'),date('Y'));
$days = (int)(($this->service->invoiced_to()-$today)/86400);
diff --git a/modules/ssl/classes/SSL.php b/modules/ssl/classes/SSL.php
index a7527b64..147512cb 100644
--- a/modules/ssl/classes/SSL.php
+++ b/modules/ssl/classes/SSL.php
@@ -28,7 +28,7 @@ class SSL {
private static function _dec_to_hex($number) {
$hex = array();
- if ($number == 0)
+ if ($number == 0 OR ! $number)
return '00';
while ($number > 0) {
diff --git a/modules/ssl/views/service/user/plugin/ssl/view.php b/modules/ssl/views/service/user/plugin/ssl/view.php
index def554ba..2281f73e 100644
--- a/modules/ssl/views/service/user/plugin/ssl/view.php
+++ b/modules/ssl/views/service/user/plugin/ssl/view.php
@@ -6,38 +6,40 @@
DN
dn(); ?>
- Serial Number
- serial(); ?>
+ isCSR()) : ?>
+ Serial Number
+ serial(); ?>
- Subject Key Id
- ski(); ?>
+ Subject Key Id
+ ski(); ?>
- Issuer
-
- validCA() AND $o->authorised($o->ca)) : ?>
- ca->id,$o->issuer()); ?>
-
- issuer(); ?>
-
-
+ Issuer
+
+ validCA() AND $o->authorised($o->ca)) : ?>
+ ca->id,$o->issuer()); ?>
+
+ issuer(); ?>
+
+
- Issuer Serial
- aki_keyid(), $o->aki_serial()); ?>
+ Issuer Serial
+ aki_keyid(), $o->aki_serial()); ?>
- Valid From
- valid_from(TRUE); ?>
+ Valid From
+ valid_from(TRUE); ?>
- Valid To
- valid_to(TRUE); ?>
+ Valid To
+ valid_to(TRUE); ?>
- Hash
- hash(); ?>
+ Hash
+ hash(); ?>
- Version
- version(); ?>
+ Version
+ version(); ?>
- Algorithm
- algorithm(); ?>
+ Algorithm
+ algorithm(); ?>
+