Set returnto when redirected to login of a private install

This commit is contained in:
Jeffery To 2009-08-11 21:55:24 +08:00
parent 73cde378c9
commit e432df76d5
1 changed files with 15 additions and 0 deletions

View File

@ -193,6 +193,21 @@ function main()
}
if (!in_array($action, $public_actions) &&
!preg_match('/rss$/', $action)) {
// set returnto
$rargs =& common_copy_args($args);
unset($rargs['action']);
if (common_config('site', 'fancy')) {
unset($rargs['p']);
}
if (array_key_exists('submit', $rargs)) {
unset($rargs['submit']);
}
foreach (array_keys($_COOKIE) as $cookie) {
unset($rargs[$cookie]);
}
common_set_returnto(common_local_url($action, $rargs));
common_redirect(common_local_url($login_action));
return;
}