
<? if (file_exists('altauth_header.php')) print file_get_contents('altauth_header.php') ?>

<?
	$resetpass_file = 'altauth_resetpassurl.txt';
	$resetpass_url = file_exists($resetpass_file) ? preg_replace('/\\s+/', '', join('', file($resetpass_file))) : '';
?>

<style type="text/css">
<? print file_get_contents('altauth_style.css') ?>
</style>

<?=$Message?>

<center>
<form name="LoginForm" method=post>
	<input type=hidden name="return_url" value="<?=$_REQUEST['return_url']?>">
	<table border=0 cellpadding=2 cellspacing=2>
	<tr><td class=headfoot>Authorization</td></tr>
	<tr><td class=content>
		<table align=center>
		<tr>
			<td class=content>Username</td>
			<td class=content><input type=text tabIndex=1 size=20 maxsize=30 name=username value="<?=isset($_REQUEST['username']) ? $_REQUEST['username'] : '' ?>"></td>
		</tr>
		<tr>
			<td class=content>Password</td>
			<td class=content><input type=password tabIndex=2 size=20 maxsize=30 name=password value=""></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td class=content><input type=checkbox tabIndex=3 name=longlife <?= isset($_REQUEST['longlife']) ? 'checked' : '' ?> value="1"> remember me</td>
		</tr>
		</table>
	</td></tr>
	<tr>
		<td class=headfoot>
			<input class=button type="submit" tabIndex="4" name="do_login" value="Log in">
			<? if ($resetpass_url) { ?>
			&nbsp;&nbsp;
			<input class=button type="button" tabIndex="5" onClick="document.location='<?=$resetpass_url?>?username='+escape(document.forms['LoginForm'].username.value)+'&return_url='+escape(document.forms['LoginForm'].return_url.value); return false" value="Reset password">
			<? } ?>
		</td>
	</tr>
	</table>  
</form>
</center>

<script>
	document.forms['LoginForm'].username.focus();
</script>

<? if (file_exists('altauth_footer.php')) print file_get_contents('altauth_footer.php') ?>
