ActionController: remove redirectToLogin default

The redirectOnLogin function now doesn't have any predefined default.
This also leads to the behaviour that "Logout" will not redirect you
anywhere on a new login while "forcibly being logged out" (e.g. by
logging out in another browser tab) will bring you back to where you
came from.
This commit is contained in:
Thomas Gelf 2014-08-19 12:28:24 +02:00
parent 7334716d15
commit db3ef8fbd0

View File

@ -254,8 +254,10 @@ class ActionController extends Zend_Controller_Action
* *
* @throws \Exception * @throws \Exception
*/ */
protected function redirectToLogin($afterLogin = '/dashboard') protected function redirectToLogin($afterLogin = null)
{ {
$redir = null;
if ($afterLogin !== null) {
if (! $afterLogin instanceof Url) { if (! $afterLogin instanceof Url) {
$afterLogin = Url::fromPath($afterLogin); $afterLogin = Url::fromPath($afterLogin);
} }
@ -265,7 +267,10 @@ class ActionController extends Zend_Controller_Action
// TODO: Ignore /? // TODO: Ignore /?
$redir = $afterLogin->getRelativeUrl(); $redir = $afterLogin->getRelativeUrl();
} }
}
$url = Url::fromPath('authentication/login'); $url = Url::fromPath('authentication/login');
if ($redir) { if ($redir) {
$url->setParam('redirect', $redir); $url->setParam('redirect', $redir);
} }