Work on Email and other major consistency work
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user