diff --git a/class/Exceptions_handler_lib.php b/class/Exceptions_handler_lib.php index 8730c70..3d3f7c4 100644 --- a/class/Exceptions_handler_lib.php +++ b/class/Exceptions_handler_lib.php @@ -124,7 +124,7 @@ class FileException extends Exception { function __construct($in_errormsg=Null,$in_errorcode=Null) { - parent::__construct("Bład pliku: + parent::__construct("Błąd pliku: {$in_errormsg}",$in_errorcode); } } \ No newline at end of file diff --git a/class/displayManager.Class.php b/class/displayManager.Class.php index a51463b..6f596a4 100644 --- a/class/displayManager.Class.php +++ b/class/displayManager.Class.php @@ -851,20 +851,25 @@ public function meetings(){ * @return statement file contents */ public function download_statement($data){ - if ($data['id']){ - /* id is set, logged in user should be superadmin */ - $this->secure('admin'); - $volunteer = $this->engine->loadVolunteers(array('id'=>$data['id'])); - $volunteer = $volunteer[0]; - $volunteer->getStatementFileContents(false); - }else{ - /* else only currently logged in user statement is available */ - $this->secure('self'); - if (!$this->user->statement_downloaded){ - $this->user->getStatementFileContents(); - }else{ - HTTP::redirect('/'); - } + try { + if ($data['id']){ + /* id is set, logged in user should be superadmin */ + $this->secure('admin'); + $volunteer = $this->engine->loadVolunteers(array('id'=>$data['id'])); + $volunteer = $volunteer[0]; + $volunteer->getStatementFileContents(false); + }else{ + /* else only currently logged in user statement is available */ + $this->secure('self'); + if (!$this->user->statement_downloaded){ + $this->user->getStatementFileContents(); + }else{ + HTTP::redirect('/'); + } + } + }catch (FileException $e){ + echo $e->getMessage(); + die(); } } } diff --git a/templates/volunteer_account.html b/templates/volunteer_account.html index c26a948..d561816 100644 --- a/templates/volunteer_account.html +++ b/templates/volunteer_account.html @@ -22,7 +22,7 @@