redirect url fixed

This commit is contained in:
Marvin Thomas Rabe 2011-10-04 19:27:57 +02:00
parent 314e84716b
commit 33f24a42b8
4 changed files with 8 additions and 3 deletions

View 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; ?>

View File

@ -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']:'' ));
}

View 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;

View 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();
}
}