<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; ?>
}
}
- OC_Template::printGuestPage('', 'login', array('error' => $error ));
+ OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
}
}
if($redirect_url)
- return $urlLinkTo.'?redirect_url='.$redirect_url;
+ return $urlLinkTo.'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]);
else
return $urlLinkTo;
* 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();
}
}