site_access.allowed problem

Author Message

Alessandro Cipriani

Thursday 19 February 2004 7:33:12 am

hi all
i placed my override of user/login.tpl in my pagelayout
id'like it to display the login form if the user is anonymous and to display the "logout" link (without form!!) in the user is logged.

that's the code:

<form method="post" action={"/user/login/"|ezurl}>

{*<div class="maincontentheader">
<h1>{"Login"|i18n("design/standard/user")}</h1>
</div>*}

{section show=$User:warning.bad_login}
<div class="warning">
<h2>{"Could not login"|i18n("design/standard/user")}</h2>
<ul>
<li>{"A valid username and password is required to login."|i18n("design/standard/user")}</li>
</ul>
</div>
{section-else}

{section show=$site_access.allowed|not}
<div class="block">
<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="block">
<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>

<input type="hidden" name="RedirectURI" value="{$User:redirect_uri}" />
{/section}
{section-else}

{* HERE I WANT TO DISPLAY THE STRING *}
{section show=$site_access.allowed}
{*welcome hoe, logout*}

{/section}
</form>

i've seen that i check if a user is not logged with

{section show=$site_access.allowed|not}

how to know if is the user logged?

best regards

alessandro

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 19 2025 12:53:40
Script start
Timing: Jan 19 2025 12:53:40
Module start 'layout'
Timing: Jan 19 2025 12:53:40
Module start 'content'
Timing: Jan 19 2025 12:53:40
Module end 'content'
Timing: Jan 19 2025 12:53:40
Script end

Main resources:

Total runtime0.0225 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.0087 590.2891152.6250
Module start 'layout' 0.00870.0041 742.914139.4453
Module start 'content' 0.01280.0075 782.359489.3203
Module end 'content' 0.02040.0021 871.679730.3047
Script end 0.0224  901.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003013.2217140.0002
Check MTime0.00114.9322140.0001
Mysql Total
Database connection0.00177.457610.0017
Mysqli_queries0.003515.609530.0012
Looping result0.00000.088910.0000
Template Total0.00167.310.0016
Template load0.00093.778510.0009
Template processing0.00083.506510.0008
Override
Cache load0.00052.362410.0005
General
dbfile0.002611.509280.0003
String conversion0.00000.063540.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