Added Invoice/SSL download recording, other misc fixes

This commit is contained in:
Deon George
2013-10-11 13:08:50 +11:00
parent 6f855fb32d
commit 6e95184b0c
15 changed files with 137 additions and 12 deletions

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_User_SSL extends Controller_TemplateDefault_User {
class Controller_User_SSL extends Controller_SSL {
protected $secure_actions = array(
'download'=>FALSE,
);
@@ -37,6 +37,13 @@ class Controller_User_SSL extends Controller_TemplateDefault_User {
return FALSE;
}
// Log the download
$smo = $so->service_memo;
$smo->service_id = $so->id;
$smo->account_id = $this->ao->id;
$smo->memo = sprintf('SSL Certificate %s Downloaded.',$so->plugin()->serial());
$smo->save();
$file = sprintf('%s/%s.pkcs12',Kohana::$config->load('config')->tmpdir,$so->name());
openssl_pkcs12_export_to_file($so->plugin()->cert,$file,$so->plugin()->pk,$passwd,array('extracerts'=>$so->plugin()->cacerts()));
$x = file_get_contents($file);