From 8257100f542cf4b7fe1eefc4918c62888d25390b Mon Sep 17 00:00:00 2001 From: Highstrike Date: Wed, 24 Jun 2015 15:46:48 +0300 Subject: [PATCH] How about this? --- .../Templates/skel/View/Elements/Flash/default.ctp | 1 + lib/Cake/Console/Templates/skel/View/Elements/empty | 0 lib/Cake/Controller/Component/AuthComponent.php | 4 ++-- lib/Cake/View/Elements/Flash/default.ctp | 1 + lib/Cake/View/Helper/FlashHelper.php | 9 --------- 5 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp delete mode 100644 lib/Cake/Console/Templates/skel/View/Elements/empty create mode 100644 lib/Cake/View/Elements/Flash/default.ctp diff --git a/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp b/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp new file mode 100644 index 000000000..ce0f61355 --- /dev/null +++ b/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/lib/Cake/Console/Templates/skel/View/Elements/empty b/lib/Cake/Console/Templates/skel/View/Elements/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 3d2169b47..88a8d60b1 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -50,7 +50,7 @@ class AuthComponent extends Component { * * @var array */ - public $components = array('Session', 'RequestHandler'); + public $components = array('Session', 'Flash', 'RequestHandler'); /** * An array of authentication objects to use for authenticating users. You can configure @@ -840,7 +840,7 @@ class AuthComponent extends Component { if ($message === false) { return; } - $this->Session->setFlash($message, $this->flash['element'], $this->flash['params'], $this->flash['key']); + $this->Flash->set($message, $this->flash); } } diff --git a/lib/Cake/View/Elements/Flash/default.ctp b/lib/Cake/View/Elements/Flash/default.ctp new file mode 100644 index 000000000..ce0f61355 --- /dev/null +++ b/lib/Cake/View/Elements/Flash/default.ctp @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/lib/Cake/View/Helper/FlashHelper.php b/lib/Cake/View/Helper/FlashHelper.php index c61765675..46dc67ac4 100644 --- a/lib/Cake/View/Helper/FlashHelper.php +++ b/lib/Cake/View/Helper/FlashHelper.php @@ -85,15 +85,6 @@ class FlashHelper extends AppHelper { $flash = $options + $flash; CakeSession::delete("Message.$key"); - // backwards compatibility with Session->setFlash() - if ($flash['element'] === 'default') { - $class = 'message'; - if (!empty($flash['params']['class'])) { - $class = $flash['params']['class']; - } - return '
' . $flash['message'] . '
'; - } - return $this->_View->element($flash['element'], $flash); } }