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

<metal:block metal:fill-slot="header-title">
	<title><tal:block i18n:translate="">Change Credentials</tal:block> | <span tal:replace="here/site_title" /></title>
</metal:block>

<metal:block fill-slot="body">
	<div class="cleaner">&nbsp;</div>
	<h3 i18n:translate="" class="title-inline">
		Edit credentials:
	</h3>

	<div class="cleaner"></div>

	<tal:block define="username python: request.AUTHENTICATED_USER.getUserName()">

	<tal:block condition="python: username != 'Anonymous User'">
	<tal:block define="user_tool here/getAuthenticationTool;
                       user_obj python:user_tool.getUser(username);">

	<tal:block condition="python: user_obj is not None">
	<tal:block define="user_firstname python:test(here.getSessionUserFirstname(None) is not None,
													here.getSessionUserFirstname(),
													user_tool.getUserFirstName(user_obj));
						user_lastname python:test(here.getSessionUserLastname(None) is not None,
													here.getSessionUserLastname(),
													user_tool.getUserLastName(user_obj));
						user_email python:test(here.getSessionUserEmail(None) is not None,
												here.getSessionUserEmail(),
												user_tool.getUserEmail(user_obj));">

	<form method="post" tal:attributes="action string:${site_url}/processChangeCredentials" class="user-form">
		<div class="field-inline">
			<label for="firstname" i18n:translate="">First name: *</label>
			<br />
			<input type="text" id="firstname" name="firstname:utf8:ustring"
				size="50" maxLength="255" tal:attributes="value user_firstname" />
		</div>
		<div class="field-inline">
			<label for="lastname" i18n:translate="">Last name: *</label>
			<br />
			<input type="text" id="lastname" name="lastname:utf8:ustring"
				size="50" maxLength="255" tal:attributes="value user_lastname" />
		</div>
		<div class="field-inline">
			<label for="email" i18n:translate="">Email address: *</label>
			<br />
			<input type="text" id="email" name="email:utf8:ustring"
				size="50" maxLength="255" tal:attributes="value user_email" />
		</div>
		<div class="field-inline">
			<label for="password" i18n:translate="">Password:</label>
			<br />
			<input type="password" id="password" name="password:utf8:ustring"
				value="" size="25" maxLength="255" />
		</div>
		<div class="field-inline">
			<label for="confirm" i18n:translate="">Password verification:</label>
			<br />
			<input type="password" id="confirm" name="confirm:utf8:ustring"
				value="" size="25" maxLength="255" />
		</div>
		<p i18n:translate="">
			Leave password fields empty to keep the current password.
		</p>
		<div class="field">
			<input type="submit" value="Save changes" i18n:attributes="value" />
		</div>
	</form>

	<span tal:replace="here/delUserSession" />
	</tal:block>
	</tal:block>

	<tal:block condition="python: user_obj is None" i18n:translate="">
		Authenticated user is not a local user. Can't change the credentials of non-local users.
	</tal:block>

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

	<tal:block condition="python: username == 'Anonymous User'" i18n:translate="">
		No user logged in.
	</tal:block>

	</tal:block>

	<div class="cleaner"></div>
</metal:block>

</metal:block>
