diff --git a/core/templates/login.php b/core/templates/login.php index aff0afac20..6c0a7a1222 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -1,5 +1,6 @@
+ '; } ?> t('Lost your password?'); ?> diff --git a/index.php b/index.php index fb8d1922dd..d2d0700c57 100644 --- a/index.php +++ b/index.php @@ -90,5 +90,5 @@ else { } } - OC_Template::printGuestPage('', 'login', array('error' => $error )); + OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' )); } diff --git a/lib/helper.php b/lib/helper.php index b6332b54ae..9c2b5fc33c 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -61,7 +61,7 @@ class OC_Helper { } if($redirect_url) - return $urlLinkTo.'?redirect_url='.$redirect_url; + return $urlLinkTo.'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]); else return $urlLinkTo; diff --git a/lib/util.php b/lib/util.php index 5d03c56f18..f8748e868c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -321,7 +321,11 @@ class OC_Util { * Redirect to the user default page */ public static function redirectToDefaultPage(){ - header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php')); + if(isset($_REQUEST['redirect_url'])) { + header( 'Location: '.$_REQUEST['redirect_url']); + } else { + header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php')); + } exit(); } }