From a675271ad71b7713d1b33bdba3c51b2b04813229 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 Nov 2015 12:50:33 -0500 Subject: Rewrite of session management --- app/Helper/App.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'app/Helper/App.php') diff --git a/app/Helper/App.php b/app/Helper/App.php index 19801fa8..33729f2b 100644 --- a/app/Helper/App.php +++ b/app/Helper/App.php @@ -62,18 +62,17 @@ class App extends \Kanboard\Core\Base */ public function flashMessage() { - $html = ''; + $success_message = $this->flash->getMessage('success'); + $failure_message = $this->flash->getMessage('failure'); - if (isset($this->session['flash_message'])) { - $html = '
'.$this->helper->e($this->session['flash_message']).'
'; - unset($this->session['flash_message']); - unset($this->session['flash_error_message']); - } elseif (isset($this->session['flash_error_message'])) { - $html = '
'.$this->helper->e($this->session['flash_error_message']).'
'; - unset($this->session['flash_message']); - unset($this->session['flash_error_message']); + if (! empty($success_message)) { + return '
'.$this->helper->e($success_message).'
'; } - return $html; + if (! empty($failure_message)) { + return '
'.$this->helper->e($failure_message).'
'; + } + + return ''; } } -- cgit v1.2.3