mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Use the correct backpath to redirect operator after login
This commit is contained in:
parent
82a4d7a2a2
commit
3984c260b0
@ -287,8 +287,17 @@ class Application implements RouterAwareInterface, AuthenticationManagerAwareInt
|
|||||||
return new Response('Forbidden', 403);
|
return new Response('Forbidden', 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator is not logged in. Redirect him to the login page.
|
// Operator is not logged in. Use the correct backpath to redirect him
|
||||||
$_SESSION['backpath'] = $request->getUri();
|
// operator after login.
|
||||||
|
if ($request->attributes->get('_route') == 'users_update') {
|
||||||
|
// Do not use "users" client application gateway as the backpath.
|
||||||
|
// Use the awaiting visitors page instead.
|
||||||
|
$_SESSION['backpath'] = $this->getRouter()->generate('users');
|
||||||
|
} else {
|
||||||
|
// Just use the current URI as the backpath.
|
||||||
|
$_SESSION['backpath'] = $request->getUri();
|
||||||
|
}
|
||||||
|
// Redirect the operator to the login page.
|
||||||
$response = new RedirectResponse($this->getRouter()->generate('login'));
|
$response = new RedirectResponse($this->getRouter()->generate('login'));
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
Loading…
Reference in New Issue
Block a user