aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-04-15 19:33:25 +0200
committerLukas Reschke <lukas@owncloud.com>2016-04-15 19:33:25 +0200
commit17dfffefb368b167cfbad9b6c48e59e8bc952691 (patch)
treea88d906b2d81d020768aa7c49833a01859b741e8 /lib/base.php
parentfee95084ae1fddfc616db1e35ee4508cb8e02d57 (diff)
downloadnextcloud-server-17dfffefb368b167cfbad9b6c48e59e8bc952691.tar.gz
nextcloud-server-17dfffefb368b167cfbad9b6c48e59e8bc952691.zip
Keep used username in URL
This is required until the new controller can also handle POST requests
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index d8ef17e42ed..818e13fbef2 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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);
}
}