+
+ subject,array(
+ 'label'=>'Email Subject',
+ 'placeholder'=>'Email Subject',
+ 'class'=>'span8',
+ 'required',
+ 'help-block'=>sprintf('This is the subject line on the email. Uses variables: %s',implode(', ',array_values($o->variables('subject')))))); ?>
+
+
+ message_text,array(
+ 'label'=>'Message Text',
+ 'placeholder'=>'Message Text',
+ 'class'=>'span8',
+ 'required',
+ 'help-block'=>sprintf('The message in plain text that is used in the email for email clients that cannot render HTML. Uses variables: %s',implode(', ',array_values($o->variables('message_text')))))); ?>
+
+
+ message_html,array(
+ 'label'=>'Message HTML',
+ 'placeholder'=>'Message HTML',
+ 'class'=>'span8',
+ 'required',
+ 'editor'=>'tinymce',
+ 'help-block'=>sprintf('The message in HTML that is used in the email. Uses variables: %s',implode(', ',array_values($o->variables('message_html')))))); ?>'
+
+
+
+render_all(); ?>
+render_all(); ?>
diff --git a/modules/email/views/email/admin/templateadd.php b/modules/email/views/email/admin/templateadd.php
deleted file mode 100644
index 2bf0fc33..00000000
--- a/modules/email/views/email/admin/templateadd.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- Template
- Active
-
diff --git a/modules/email/views/email/user/view.php b/modules/email/views/email/user/view.php
index 40fcabd4..db7168e9 100644
--- a/modules/email/views/email/user/view.php
+++ b/modules/email/views/email/user/view.php
@@ -1,20 +1,32 @@
-
-
- To: account->name(),$elo->display('email')); ?>
-
-
- Date: display('date_orig'); ?>
-
-
- Subject: translate_resolve('subject'); ?>
-
-
-
-
-
- translate_resolve('message_html'); ?>
-
-
-
-
-
+
+
+
+
+
+ To:
+ account->name(),$elo->display('email')); ?>
+
+
+ Date:
+ display('date_orig'); ?>
+
+
+ Subject:
+ resolve('subject'); ?>
+
+
+
+
+
+
+
+
+ resolve('message_html'); ?>
+
+
+
+
+
+
+
+
diff --git a/modules/export/classes/Controller/Admin/Export.php b/modules/export/classes/Controller/Admin/Export.php
index 05a9cb1e..08a50772 100644
--- a/modules/export/classes/Controller/Admin/Export.php
+++ b/modules/export/classes/Controller/Admin/Export.php
@@ -25,16 +25,10 @@ class Controller_Admin_Export extends Controller_Export {
$edo = ORM::factory('Export_DataMap');
- if ($_POST AND isset($_POST['item_id']) AND $edo->values($_POST)->check()) {
+ if ($_POST AND isset($_POST['item_id']) AND $edo->values($_POST)->changed()) {
$edo->status = 1;
- if (! $edo->save())
- throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($_POST)));
-
- SystemMessage::factory()
- ->title('Record added')
- ->type('success')
- ->body(_('Export DataMap record has been added.'));
+ $this->save($edo);
}
Block::factory()
@@ -87,16 +81,8 @@ class Controller_Admin_Export extends Controller_Export {
if ($_POST AND isset($_POST['export_module_id'])) {
$emo = ORM::factory('Export_Module',$_POST['export_module_id']);
- if ($emo->loaded()) {
- $emo->values($_POST);
- $emo->save();
-
- if ($emo->saved())
- SystemMessage::factory()
- ->title('Record updated')
- ->type('success')
- ->body(_('Export Module record has been updated.'));
- }
+ if ($emo->loaded() AND $emo->values($_POST)->changed() AND ! $this->save($emo))
+ $emo->reload();
}
if ($x = $this->request->param('id')) {
diff --git a/modules/highchart b/modules/highchart
index 9ed797b1..4bd8d1ff 160000
--- a/modules/highchart
+++ b/modules/highchart
@@ -1 +1 @@
-Subproject commit 9ed797b1d2e9a2b3b8227bbb42be01ea620916d4
+Subproject commit 4bd8d1ffae3d89ee85de63e1a80a3d7aeb7b0fa5
diff --git a/modules/invoice/classes/Controller/User/Invoice.php b/modules/invoice/classes/Controller/User/Invoice.php
index 340c2896..e6c75969 100644
--- a/modules/invoice/classes/Controller/User/Invoice.php
+++ b/modules/invoice/classes/Controller/User/Invoice.php
@@ -22,6 +22,9 @@ class Controller_User_Invoice extends Controller_Invoice {
public function action_download() {
$io = ORM::factory('Invoice',$this->request->param('id'));
+ if (! $io->loaded() OR ! Auth::instance()->authorised($io->account))
+ throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it');
+
// Log the download
$imo = $io->invoice_memo;
$imo->invoice_id = $io->id;
diff --git a/modules/invoice/classes/Model/Invoice.php b/modules/invoice/classes/Model/Invoice.php
index 532289ef..c2ac392c 100644
--- a/modules/invoice/classes/Model/Invoice.php
+++ b/modules/invoice/classes/Model/Invoice.php
@@ -215,7 +215,6 @@ class Model_Invoice extends ORM_OSB implements Cartable {
return $format ? Currency::display($result) : $result;
}
-//ZZ
/**
* Return a list of valid checkout options for this invoice
*/
@@ -508,11 +507,6 @@ class Model_Invoice extends ORM_OSB implements Cartable {
if (! $iio->changed())
continue;
- if (! $iio->check()) {
- // @todo Mark invoice as cancelled and write a memo, then...
- throw new Kohana_Exception('Problem saving invoice_item for invoice :invoice - Failed check()',array(':invoice'=>$this->id));
- }
-
$iio->save();
if (! $iio->saved()) {
@@ -548,7 +542,7 @@ class Model_Invoice extends ORM_OSB implements Cartable {
} else
throw new Kohana_Exception('Couldnt save invoice for some reason?');
- return TRUE;
+ return $this;
}
public function set_remind($key,$value,$add=FALSE) {
diff --git a/modules/invoice/classes/Model/Invoice/Item.php b/modules/invoice/classes/Model/Invoice/Item.php
index c485b8f0..8cd1c51e 100644
--- a/modules/invoice/classes/Model/Invoice/Item.php
+++ b/modules/invoice/classes/Model/Invoice/Item.php
@@ -188,9 +188,6 @@ class Model_Invoice_Item extends ORM_OSB {
}
public function save(Validation $validation = NULL) {
- if (! $this->changed())
- return;
-
// Save the invoice item
parent::save($validation);
@@ -214,9 +211,6 @@ class Model_Invoice_Item extends ORM_OSB {
// @todo Rounding here should come from a global config
$iito->amount = round($tax['amount'],2);
- if (! $iito->check())
- throw new Kohana_Exception('Couldnt save tax for some reason - failed check()?');
-
$iito->save();
if (! $iito->saved())
@@ -224,6 +218,8 @@ class Model_Invoice_Item extends ORM_OSB {
}
} else
throw new Kohana_Exception('Couldnt save invoice_item for some reason?');
+
+ return $this;
}
}
?>
diff --git a/modules/lnApp b/modules/lnApp
index 610c223c..1ec370f0 160000
--- a/modules/lnApp
+++ b/modules/lnApp
@@ -1 +1 @@
-Subproject commit 610c223cb823f2b16df3e1f49912e8ef42dc6bd7
+Subproject commit 1ec370f07af319e5deda43dce6585ad9e0240c18
diff --git a/modules/payment/classes/Controller/Admin/Payment.php b/modules/payment/classes/Controller/Admin/Payment.php
index a49378c2..b5a5f976 100644
--- a/modules/payment/classes/Controller/Admin/Payment.php
+++ b/modules/payment/classes/Controller/Admin/Payment.php
@@ -96,12 +96,7 @@ class Controller_Admin_Payment extends Controller_Payment {
$pio->alloc_amt = is_numeric($v) ? $v : 0;
}
- // Entry updated
- if ($po->values($_POST)->check() AND $po->save())
- SystemMessage::factory()
- ->title('Record updated')
- ->type('success')
- ->body(_('Your Payment record has been recorded/updated.'));
+ $this->save($po);
}
Script::factory()
diff --git a/modules/payment/classes/Model/Payment.php b/modules/payment/classes/Model/Payment.php
index ca601698..746a345c 100644
--- a/modules/payment/classes/Model/Payment.php
+++ b/modules/payment/classes/Model/Payment.php
@@ -200,7 +200,7 @@ class Model_Payment extends ORM_OSB {
throw HTTP_Exception::factory(501,'Problem saving payment :id - Failed save()',array(':id'=>$this->id));
}
- return TRUE;
+ return $this;
}
/**
diff --git a/modules/product/classes/Controller/Admin/Product.php b/modules/product/classes/Controller/Admin/Product.php
index 4317000b..be1bd2b9 100644
--- a/modules/product/classes/Controller/Admin/Product.php
+++ b/modules/product/classes/Controller/Admin/Product.php
@@ -65,8 +65,8 @@ class Controller_Admin_Product extends Controller_Product {
if (! $pco->loaded())
HTTP::redirect(URL::link('admin','product/list'));
- if ($_POST)
- $pco->values($_POST)->save();
+ if ($_POST AND $pco->values($_POST)->changed() AND (! $this->save($pco)))
+ $pco->reload();
Script::factory()
->type('stdin')
@@ -113,8 +113,8 @@ $(document).ready(function() {
if (! $po->loaded())
HTTP::redirect('welcome/index');
- if ($_POST)
- $po->values($_POST)->save();
+ if ($_POST AND $po->values($_POST)->changed() AND (! $this->save($po)))
+ $po->reload();
Script::factory()
->type('stdin')
diff --git a/modules/product/classes/Model/Product.php b/modules/product/classes/Model/Product.php
index d5e0d73c..67e5ca5b 100644
--- a/modules/product/classes/Model/Product.php
+++ b/modules/product/classes/Model/Product.php
@@ -14,9 +14,9 @@
*/
class Model_Product extends ORM_OSB {
protected $_has_many = array(
- 'product_translate'=>array('far_key'=>'id'),
- 'service'=>array('far_key'=>'id'),
'invoice'=>array('through'=>'invoice_item'),
+ 'service'=>array('far_key'=>'id'),
+ 'translate'=>array('model'=>'Product_Translate','far_key'=>'id'),
);
protected $_sorting = array(
@@ -44,6 +44,8 @@ class Model_Product extends ORM_OSB {
'price_group',
);
+ protected $_save_message = TRUE;
+
/**
* Which categories is this product available in
*/
@@ -106,29 +108,22 @@ class Model_Product extends ORM_OSB {
}
public function save(Validation $validation=NULL) {
- if ($this->changed())
- if (parent::save($validation))
- SystemMessage::factory()
- ->title('Record Updated')
- ->type('success')
- ->body(sprintf('Record %s Updated',$this->id));
+ parent::save($validation);
// Save our Translated Message
- if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['product_translate']) AND is_array($_POST['product_translate'])) {
- $pto = $this->product_translate->where('language_id','=',$_POST['language_id'])->find();
+ if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['translate']) AND is_array($_POST['translate'])) {
+ $to = $this->translate->where('language_id','=',$_POST['language_id'])->find();
// For a new entry, we need to set the product_id
- if (! $pto->loaded()) {
- $pto->product_id = $this->id;
- $pto->language_id = $_POST['language_id'];
+ if (! $to->loaded()) {
+ $to->product_id = $this->id;
+ $to->language_id = $_POST['language_id'];
}
- if ($pto->values($x['product_translate'])->save())
- SystemMessage::factory()
- ->title('Record Updated')
- ->type('success')
- ->body(sprintf('Translation for Record %s Updated',$this->id));
+ $to->values($x['translate'])->save();
}
+
+ return $this;
}
/**
@@ -143,7 +138,7 @@ class Model_Product extends ORM_OSB {
}
private function translate() {
- return $this->product_translate->where('language_id','=',Config::language())->find();
+ return $this->translate->where('language_id','=',Config::language())->find();
}
/**
diff --git a/modules/product/classes/Model/Product/Category.php b/modules/product/classes/Model/Product/Category.php
index cda202c2..154cce6c 100644
--- a/modules/product/classes/Model/Product/Category.php
+++ b/modules/product/classes/Model/Product/Category.php
@@ -20,14 +20,16 @@ class Model_Product_Category extends ORM_OSB {
);
protected $_has_many = array(
- 'product_category_translate'=>array('foreign_key'=>'product_cat_id','far_key'=>'id'),
'subcategories'=>array('model'=>'product_category','foreign_key'=>'parent_id','far_key'=>'id'),
+ 'translate'=>array('model'=>'Product_Category_Translate','foreign_key'=>'product_cat_id','far_key'=>'id'),
);
protected $_sorting = array(
'position'=>'ASC',
);
+ protected $_save_message = TRUE;
+
/**
* Return the translated description for a category.
*/
@@ -51,29 +53,22 @@ class Model_Product_Category extends ORM_OSB {
}
public function save(Validation $validation=NULL) {
- if ($this->changed())
- if (parent::save($validation))
- SystemMessage::factory()
- ->title('Record Updated')
- ->type('success')
- ->body(sprintf('Record %s Updated',$this->id));
+ parent::save($validation);
// Save our Translated Message
- if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['product_category_translate']) AND is_array($_POST['product_category_translate'])) {
- $pcto = $this->product_category_translate->where('language_id','=',$_POST['language_id'])->find();
+ if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['translate']) AND is_array($_POST['translate'])) {
+ $to = $this->translate->where('language_id','=',$_POST['language_id'])->find();
// For a new entry, we need to set the product_cat_id
- if (! $pcto->loaded()) {
- $pcto->product_cat_id = $this->id;
- $pcto->language_id = $_POST['language_id'];
+ if (! $to->loaded()) {
+ $to->product_cat_id = $this->id;
+ $to->language_id = $_POST['language_id'];
}
- if ($pcto->values($x['product_category_translate'])->save())
- SystemMessage::factory()
- ->title('Record Updated')
- ->type('success')
- ->body(sprintf('Translation for Record %s Updated',$this->id));
+ $to->values($x['translate'])->save();
}
+
+ return $this;
}
/**
@@ -111,7 +106,7 @@ class Model_Product_Category extends ORM_OSB {
private function translate() {
- return $this->product_category_translate->where('language_id','=',Config::language())->find();
+ return $this->translate->where('language_id','=',Config::language())->find();
}
}
?>
diff --git a/modules/product/classes/Model/Product/Category/Translate.php b/modules/product/classes/Model/Product/Category/Translate.php
index 24ec4c22..fe3c8781 100644
--- a/modules/product/classes/Model/Product/Category/Translate.php
+++ b/modules/product/classes/Model/Product/Category/Translate.php
@@ -17,5 +17,7 @@ class Model_Product_Category_Translate extends ORM_OSB {
protected $_belongs_to = array(
'product_category'=>array(),
);
+
+ protected $_save_message = TRUE;
}
?>
diff --git a/modules/product/classes/Model/Product/Translate.php b/modules/product/classes/Model/Product/Translate.php
index 27193d5a..35f55cc8 100644
--- a/modules/product/classes/Model/Product/Translate.php
+++ b/modules/product/classes/Model/Product/Translate.php
@@ -16,5 +16,7 @@ class Model_Product_Translate extends ORM_OSB {
protected $_belongs_to = array(
'product'=>array(),
);
+
+ protected $_save_message = TRUE;
}
?>
diff --git a/modules/product/views/product/admin/ajaxtranslate.php b/modules/product/views/product/admin/ajaxtranslate.php
index 1bbb03fb..952e96d6 100644
--- a/modules/product/views/product/admin/ajaxtranslate.php
+++ b/modules/product/views/product/admin/ajaxtranslate.php
@@ -1,6 +1,6 @@
- name,array(
+ name,array(
'label'=>'Category Title',
'placeholder'=>'Descriptive Title',
'class'=>'span3',
@@ -8,20 +8,24 @@
'help-block'=>'The title is shown when uses search products by category')); ?>
- description_short,array(
+ description_short,array(
'label'=>'Short Product Description',
'placeholder'=>'Short Description',
'class'=>'span6',
'required',
+ 'editor'=>'wysihtml5',
'help-block'=>'Complete description of this category')); ?>
- description_full,array(
+ description_full,array(
'label'=>'Full Product Description',
'placeholder'=>'Full Description',
'class'=>'span6',
'required',
+ 'editor'=>'wysihtml5',
'help-block'=>'Complete description of this category')); ?>
+
+render_all(); ?>
render_all(); ?>
diff --git a/modules/product/views/product/category/admin/ajaxtranslate.php b/modules/product/views/product/category/admin/ajaxtranslate.php
index fa621ea1..b0ae3d22 100644
--- a/modules/product/views/product/category/admin/ajaxtranslate.php
+++ b/modules/product/views/product/category/admin/ajaxtranslate.php
@@ -1,6 +1,6 @@
- name,array(
+ name,array(
'label'=>'Category Title',
'placeholder'=>'Descriptive Title',
'class'=>'span3',
@@ -8,12 +8,15 @@
'help-block'=>'The title is shown when uses search products by category')); ?>
- description,array(
+ description,array(
'label'=>'Category Description',
'placeholder'=>'Description',
'class'=>'span6',
'required',
+ 'editor'=>'wysihtml5',
'help-block'=>'Complete description of this category')); ?>
+
+render_all(); ?>
render_all(); ?>
diff --git a/modules/service/classes/Controller/Admin/Service.php b/modules/service/classes/Controller/Admin/Service.php
index 6c7fe3cf..30a53e7f 100644
--- a/modules/service/classes/Controller/Admin/Service.php
+++ b/modules/service/classes/Controller/Admin/Service.php
@@ -127,46 +127,12 @@ class Controller_Admin_Service extends Controller_Service {
if (isset($_POST['plugin']) AND $_POST['plugin']) {
$p = $so->plugin();
- if ($p->values($_POST['plugin'])->changed() AND $p->check()) {
- try {
- $p->values($_POST['plugin'])->save();
- SystemMessage::factory()
- ->title('Record PLUGIN updated')
- ->type('success')
- ->body(_('Your Charge record has been recorded/updated.'));
-
- } catch (ORM_Validation_Exception $e) {
- $errors = $e->errors('models');
-
- SystemMessage::factory()
- ->title('Record PLUGIN NOT updated')
- ->type('error')
- ->body(join(' ',array_values($errors)));
-
- $so->reload();
- }
- }
+ if ($p->values($_POST['plugin'])->changed() AND ! $this->save($p))
+ $p->reload();
}
- if ($so->values($_POST)->changed() AND $so->check()) {
- try {
- $so->values($_POST)->save();
- SystemMessage::factory()
- ->title('Record updated')
- ->type('success')
- ->body(_('Your Charge record has been recorded/updated.'));
-
- } catch (ORM_Validation_Exception $e) {
- $errors = $e->errors('models');
-
- SystemMessage::factory()
- ->title('Record NOT updated')
- ->type('error')
- ->body(join(' ',array_values($errors)));
-
- $so->reload();
- }
- }
+ if ($so->values($_POST)->changed() AND ! $this->save($so))
+ $so->reload();
}
Script::factory()
@@ -211,10 +177,8 @@ $(document).ready(function() {
$so = ORM::factory('Service',$id);
- if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) {
- $this->template->content = 'Unauthorised or doesnt exist?';
- return FALSE;
- }
+ 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');
$doutput = $loutput = '';
diff --git a/modules/service/classes/Model/Service.php b/modules/service/classes/Model/Service.php
index 82b7ad97..9a3468f1 100644
--- a/modules/service/classes/Model/Service.php
+++ b/modules/service/classes/Model/Service.php
@@ -91,6 +91,12 @@ class Model_Service extends ORM_OSB {
return $format ? Currency::display($total) : $total;
}
+ public function email() {
+ return ORM::factory('Email_Log')
+ ->where('module_id','=',$this->mid())
+ ->where('module_data','=',$this);
+ }
+
/**
* When does this service expire
*/
diff --git a/modules/service/views/service/user/view.php b/modules/service/views/service/user/view.php
index 2cec255b..5518596d 100644
--- a/modules/service/views/service/user/view.php
+++ b/modules/service/views/service/user/view.php
@@ -109,3 +109,24 @@
+
+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),
+ )); ?>
+
+
+
diff --git a/modules/ssl/classes/Controller/Reseller/Ssl.php b/modules/ssl/classes/Controller/Reseller/Ssl.php
index c6fed9b4..fea423d1 100644
--- a/modules/ssl/classes/Controller/Reseller/Ssl.php
+++ b/modules/ssl/classes/Controller/Reseller/Ssl.php
@@ -116,44 +116,19 @@ class Controller_Reseller_SSL extends Controller_SSL {
public function action_renew() {
$so = ORM::factory('Service',Request::current()->param('id'));
- if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) {
- SystemMessage::factory()
- ->title('SSL Certificate not updated')
- ->type('error')
- ->body('Either the Service doesnt exist, or you are not authorised to see it');
-
- HTTP::redirect('welcome');
- }
+ 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');
$so->plugin()->renew();
+
HTTP::redirect(URL::link('user','service/view/'.$so->id));
}
private function add_edit($id=NULL,$output='') {
$sco = ORM::factory('SSL_CA',$id);
- if ($_POST) {
- // Entry updated
- if ($sco->values($_POST)->check()) {
- try {
- $sco->save();
- SystemMessage::factory()
- ->title('Record updated')
- ->type('success')
- ->body(_('Your Charge record has been recorded/updated.'));
-
- } catch (ORM_Validation_Exception $e) {
- $errors = $e->errors('models');
-
- SystemMessage::factory()
- ->title('Record NOT updated')
- ->type('error')
- ->body(join(' ',array_values($errors)));
-
- $sco->reload();
- }
- }
- }
+ if ($_POST AND $sco->values($_POST)->changed() AND ! ($this->save($sco)))
+ $sco->reload();
return View::factory('ssl/reseller/add_edit')
->set('o',$sco);
diff --git a/modules/ssl/classes/Controller/User/Ssl.php b/modules/ssl/classes/Controller/User/Ssl.php
index e852d031..9bd4d2b6 100644
--- a/modules/ssl/classes/Controller/User/Ssl.php
+++ b/modules/ssl/classes/Controller/User/Ssl.php
@@ -15,13 +15,13 @@ class Controller_User_SSL extends Controller_SSL {
);
public function action_download() {
- $id = $_POST['sid'];
- $so = ORM::factory('Service',$id);
+ $so = ORM::factory('Service',$this->request->post('sid'));
- if (! $so->loaded())
- HTTP::redirect('welcome/index');
+ 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');
+
+ $passwd = $this->request->post('passwd');
- $passwd = $_POST['passwd'];
if (strlen($passwd) < Kohana::$config->load('ssl')->minpass_length) {
SystemMessage::add(array(
'title'=>_('Validation failed'),
@@ -32,11 +32,6 @@ class Controller_User_SSL extends Controller_SSL {
HTTP::redirect(URL::link('user','service/view/'.$so->id));
}
- if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) {
- $this->template->content = 'Unauthorised or doesnt exist?';
- return FALSE;
- }
-
// Log the download
$smo = $so->service_memo;
$smo->service_id = $so->id;
@@ -49,10 +44,11 @@ class Controller_User_SSL extends Controller_SSL {
openssl_pkcs12_export_to_file($so->plugin()->cert,$file,$so->plugin()->pk,$passwd,array('extracerts'=>$so->plugin()->cacerts()));
$x = file_get_contents($file);
unlink($file);
+
+ $this->auto_render = FALSE;
$this->response->headers('Content-Type','application/pks12');
$this->response->headers('Content-Disposition','attachment; filename="'.basename($file).'"');
$this->response->body($x);
- $this->auto_render = FALSE;
}
}
?>
diff --git a/modules/ssl/views/service/admin/plugin/ssl/edit.php b/modules/ssl/views/service/admin/plugin/ssl/edit.php
index e203a691..5ac6e73e 100644
--- a/modules/ssl/views/service/admin/plugin/ssl/edit.php
+++ b/modules/ssl/views/service/admin/plugin/ssl/edit.php
@@ -1,17 +1,17 @@
- service->plugin()->csr,array('class'=>'span6','label'=>'CSR','placeholder'=>'CSR','nowysihtml'=>TRUE,'style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->csr))); ?>
+ 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','nowysihtml'=>TRUE,'style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->pk))); ?>
+ 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','nowysihtml'=>TRUE,'style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->cert))); ?>
+ service->plugin()->cert,array('class'=>'span6','label'=>'Public Certificate','placeholder'=>'Public Certificate','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->service->plugin()->cert))); ?>
diff --git a/modules/ssl/views/ssl/reseller/add_edit.php b/modules/ssl/views/ssl/reseller/add_edit.php
index 1168423d..9592818c 100644
--- a/modules/ssl/views/ssl/reseller/add_edit.php
+++ b/modules/ssl/views/ssl/reseller/add_edit.php
@@ -50,8 +50,8 @@
- sign_pk,array('class'=>'span6','label'=>'Private Key','placeholder'=>'Private Key','nowysihtml'=>TRUE,'style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->sign_pk))); ?>
- sign_cert,array('class'=>'span6','label'=>'Public Certificate','placeholder'=>'Public Certificate','nowysihtml'=>TRUE,'style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->sign_cert))); ?>
+ sign_pk,array('class'=>'span6','label'=>'Private Key','placeholder'=>'Private Key','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->sign_pk))); ?>
+ sign_cert,array('class'=>'span6','label'=>'Public Certificate','placeholder'=>'Public Certificate','style'=>'font-family: monospace;','rows'=>Form::textarea_rows($o->sign_cert))); ?>
'btn btn-primary')); ?>