<%args>
$login_destination => ''
</%args>
<%init>
use Clark04::Eblocks::Data;
my $data = new Clark04::Eblocks::Data;
use Clark04::Data::User;
our $user = new Clark04::Data::User;
$user->load();
my $siteBase = $data->getConfVar('site_url') . '/eblock/';
if ($user->getUserID()) {
    $m->redirect($siteBase);
}

if (!$login_destination) {
    $login_destination = $siteBase . "?mode=call";
}
my $escapedLoginDestination = $login_destination;
$escapedLoginDestination =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;

</%init>

<h1>Welcome to eBlock Captains!</h1>

<p>You're one step away from getting in contact with voters in early
primary states. All you need to do is log into the eBlock Captains
program. If you have a Clark Community Network username and password,
or you got an eBlock Captains username and password in the mail, you
can use it here.  Otherwise, <b><a
href="http://www.forclark.com/newuser?account=eBlock&login_destination=<%$escapedLoginDestination%>">sign
up for eBlock Captains</a></b>.</p>

<h2>Logging In</h2>
%my $suppressLogin = 0;
%if ($ENV{'HTTP_REFERER'} =~ /login\.mhtml/ || $ARGS{'login_attempt'}) {
<p><b><font color="red">Can't log in?</font></b> It looks like you're having trouble logging in. We know of two problems that can cause the trouble you're having.

<ol>

<li>You might not be accepting <font color="red"><b>browser
cookies</b></font> from forclark.com. You won't be able to log in
unless we can set a browser cookie for you. Please check your
browser's security settings, or <a
href="resources/cookies.mhtml">follow the instructions for your
browser in this help document</a>.

<li>You might have come here from a <font color="red"><b>web mail
service like Hotmail</b></font> which is wrapping this page in
frames. <a href="#"
onclick="window.open('http://eblock-captains.forclark.com/','eblock');
return false;">Click here</a> to break out of frames.

</ol>

%} elsif ($ENV{'HTTP_REFERER'} =~ /linkrd/) {

<font color="red"><b>Coming from Hotmail?</b></font> It looks like
you've come here from a web mail service like Hotmail which is
wrapping this page in frames. <a href="#"
onclick="window.open('http://eblock-captains.forclark.com/','eblock');
return false;"><font color="red"><b>Click here</b></font></a> to break
out of frames, and then you should be able to log in.
%$suppressLogin = 1;

%}

%if (!$suppressLogin) {
<table BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="">
	<tr>

		<td COLSPAN=2>
			<center></center>
		</td>
	</tr>
	<tr>
		<td align="right">
			<form NAME="login" ACTION="/" METHOD="post">
<input type="hidden" name="login_destination" value="<%$login_destination%>">
			<div class="norm_font"><small>Your email address:</small></div>

		</td>
		<td>
			<div class="norm_font"><small><input TYPE="text" SIZE=30 NAME="uname"></small></div>
		</td>
	</tr>
	<tr>
		<td align="right">
			<div class="norm_font"><small>Your password:</small></div>

		</td>
		<td>
			<div class="norm_font"><small><input TYPE="password" SIZE=30 NAME="pass"></small></div>
		</td>
	</tr>
	<tr>
		<td align="right" COLSPAN=2>
    		<div class="norm_font">
    			<input TYPE="submit" NAME="login" VALUE="Login">

		</div></form>
    	</td>
	</tr>
</table>

<p><b>Note:</b> You need to accept a browser cookie to log in to
eBlock Captains. If you sign in and just get this page again, your
browser is probably not accepting the cookie we need to set. Please
check your browser security settings.
%}

<p>If you have any difficulties logging in or using eBlock Captains,
please send mail to <a
href="mailto:accounts@forclark.com">accounts@forclark.com</a>.

<hr>

<h2>Do You Need to Sign Up?</h2>

<p>If you don't have an eBlock Captains account already, <a
href="http://www.forclark.com/newuser?account=eBlock&login_destination=<%$escapedLoginDestination%>">click here to sign up</a>.

<hr>

<h2>Did You Forget Your Password?</h2>

<p>If you have an account but you can't remember your password (or you
never received one), enter your email address and click the "Send
Password" button. We'll send you instructions on how to get a new
password.

<form NAME="login" ACTION="/" METHOD="post">
<table>
<tr>
<td>
<input type="hidden" name="login_destination" value="<%$login_destination%>">
<div class="norm_font"><small>Your email address:</small></div></td>
<td><div class="norm_font"><small><input TYPE="text" SIZE=30 NAME="uname"></small></div></td>
</tr>
<tr>
<td align="right" COLSPAN=2>
<div class="norm_font">
<input TYPE="submit" NAME="mailpass" VALUE="Send Me a New Password">
</div>
</td></tr></table>
</form>

<hr>

<p><a href="/">Back to the Clark Community Network</a></p>

