diff --git a/account.php b/account.php index 6dfae1a..aa23a3d 100644 --- a/account.php +++ b/account.php @@ -209,8 +209,11 @@ function cmd_do_login() if($iResult == SUCCESS) { + $sReturnUrl = $aClean['sReturnTo']; + if(!$sReturnUrl) + $sReturnUrl = apidb_fullurl("index.php"); addmsg("You are successfully logged in as '$oUser->sRealname'.", "green"); - util_redirect_and_exit(apidb_fullurl("index.php")); + util_redirect_and_exit($sReturnUrl); } else { retry("login","Login failed ".$shNote); diff --git a/include/form_login.php b/include/form_login.php index 5f3cfee..169ec2f 100644 --- a/include/form_login.php +++ b/include/form_login.php @@ -6,7 +6,10 @@ require_once(BASE."include/util.php"); /**************/ echo "