Current user is logged?

Author Message

David Santiso

Sunday 23 January 2011 12:03:47 pm

Hi,

If the current user is logged in from any template, what variables I can use to see it?

I've seen that pagelayout template uses

{if $current_user.is_logged_in}

but, for example, the templates that show the content from the nodes, doesn't work.

Thanks,

David

Sylvain Guittard

Sunday 23 January 2011 1:04:36 pm

Hi David,

In the template that show the content of a node, you must use this code:

{def $current_user=fetch( 'user', 'current_user' )}

And then, you can use your code...

Sylvain

http://www.vignevin-epicure.com
http://twitter.com/vignevinEPIcure

David Santiso

Monday 24 January 2011 11:30:21 am

Thank you very much.

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 18 2025 01:56:03
Script start
Timing: Jan 18 2025 01:56:03
Module start 'layout'
Timing: Jan 18 2025 01:56:03
Module start 'content'
Timing: Jan 18 2025 01:56:03
Module end 'content'
Timing: Jan 18 2025 01:56:03
Script end

Main resources:

Total runtime0.6303 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.0234152.6250
Module start 'layout' 0.00610.0036 741.648439.4375
Module start 'content' 0.00970.6188 781.0859496.1953
Module end 'content' 0.62850.0018 1,277.28138.1875
Script end 0.6303  1,285.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5452160.0002
Check MTime0.00140.2169160.0001
Mysql Total
Database connection0.00080.130110.0008
Mysqli_queries0.582792.4356570.0102
Looping result0.00060.0952550.0000
Template Total0.594094.220.2970
Template load0.00210.329320.0010
Template processing0.591993.898420.2959
Template load and register function0.00020.025410.0002
states
state_id_array0.00200.312810.0020
state_identifier_array0.00130.212420.0007
Override
Cache load0.00170.2715190.0001
Sytem overhead
Fetch class attribute can translate value0.00070.109120.0003
Fetch class attribute name0.00120.197330.0004
XML
Image XML parsing0.00030.042020.0001
class_abstraction
Instantiating content class attribute0.00000.001930.0000
General
dbfile0.00280.4428100.0003
String conversion0.00000.001440.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs