Forums / Setup & design / Embedded / In-line login

Embedded / In-line login

Author Message

Bruce Morrison

Tuesday 22 July 2003 2:23:59 am

I have a site that will have a "logged in" and "non logged in" view. I want to have the username/password form fields be embedded in each page and have these replaced with a message like "you are logged in as xyz" displayed if a user is logged in. I have managed to do this.

When an incorrect login/password is entered the login page and error message are returned in {$module_result.content} and end up as the main page content. As a result I end up with 2 login boxes displayed on the page, one in the pagelayout and the one produced with the error in the main content.

I want the error to be displayed under the login boxes and {$module_result.content} to contain the content for the current page.

I have the following in siteaccess/sitename/site.ini.append

[SiteAccessSettings]
RequireUserLogin=false
LoginPage=embedded

Is what I'm trying to do possible or does it need to handled another way?

Cheers
Bruce
designIT

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bjørn Kaarstein

Tuesday 22 July 2003 2:49:02 am

I think I might have a solution.

If you place your override login.tpl in a layer, like this:

<div id="loginform" style="position:absolute; left:811px; top:160px; width:135px; height:69px; z-index:6; visibility: visible">

- [The entire login form ] -

</div>

I think you'll get your error message at the proper place, without an extra login-window. If you need, I can post the entire login.tpl.

Regards Bjørn

Bruce Morrison

Wednesday 23 July 2003 1:18:22 am

Hi Bjørn

Yes please post the entire login.tpl file. I'm not sure how having the lohin form in the <div> will enable what is required but will look into your login.tpl

Cheers
Bruce
designIT

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bjørn Kaarstein

Wednesday 23 July 2003 5:07:09 am

Hi Bruce.

My login.tpl is placed in design\mydesign\override\templates\user, and goes like this:

<div id="kunde" style="position:absolute; left:800px; top:120px; width:154px; height:192px; z-index:5; visibility: visible">
<img src={"kunde.gif"|ezimage} width="154" height="192"></div>
<div id="kundeweb" style="position:absolute; left:811px; top:160px; width:135px; height:69px; z-index:6; visibility: visible">

<form method="post" action={"/user/login/"|ezurl}>

<div class="text">
<label for="id1">{"Login"|i18n("design/standard/user")}</label><div class="labelbreak"></div>
<input class="halfbox" type="text" size="10" name="Login" id="id1" value="{$User:login}" />
</div>
<div class="text">
<label for="id2">{"Password"|i18n("design/standard/user")}</label><div class="labelbreak"></div>
<input class="halfbox" type="password" size="10" name="Password" id="id2" value="" />
</div>

<div class="buttonblock">
<input class="defaultbutton" type="submit" name="LoginButton" value="{'Login'|i18n('design/standard/user','Button')}" />
{*<input class="button" type="submit" name="RegisterButton" value="{'Sign Up'|i18n('design/standard/user','Button')}" />*}

</div>
<br /><br /><br />
{section show=$User:warning.bad_login}
<h1>{"Could not login"|i18n("design/standard/user")}</h1>
<ul>
<li>{"A valid username and password is required to login."|i18n("design/standard/user")}</li>
</ul>
{section-else}

{section show=$site_access.allowed|not}
<div class="warning">
<h1>{"Access not allowed"|i18n("design/standard/user")}</h1>
<ul>
<li>{"You are not allowed to access %1."|i18n("design/standard/user",,array($site_access.name))}</li>
</ul>
</div>
{/section}

{/section}
<input type="hidden" name="RedirectURI" value="/content/view/full/19" />

</form>

</div>

<div id="main-area" style="position:absolute; left:194px; top:319px; width:433px; height:207px; z-index:0; visibility: visible">
<table width="570" border="0" cellspacing="0" cellpadding="0" class="text">

<tr>
<td align="right" valign="top" class="header">
Velkommen til KundeWeb!<br><hr color="#000000" noshade size="1" width="100%"></td>
</tr>

<tr><td valign="top" align="center">Logg inn på høyre side.<br />

<hr color="#000000" noshade size="1" width="100%">

</td>
</tr>
</table>

You can see the result here if you try with a bad login:
http://www.krogsrudsag.no/user/login