Keep used username in URL

This is required until the new controller can also handle POST requests
This commit is contained in:
Lukas Reschke 2016-04-15 19:33:25 +02:00
parent fee95084ae
commit 17dfffefb3
No known key found for this signature in database
GPG Key ID: 9AB0ADB949B6898C
1 changed files with 8 additions and 1 deletions

View File

@ -954,7 +954,14 @@ class OC {
if(!\OC::$server->getUserSession()->isLoggedIn()) {
$loginMessages = array(array_unique($error), $messages);
\OC::$server->getSession()->set('loginMessages', $loginMessages);
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.login.showLoginForm'));
// Read current user and append if possible
$args = [];
if(isset($_POST['user'])) {
$args['user'] = $_POST['user'];
}
$redirectionTarget = \OC::$server->getURLGenerator()->linkToRoute('core.login.showLoginForm', $args);
header('Location: ' . $redirectionTarget);
}
}