Show logout.html syntax highlighted
% # vim: set syntax=mason:
<%init>
my $user = Apache2::SiteControl->getCurrentUser($r);
if(!$user || !$user->isa('Apache2::SiteControl::User')) {
$logger->error("Unable to find a user for the given session key.");
$m->redirect("/");
}
my $success = 0;
my $c;
eval {
$c = new AlphaMail::Middleware($user->getAttribute('imap'),
$user->getUsername(), $user->getAttribute('password'), $config);
$logger->info($user->getUsername() . " logged out.");
$user->logout($r);
$c->flush if($c); # Drop all cached entries
};
if($@) {
$logger->error($user->getUsername() . ': Unable to process logout: user, $r, $m: ' . Dumper($user, $r, $m));
}
</%init>
<html>
<head>
<title>Logout complete</title>
<link href="<% $base %>/static/default.css" rel="stylesheet" type="text/css" title="Default Stylesheet">
</head>
<body class="logout">
<div class="title">Logout Complete</div>
<div class="status">
You were successfully logged out of the system. If you are using a
public computer, you should exit the browser to insure your privacy.
<br>
<span class="important">IMPORTANT:</span> If you are using a
Macintosh, closing the window is <em>not</em> enough. Choose Quit from
the application menu instead.
</div>
<div class="navigation">
<a href="<% $base %>/index.html">Return to login screen.</a>
</div>
</body>
</html>
<%once>
use Data::Dumper;
our $logger = Log::Log4perl->get_logger('alphamail');
our $base = $config->get('base_uri');
</%once>
See more files for this project here