{include file='r_basic/header.tpl' login_page=true}

{if $agent_browser_is_really_old}
    <p class="errorbig ui-corner-all">
        {$i.basic_old_any}<br />
        <small>{$agent_browser} {$agent_version}: {$agent_agent}</small>
    </p>
{/if}

<noscript>
    <div class="story">
        <p class="errorbig ui-corner-all">
            {$i.pages_noscript_head}
        </p>
        <p>{$i.pages_noscript|markdown}</p>
    </div>
</noscript>

{is_https_active_assign}
{if $https_warning && !$https_active}
    <div id="httpswarn" class="warningsmall ui-corner-all" style="margin: 1vw;">
        <span style="display: inline-block; padding-bottom: 5px;">{$i.pages_no_https|markdown}</span>
        <a href="{site_url url="auth/login" https=1}">{$i.pages_https_login}</a>
    </div>
    <br />
{else}
    <br />
{/if}

{if isset($pre_login_message)}
    <div class="warning ui-corner-all">
        {$pre_login_message}
    </div>
    <br />
{/if}

{if isset($error_main)}
    {foreach from=$error_main item='error'}
        <p class="errorbig ui-corner-all">
            {$error}
        </p>
    {/foreach}
    <br />
{/if}

{if !$agent_browser_is_really_old}
    <form action="{site_url url="auth/login/`$login_segment3`/`$login_segment4`"}" method="post" id="loginform" style="margin: 0.5vw 1vw;">
        {if $login_force_username}
            {include file='r/input.tpl' name="login_username" title="auth_username" default=$staff_last_login_name class="required"}
        {else}
            {include file='r/select.tpl' name="login_userid" title="auth_user"
                list=$staff_list id="id" text="fullname" default=$staff_last_login class="required"}
        {/if}
        {include file='r/password.tpl' name="login_password" title="auth_password" class="us_password required"
            filter_extra='autofocus="autofocus"'}
        {if $enable_2fa_login}
            {include file='r/input.tpl' name="login_otp_code" title="auth_the_2fa"
                maxlength=10 default='' filter_extra='autocomplete="off"'}
        {/if}
        <input type="hidden" name="login_id" value="{$auth_login_hash}" />
        {include file='r_icons/login.tpl'}
    </form>
{/if}

{if $nightly_shall_run}
    <object id="nightly_run" type="text/html" data="{site_url url='/nightly'}" style="height:3px; width:3px;"></object>
{/if}
{if $nightlycheck_shall_run}
    <object id="nightly_run" type="text/html" data="{site_url url='/nightlycheck'}" style="height:3px; width:3px;"></object>
{/if}
{if $nightlyworkhours_shall_run}
    <object id="nightly_run" type="text/html" data="{site_url url='/nightlyworkhours'}" style="height:3px; width:3px;"></object>
{/if}


{include file='r_basic/footer.tpl'}
