{extends "base.tpl.html"}
{block page_classes}login{/block}
{block "title"}Login{/block}

{block "content"}


<script type="text/javascript">
<!--
function validateForm()
{
    if (Validation.isFieldWhitespace(Eventum.getField('email'))) {
        Validation.errors[Validation.errors.length] = new Option('{t escape=js}Login{/t}', 'email');
    }
    if (Validation.isFieldWhitespace(Eventum.getField('passwd'))) {
        Validation.errors[Validation.errors.length] = new Option('{t escape=js}Password{/t}', 'passwd');
    }
}
$().ready(function() {
    Eventum.getField('email').focus();
});
//-->
</script>

<form id="login_form" method="post" action="login.php" class="validate" data-validation-function="validateForm">
<input type="hidden" name="cat" value="login">
<input type="hidden" name="url" value="{$smarty.request.url|default:''|escape:'htmlall'}">

<div id="logo"></div>
<h1>{$core.app_title} - {t}Login{/t}</h1>
<table>
    {if $smarty.get.err|default:0 != 0}
    <tr>
      <td colspan="2" class="message">
        <b>
        {if $smarty.get.err == 1}
          {t}Error{/t}: {t}Please provide login.{/t}
        {elseif $smarty.get.err == 2}
          {t}Error{/t}: {t}Please provide password.{/t}
        {elseif $smarty.get.err == 3 or $smarty.get.err == 4}
          {t}Error{/t}: {t}The login / password combination could not be found in the system.{/t}
        {elseif $smarty.get.err == 5}
          {t}Your session has expired. Please login again to continue.{/t}
        {elseif $smarty.get.err == 6}
          {t 1=$core.app_title}Thank you, you are now logged out of %1{/t}.
        {elseif $smarty.get.err == 7}
          {t}Error{/t}: {t}Your user status is currently set as inactive. Please contact your local system administrator for further information.{/t}
        {elseif $smarty.get.err == 8}
          {t}Thank you, your account is now active and ready to be used. Use the form below to login.{/t}
        {elseif $smarty.get.err == 9}
          {t}Error{/t}: {t}Your user status is currently set as pending. This means that you still need to confirm your account creation request. Please contact your local system administrator for further information.{/t}
        {elseif $smarty.get.err == 11}
          {t}Error{/t}: {t}Cookies support seem to be disabled in your browser. Please enable this feature and try again.{/t}
        {elseif $smarty.get.err == 12}
          {t}Error{/t}: {t 1=$core.app_title}In order for %1 to work properly, you must enable cookie support in your browser. Please login again and accept all cookies coming from it.{/t}
        {elseif $smarty.get.err == 13}
          {t}Error{/t}: {t}Your user status is currently set as locked. Please try again later.{/t}
        {/if}
        </b>
      </td>
    </tr>
    {/if}
    {if $login_url != ''}
    <tr align="center">
      <td colspan="2">
        {t 1=$login_url escape=off}Click <a href="%1">here</a> to login.{/t}
      </td>
    </tr>
    {else}
    <tr>
      <td class="label">{t}Login{/t}:</td>
      <td>
        <input accessKey="e" type="text" name="email" value="{$email|default:$smarty.request.email|default:''|escape}" size="30">
        {include file="error_icon.tpl.html" field="email"}
      </td>
    </tr>
    <tr>
      <td class="label">{t}Password{/t}:</td>
      <td>
        <input accessKey="p" type="password" name="passwd" size="20" maxlength="32">
        {include file="error_icon.tpl.html" field="passwd"}
      </td>
    </tr>
    <tr align="center">
      <td colspan="2">
        {t}Login credential may be your email or user id, depending on system configuration.{/t}
      </td>
    </tr>

    <tr align="center">
      <td colspan="2" class="default_white" bgcolor="#006486">
        <label for="remember" accesskey="r">
          <input type="checkbox" id="remember" name="remember" value="1">
          <b>{t}Remember me{/t}</b>
        </label>
      </td>
    </tr>

    <tr align="center">
      <td colspan="2">
        <input type="submit" name="Submit" value="{t}Login{/t}">
      </td>
    </tr>

    <tr align="center">
      <td colspan="2">
        <a href="{$core.rel_url}forgot_password.php{if $smarty.get.email|default:'' != ""}?email={$smarty.get.email|escape:"html"}{/if}">{t}I Forgot My Password{/t}</a>
        {if $core.app_setup.open_signup|default:'' == 'enabled'}<a href="signup.php">{t}Signup for an Account{/t}</a>{/if}
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <strong>* {t}Requires support for cookies and javascript in your browser{/t}</strong>
      </td>
    </tr>
    {/if}
</table>
</form>
{if $anonymous_post}

<div class="note_box">
    {t}NOTE: You may report issues without the need to login by using the following URL:{/t}
    <br /><br />
    <a href="{$core.base_url}post.php">{$core.base_url}post.php</a>
</div>
{/if}

{/block}
