diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-30 21:21:16 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-30 21:21:16 -0400 |
commit | 99953ab62a215e92c29d444870cd96d36430d3ba (patch) | |
tree | c2784aeb6f2a82e1bca26bf05a8d9b434ff57be3 /controllers/config.php | |
parent | d9dfd9d6199b15eba9510ef460e18c9245d9ab12 (diff) |
Add the possiblity to regenerate all tokens
Diffstat (limited to 'controllers/config.php')
-rw-r--r-- | controllers/config.php | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/controllers/config.php b/controllers/config.php index c26013d8..0adf1d54 100644 --- a/controllers/config.php +++ b/controllers/config.php @@ -4,9 +4,19 @@ namespace Controller; require_once __DIR__.'/base.php'; +/** + * Config controller + * + * @package controller + * @author Frederic Guillot + */ class Config extends Base { - // Settings page + /** + * Display the settings page + * + * @access public + */ public function index() { $this->response->html($this->template->layout('config_index', array( @@ -22,7 +32,11 @@ class Config extends Base ))); } - // Validate and save settings + /** + * Validate and save settings + * + * @access public + */ public function save() { $values = $this->request->getValues(); @@ -53,18 +67,38 @@ class Config extends Base ))); } - // Download the database + /** + * Download the Sqlite database + * + * @access public + */ public function downloadDb() { $this->response->forceDownload('db.sqlite.gz'); $this->response->binary($this->config->downloadDatabase()); } - // Optimize the database + /** + * Optimize the Sqlite database + * + * @access public + */ public function optimizeDb() { $this->config->optimizeDatabase(); $this->session->flash(t('Database optimization done.')); $this->response->redirect('?controller=config'); } + + /** + * Regenerate all application tokens + * + * @access public + */ + public function tokens() + { + $this->config->regenerateTokens(); + $this->session->flash(t('All tokens have been regenerated.')); + $this->response->redirect('?controller=config'); + } } |