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

eZ debug

Timing: Jan 18 2025 15:58:12
Script start
Timing: Jan 18 2025 15:58:12
Module start 'content'
Timing: Jan 18 2025 15:58:12
Module end 'content'
Timing: Jan 18 2025 15:58:13
Script end

Main resources:

Total runtime0.8072 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.7031180.8438
Module start 'content' 0.00730.6569 768.5469578.5938
Module end 'content' 0.66420.1429 1,347.1406340.7500
Script end 0.8071  1,687.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5408210.0002
Check MTime0.00150.1900210.0001
Mysql Total
Database connection0.00090.115210.0009
Mysqli_queries0.720989.30971970.0037
Looping result0.00190.23641950.0000
Template Total0.778096.420.3890
Template load0.00190.237520.0010
Template processing0.776096.145120.3880
Template load and register function0.00010.009010.0001
states
state_id_array0.00080.096110.0008
state_identifier_array0.00120.154120.0006
Override
Cache load0.00170.2121810.0000
Sytem overhead
Fetch class attribute can translate value0.00090.109230.0003
Fetch class attribute name0.00160.193150.0003
XML
Image XML parsing0.00070.087230.0002
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00360.4417270.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
13content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs