diff --git a/application/bootstrap.php b/application/bootstrap.php index de02b7d5..d0d0927c 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -152,8 +152,8 @@ Route::set('default', '((/(/)))', array('id' => '[a-zA-Z /** * If APC is enabled, and we need to clear the cache */ -if (file_exists(APPPATH.'CLEAR_APC_CACHE') AND function_exists('apc_clear_cache') AND ! Kohana::$is_cli) { - if (! apc_clear_cache() OR ! unlink(APPPATH.'CLEAR_APC_CACHE')) +if (file_exists(APPPATH.'cache/CLEAR_APC_CACHE') AND function_exists('apc_clear_cache') AND ! Kohana::$is_cli) { + if (! apc_clear_cache() OR ! unlink(APPPATH.'cache/CLEAR_APC_CACHE')) throw new Kohana_Exception('Unable to clear the APC cache.'); } ?> diff --git a/modules/adsl/classes/model/service/plugin/adsl/traffic.php b/modules/adsl/classes/model/service/plugin/adsl/traffic.php index fe859ba8..cc626224 100644 --- a/modules/adsl/classes/model/service/plugin/adsl/traffic.php +++ b/modules/adsl/classes/model/service/plugin/adsl/traffic.php @@ -19,11 +19,12 @@ class Model_Service_Plugin_ADSL_Traffic extends ORMOSB { protected $_updated_column = FALSE; public function rules() { - return array( - 'site_id'=>array( - array('ORMOSB::set_site_id',array(':validation',':model',':field')), - ), - ); + $result = parent::rules(); + + // We don use the "ID" field. + unset($result['id']); + + return $result; } public function traffic(Model_Product_Plugin_ADSL $plan) { diff --git a/modules/domain/classes/model/service/plugin/domain.php b/modules/domain/classes/model/service/plugin/domain.php index 8a0d2077..2ca5e67d 100644 --- a/modules/domain/classes/model/service/plugin/domain.php +++ b/modules/domain/classes/model/service/plugin/domain.php @@ -74,7 +74,8 @@ class Model_Service_Plugin_Domain extends Model_Service_Plugin { * to manage the domain. */ public function manage_button($t='') { - parent::manage_button($t); + if (! parent::manage_button($t)) + return NULL; return ($this->username_value() AND $this->password_value()) ? $this->domain_registrar->manage_button($this,$t) : _('Please contact us'); } diff --git a/modules/host/classes/model/service/plugin/host.php b/modules/host/classes/model/service/plugin/host.php index 54efbeef..88792c30 100644 --- a/modules/host/classes/model/service/plugin/host.php +++ b/modules/host/classes/model/service/plugin/host.php @@ -67,7 +67,8 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin { * to manage the domain. */ public function manage_button($t='') { - parent::manage_button($t); + if (! parent::manage_button($t)) + return NULL; // @todo Convert this to a Static_List display if ($this->service->queue == 'PROVISION') diff --git a/modules/service/classes/model/service/plugin.php b/modules/service/classes/model/service/plugin.php index a2ca69d1..84917420 100644 --- a/modules/service/classes/model/service/plugin.php +++ b/modules/service/classes/model/service/plugin.php @@ -48,11 +48,14 @@ abstract class Model_Service_Plugin extends ORMOSB { abstract public function password_value(); public function manage_button() { + if (! $this->service->status) + return FALSE; + static $k = ''; // If $k is already set, we've rendered this JS if ($k) - return; + return TRUE; $k = Random::char(); Session::instance()->set('manage_button',$k); @@ -70,6 +73,8 @@ function() { $("form[id=id_"+t[0]+"_"+t[1]+"]").submit(); }); }); });' )); + + return TRUE; } /** diff --git a/modules/ssl/classes/controller/admin/ssl.php b/modules/ssl/classes/controller/admin/ssl.php index 1e3e0995..65bee3a6 100644 --- a/modules/ssl/classes/controller/admin/ssl.php +++ b/modules/ssl/classes/controller/admin/ssl.php @@ -73,6 +73,24 @@ class Controller_Admin_SSL extends Controller_TemplateDefault_Admin { 'title'=>sprintf('%s: %s (%s)',_('View SSL CA Certificate'),$id,ORM::factory('ssl_ca',$id)->display('sign_cert')), 'body'=>$this->add_view($id,$output), )); + + Block::add(array( + 'title'=>_('Services using this Certificate'), + 'body'=>Table::display( + ORM::factory('ssl_ca',$id)->list_issued(), + 25, + array( + 'id'=>array('label'=>'ID','url'=>'admin/service/view/'), + 'plugin()->dn()'=>array('label'=>'Cert'), + 'plugin()->valid_to(TRUE)'=>array('label'=>'Expires'), + ), + array( + 'page'=>TRUE, + 'type'=>'select', + 'form'=>'admin/service/view', + )), + )); + } } ?> diff --git a/modules/ssl/classes/model/ssl/ca.php b/modules/ssl/classes/model/ssl/ca.php index a40a5330..6ef48885 100644 --- a/modules/ssl/classes/model/ssl/ca.php +++ b/modules/ssl/classes/model/ssl/ca.php @@ -17,7 +17,8 @@ class Model_SSL_CA extends ORMOSB { protected $_belongs_to = array( ); - protected $_has_one = array( + protected $_has_many = array( + 'service'=>array('through'=>'service__ssl'), ); protected $_display_filters = array( @@ -65,5 +66,9 @@ class Model_SSL_CA extends ORMOSB { // Save the record return parent::save($validation); } + + public function list_issued() { + return $this->service->find_all(); + } } ?>