diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-15 21:06:41 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-15 21:06:41 -0500 |
commit | 5e0cf1472ef0b019c9d50d61ba944e977e28b104 (patch) | |
tree | 8041c0b3e192bbdc50a0545bfa0b55a7d8366423 /app/Controller/ConfigController.php | |
parent | 371115167cfa6d490a308cd8d9e02578c53c2b65 (diff) |
Improve PR #3038
Diffstat (limited to 'app/Controller/ConfigController.php')
-rw-r--r-- | app/Controller/ConfigController.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/Controller/ConfigController.php b/app/Controller/ConfigController.php index 222549f4..62ae8201 100644 --- a/app/Controller/ConfigController.php +++ b/app/Controller/ConfigController.php @@ -207,7 +207,7 @@ class ConfigController extends BaseController */ public function uploadDb() { - $this->response->html($this->helper->layout->config('config/upload_db', array())); + $this->response->html($this->template->render('config/upload_db')); } /** @@ -215,14 +215,16 @@ class ConfigController extends BaseController * * @access public */ - public function uploadDbSave() + public function saveUploadedDb() { $filename = $this->request->getFilePath('file'); + if (!file_exists($filename) || !$this->configModel->uploadDatabase($filename)) { - $this->flash->failure(t('Unable to read your file')); + $this->flash->failure(t('Unable to read uploaded file.')); } else { $this->flash->success(t('Database upload done.')); } + $this->response->redirect($this->helper->url->to('ConfigController', 'index')); } |