<%args>

</%args>

<%init>
my ($user, $data) = $m->comp('init_loginoptional.mhtml');
my $dest;
my $here = "http%3A%2F%2Feblock-captains.forclark.com" . $ENV{'SCRIPT_NAME'};
my $q = $ENV{'QUERY_STRING'};
if ($q) {
    $q =~ s/&/%26/;
    $here .= '%3F' . $q;
}
$user->assertLogin($m, $r, "http://eblock-captains.forclark.com/eblocks/login.mhtml?login_destination=$here");
if (!($user->hasPermission('eblocks_limited') || $user->hasPermission('eblocks_unlimited'))) {
    $m->redirect('noperm.mhtml');
}
our $data = new Clark04::Eblocks::Data();
return ($user, $data);
</%init>
