Login box

Author Message

David Karlsen

Tuesday 02 September 2003 8:17:56 am

Hi,

How can I display a text field like "You are logged inn as <username>" when a user has logged in or "You are not logged in" when the user hasn't??

Also, how could I display a password box that disappears when the user has logged in?

Paul Borgermans

Tuesday 02 September 2003 9:11:54 am

Use something like (from the admin pagelayout):

{section show=eq($current_user.contentobject_id,$anonymous_user_id)}
<a class="menuheadlink" href={"/user/login/"|ezurl}>{'Login'|i18n('design/standard/layout')}</a>
{section-else}
<a class="menuheadlink" href={"/user/logout/"|ezurl}>{'Logout'|i18n('design/standard/layout')}</a> ({$current_user.contentobject.name|wash})
{/section}

Like this, the password box is only displayed once for logging in.

Take a look at the other templates in admin/standard, you can learn/borrow a lot from there

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:11:38
Script start
Timing: Jan 31 2025 06:11:38
Module start 'layout'
Timing: Jan 31 2025 06:11:38
Module start 'content'
Timing: Jan 31 2025 06:11:39
Module end 'content'
Timing: Jan 31 2025 06:11:39
Script end

Main resources:

Total runtime1.3248 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.0078151.1953
Module start 'layout' 0.00500.0020 739.203136.6016
Module start 'content' 0.00701.3168 775.8047918.7500
Module end 'content' 1.32380.0009 1,694.55478.0469
Script end 1.3247  1,702.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2482160.0002
Check MTime0.00130.0979160.0001
Mysql Total
Database connection0.00060.045810.0006
Mysqli_queries1.277696.4390540.0237
Looping result0.00050.0372520.0000
Template Total1.296097.820.6480
Template load0.00190.144920.0010
Template processing1.294197.681020.6470
Template load and register function0.00130.100010.0013
states
state_id_array0.00070.053010.0007
state_identifier_array0.00160.124320.0008
Override
Cache load0.00150.1125170.0001
Sytem overhead
Fetch class attribute can translate value0.00120.090220.0006
Fetch class attribute name0.00340.257930.0011
XML
Image XML parsing0.00060.041820.0003
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00260.1935170.0002
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs