]> source.dussan.org Git - nextcloud-server.git/commitdiff
redirect url fixed
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Tue, 4 Oct 2011 17:27:57 +0000 (19:27 +0200)
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Tue, 4 Oct 2011 17:27:57 +0000 (19:27 +0200)
core/templates/login.php
index.php
lib/helper.php
lib/util.php

index aff0afac20389dc0a9cbeadcedc2c82df9b637f4..6c0a7a12227a64102ddf4af3c14e893cd9d9b0d3 100644 (file)
@@ -1,5 +1,6 @@
 <form action="index.php" method="post">
        <fieldset>
+               <?php if(!empty($_['redirect'])) { echo '<input type="hidden" name="redirect_url" value="'.$_['redirect'].'" />'; } ?>
                <?php if($_['error']): ?>
                        <a href="./core/lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
                <?php endif; ?>
index fb8d1922dd475cadd3bf9ebd4230324f4816a646..d2d0700c577c9c92fa969423800587c79f666dbc 100644 (file)
--- 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']:'' ));
 }
index b6332b54aea47a596a05a7fc5b624ef0575c38fc..9c2b5fc33ce463dc925a0a12b2074165aad4d5a0 100644 (file)
@@ -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;
 
index 5d03c56f18e6ed9bbc564f5dcd1749e6ecf098da..f8748e868c114ac02130ae99ebf49936fe9f3f62 100644 (file)
@@ -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();
        }
 }