]> 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>
Thu, 21 Jun 2012 18:15:23 +0000 (20:15 +0200)
lib/util.php

index 58d6ab1be78fa58fdd89f45cbcd880fda6f3ecd9..5cd66ca12eee51db28a596bacfa5b7700d415d0a 100644 (file)
@@ -326,7 +326,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();