From f8eebcbb011269a36fe4b10f21b73dec4b076bff Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sun, 30 Sep 2012 03:47:37 +0200
Subject: [PATCH] reload the current url when login in instead of always
 redirecting to the default app (oc-1873)

---
 core/templates/login.php | 2 +-
 lib/base.php             | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/templates/login.php b/core/templates/login.php
index bedff4453b..bb7a833752 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -1,5 +1,5 @@
 <!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
-<form action="index.php" method="post">
+<form method="post">
 	<fieldset>
 		<?php if(!empty($_['redirect'])) { echo '<input type="hidden" name="redirect_url" value="'.$_['redirect'].'" />'; } ?>
 		<?php if($_['display_lostpassword']): ?>
diff --git a/lib/base.php b/lib/base.php
index b89859ab2d..41ff187005 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -549,7 +549,8 @@ class OC{
 			else {
 				OC_User::unsetMagicInCookie();
 			}
-			OC_Util::redirectToDefaultPage();
+			header( 'Location: '.$_SERVER['REQUEST_URI'] );
+			exit();
 		}
 		return true;
 	}
-- 
GitLab