<metal:block use-macro="python:here.standard_template_macro('light')">

<metal:block metal:fill-slot="header-title">
	<title><tal:block i18n:translate="">Login Form</tal:block> | <span tal:replace="here/site_title" /></title>
</metal:block>
<metal:block metal:fill-slot="head">
	<script>
		$(function() {
			$('#__ac_name').focus();
		});
	</script>
</metal:block>

<metal:block metal:fill-slot="body">

<tal:block define="came_from python:request.get('came_from', '');
				action_url string:logged_in;
				action_url_logout_directly string: 'logout';
				auth_tool python:here.getAuthenticationTool()">

<tal:block define="user python:request.AUTHENTICATED_USER.getUserName()"
           condition="python:user!='Anonymous User'">

<h1 i18n:translate="">Log out</h1>
<div class="tips_box" tal:condition="python:user!='Anonymous User'">
    <div class="tips_box_title" i18n:translate="">Tips</div>
    <ul>
        <li i18n:translate="">Having trouble logging out? Make sure that cookies are allowed in your browser</li>
        <li i18n:translate="">If you opened child browser windows from this one, those will maintain your authentication</li>
    </ul>
</div>

<div class="log1"><tal:block  i18n:translate="">You are logged in as:</tal:block> <em><span tal:replace="user" /></em>.</div>
<div class="log1"><a tal:define="url python:here.absolute_url()" tal:attributes="href string:${url}/logout" i18n:translate="">Logout</a></div>
<br />
<tal:block tal:define="roles python:here.getAuthenticationTool().getAuthenticatedUserRoles()">
	<tal:block tal:condition="roles">
		<tal:block i18n:translate="">You have the following rights in this portal:</tal:block><br />
		<ul>
			<li tal:repeat="item roles">
				<span tal:replace="python:', '.join(item[0])" />
				on
				<a tal:define="object python:here.utGetObject(item[1])"
					tal:attributes="href string:${object/absolute_url}/"
					tal:content="object/title_or_id" />
			</li>
		</ul>
	</tal:block>
	<tal:block tal:condition="not:roles" i18n:translate="">
		You have no special rights in this portal.
	</tal:block>
</tal:block>
<br />
<a i18n:translate="" tal:attributes="href string:${site_url}/changecredentials_html">Change user credentials</a>
<br />
</tal:block>

<tal:block define="user python:request.AUTHENTICATED_USER.getUserName()" condition="python:user=='Anonymous User'">
<h1 i18n:translate="">Log in</h1>
<div class="tips_box" tal:condition="python:user=='Anonymous User'">
    <div class="tips_box_title" i18n:translate="">Tips</div>
    <ul>
        <li i18n:translate="">Having trouble logging in? Make sure that cookies are allowed in your browser</li>
        <li i18n:translate="">Don't forget to logout or exit your browser when you're done</li>
        <li i18n:translate="">Letting your browser to remember your username or password on this machine can be dangerous since other people might use this account to log in</li>
        <li i18n:translate="">Forgot your password? Use the <a tal:attributes="href string:${auth_tool/absolute_url}/recover_password" i18n:name="recover-link" i18n:translate="">password recovery</a> form.</li>
    </ul>
</div>

<h2 i18n:translate="">Existing user</h2>
<form tal:attributes="action action_url" method="post" class="login-form">

<tal:block define="retry python:request.get('retry', '')">
<div id="log1" tal:condition="python:retry=='1'" i18n:translate="">
	The username or password you provided are incorrect or this account doesn't have
	enough rights to access this resource. Please try again.
</div>
</tal:block>

<div tal:condition="python:came_from!=''">
	<input type="hidden" name="came_from" tal:attributes="value came_from" />
</div>

<div class="field">
	<label for="__ac_name" i18n:translate="">Username</label>
	<input type="text" name="__ac_name" id="__ac_name" size="20"
		tal:attributes="value python:request.get('__ac_name', '')" />
</div>

<div class="field">
	<label for="__ac_password" i18n:translate="">Password</label>
	<input type="password" name="__ac_password" id="__ac_password" size="20" />
</div>

<div class="field">
	<input type="submit" name="submit" value=" Login " i18n:attributes="value" />
</div>

</form>

<h2 i18n:translate="">New user</h2>

<p i18n:translate="">First
	<a i18n:name="create_an_account" i18n:translate="" href="requestrole_html">
		create an account
	</a>
	on this server and then return to this page to log in.
	The newly created user will have no role on this portal,
	<a i18n:name="contact_the_Webmaster" i18n:translate="" href="feedback_html">
		contact the Webmaster
	</a>
	if you need one.</p>

</tal:block>
</tal:block>

</metal:block>
</metal:block>
