Return to Snippet

Revision: 36582
at November 23, 2010 19:31 by gerhardsletten


Initial Code
<form method="post" action={"/user/login/"|ezurl} class="styled">
{def $current_user = fetch( 'user', 'current_user' )}
{if $current_user.is_logged_in}
    <p>Logged in as {$current_user.contentobject.name|wash}<br />
	<a href={"/user/logout"|ezurl}>Logout</a></p>
{else}
<p>Login</p>
<div class="block">
	<label for="username">Brukernavn</label>
	<input type="text" id="username" name="Login" />
</div>
<div class="block">
	<label for="password">Passord</label>
	<input type="password" id="password" name="Password" />
</div>
<div class="block">
	<button type="submit" name="LoginButton">
		<span>Logg inn</span>
	</button>
</div>
<input type="hidden" name="RedirectURI" value="{$node.url_alias}" />
<a href={'layout/set/ajax/user/forgotpassword/'|ezurl} class="passforgot nyroModal">Glemt passord</a>
{/if}
</form>

Initial URL


Initial Description
For redirect back to same place on logout, add this your site.ini.append.php:

[UserSettings]
RedirectOnLogoutWithLastAccessURI=enabled

Initial Title
Redirect on login and logout to custom place

Initial Tags


Initial Language
eZ Publish