]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prefer requested app before redirecting to default page
authorBart Visscher <bartv@thisnet.nl>
Wed, 20 Jun 2012 15:10:17 +0000 (17:10 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 20 Jun 2012 15:10:49 +0000 (17:10 +0200)
lib/util.php

index 46c9e0ef92736f3b27074f7a67f2500b7d355a93..7792f96d4459ef3400276aa0632b0f0475d35612 100755 (executable)
@@ -324,7 +324,11 @@ class OC_Util {
                OC_Log::write('core','redirectToDefaultPage',OC_Log::DEBUG);
                if(isset($_REQUEST['redirect_url']) && (substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT || $_REQUEST['redirect_url'][0] == '/')) {
                        header( 'Location: '.$_REQUEST['redirect_url']);
-               } else {
+               }
+               else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
+                       header( 'Location: '.OC::$WEBROOT.'/?app='.OC::$REQUESTEDAPP );
+               }
+               else {
                        header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files'));
                }
                exit();