A small problem in the login.tpl that was solved

Author Message

Esben Maaløe

Monday 21 July 2003 9:41:12 am

I have an entry page showing the names of a bunch of designers. These designers are of course objects of a custom class I made....

Now when the user clicks a designer name, he get's a surprise ! He has to register or login to actually view the designer...

My approach is this:

{section show=fetch(user,current_user).is_logged_in}
{* CODE THAT SHOWS ALL THE SAUCY DESIGNER DETAILS*}
{section-else}
{include uri="design:user/login.tpl"}
{/section}

Clever am I not ? :)

Only one problem - The login page thinks that there has been issued a warning

the section: {section show=$User:warning.bad_login}

is shown

How can I deal with this ?

NEWSFLASH:
I nailed it myself - But having written the post I might as well share:

it seems that for some reason $User:warning.bad_login returns something that is evaluated as true - the cure is changing the line to:

{section show=and($User:warning.bad_login) }

(the same applies for the {section-else} )

------
login.tpl, bad_login, warning

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 04:15:57
Script start
Timing: Jan 31 2025 04:15:57
Module start 'layout'
Timing: Jan 31 2025 04:15:57
Module start 'content'
Timing: Jan 31 2025 04:15:57
Module end 'content'
Timing: Jan 31 2025 04:15:57
Script end

Main resources:

Total runtime0.0176 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.2813151.2266
Module start 'layout' 0.00520.0027 739.507836.6797
Module start 'content' 0.00790.0073 776.187586.0781
Module end 'content' 0.01520.0024 862.265629.9922
Script end 0.0176  892.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002916.5090140.0002
Check MTime0.00126.9374140.0001
Mysql Total
Database connection0.00084.825710.0008
Mysqli_queries0.002413.409130.0008
Looping result0.00000.074510.0000
Template Total0.00158.610.0015
Template load0.00126.596310.0012
Template processing0.00031.919510.0003
Override
Cache load0.00084.763510.0008
General
dbfile0.002815.966280.0004
String conversion0.00000.040640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs