Skip to content

Commit

Permalink
Allow the logout page to specify a URL to redirect to
Browse files Browse the repository at this point in the history
We pass in $m->notes because %ARGS is passed in wholesale in too many
places, and there is no way to validate the url obtained via %ARGS, due
to the callback.
  • Loading branch information
alexmv committed Apr 8, 2011
1 parent b8609fb commit 86812b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion share/html/Elements/Header
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
<title><%$Title%></title>

% if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) {
<meta http-equiv="refresh" content="<% $1 %>" />
% my $URL = $m->notes->{LogoutURL}; $URL = $URL ? ";URL=$URL" : "";
<meta http-equiv="refresh" content="<% "$1$URL" %>" />
% }

<link rel="shortcut icon" href="<%RT->Config->Get('WebImagesURL')%>favicon.png" type="image/png" />
Expand Down
3 changes: 2 additions & 1 deletion share/html/NoAuth/Logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => loc('Logout'), Refresh => RT->Config->Get('LogoutRefresh').";URL=$URL" &>
<& /Elements/Header, Title => loc('Logout'), Refresh => RT->Config->Get('LogoutRefresh') &>
</div>

<div id="body" class="login-body">
Expand Down Expand Up @@ -81,4 +81,5 @@
}

$m->callback( %ARGS, CallbackName => 'AfterSessionDelete' );
$m->notes->{LogoutURL} = $URL;
</%INIT>

0 comments on commit 86812b5

Please sign in to comment.