summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-15 20:54:36 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-15 20:54:36 -0500
commit371115167cfa6d490a308cd8d9e02578c53c2b65 (patch)
tree4eec96e911c9cd6f715878ee3feb9b2267620ce4 /app/Controller
parent1537f1b025c39fe432a8ca8aed5944b46e853f61 (diff)
parent6e9de547c074ad794b6d272eda9bf9b7d7bef792 (diff)
Merge pull-request #3038
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/ConfigController.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/Controller/ConfigController.php b/app/Controller/ConfigController.php
index 8572316e..222549f4 100644
--- a/app/Controller/ConfigController.php
+++ b/app/Controller/ConfigController.php
@@ -201,6 +201,32 @@ class ConfigController extends BaseController
}
/**
+ * Display the Sqlite database upload page
+ *
+ * @access public
+ */
+ public function uploadDb()
+ {
+ $this->response->html($this->helper->layout->config('config/upload_db', array()));
+ }
+
+ /**
+ * Replace current Sqlite db with uploaded file
+ *
+ * @access public
+ */
+ public function uploadDbSave()
+ {
+ $filename = $this->request->getFilePath('file');
+ if (!file_exists($filename) || !$this->configModel->uploadDatabase($filename)) {
+ $this->flash->failure(t('Unable to read your file'));
+ } else {
+ $this->flash->success(t('Database upload done.'));
+ }
+ $this->response->redirect($this->helper->url->to('ConfigController', 'index'));
+ }
+
+ /**
* Regenerate webhook token
*
* @access public