Logging user in

Author Message

Glenn MacGregor

Tuesday 18 May 2004 6:06:31 am

Hi All,

I am protecting certain parts of my site by checking the is_logged_in on the current_user variable. This works great, but If the user is not logged in I want to display the /user/login form right in the page I am in. So my template looks like this:

{let current_user=fetch('user', 'current_user') }
Some HTML here
{section show=$current_user.is_logged_in}
All info for logged in users here
{section-else}
Some text about logging in...
{include uri="design:login.tpl"}
{/section}
{/let}

With this I never get the login.tpl to show, I do get the "Some text about logging in..." but that is it. Do I have my uri incorrect?

Also is there a way to disable the "Sign Up" button. I don't want anyone to beable to sing up and enter my protected areas.

Thanks

Glenn

Dominik Pich

Tuesday 18 May 2004 10:03:53 am

Acctually, you would do better to let ez keep track of whether a user is logged in and has the priviliges to do that : set up roles for views and functions
Also IIRC there is an ini setting for how to display the login...

Glenn MacGregor

Tuesday 18 May 2004 11:37:17 am

I would love to let ez handle that, but I couldn't figure out how to do that. So this is the only way I say to handle it.

Any clues??

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

Main resources:

Total runtime0.0254 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.0078151.1953
Module start 'layout' 0.00600.0043 739.2031220.6563
Module start 'content' 0.01020.0136 959.8594997.6484
Module end 'content' 0.02380.0016 1,957.507829.9922
Script end 0.0254  1,987.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002911.2456140.0002
Check MTime0.00124.5403140.0001
Mysql Total
Database connection0.00083.278110.0008
Mysqli_queries0.00259.962730.0008
Looping result0.00000.093810.0000
Template Total0.00114.510.0011
Template load0.00093.404810.0009
Template processing0.00031.089610.0003
Override
Cache load0.00062.416510.0006
General
dbfile0.00145.684380.0002
String conversion0.00000.039440.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