diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-21 20:05:02 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-21 20:09:24 +0100 |
commit | 987845c31206b3d193e41e65ed6b964efc26f127 (patch) | |
tree | 6d82b565b64d7c8d07bee63abb1089b851310705 /lib/util.php | |
parent | 21f8d0992f1ae389d8c9acc870927285e9413a96 (diff) | |
download | nextcloud-server-987845c31206b3d193e41e65ed6b964efc26f127.tar.gz nextcloud-server-987845c31206b3d193e41e65ed6b964efc26f127.zip |
Move the redirect_url from linkTo function to the checkLoggedIn function
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php index aa9fcdec65f..1b1e29b6749 100644 --- a/lib/util.php +++ b/lib/util.php @@ -240,7 +240,7 @@ class OC_Util { /** - * Check if the app is enabled, send json error msg if not + * Check if the app is enabled, redirects to home if not */ public static function checkAppEnabled($app){ if( !OC_App::isEnabled($app)){ @@ -250,12 +250,13 @@ class OC_Util { } /** - * Check if the user is logged in, redirects to home if not + * Check if the user is logged in, redirects to home if not. With + * redirect URL parameter to the request URI. */ public static function checkLoggedIn(){ // Check if we are a user if( !OC_User::isLoggedIn()){ - header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', TRUE )); + header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' ).'?redirect_url='.urlencode($_SERVER["REQUEST_URI"])); exit(); } } |