Forums - Edit Button Problem

Author Message

John Smith

Monday 26 February 2007 3:47:08 am

Hi there,

I am using ez3.6.1 and desperately looking for a fix related to caching of forum edit button.

The Problem is:

User A creates a new forum topic and sees the "Edit" button in the full view of that topic, which allows him to edit his post. fine.

User A logs out, user B logs in. Although he is not allowed to edit A's post, he see the "edit" button, when he views the forum thread.

When he presses the button, he gets the "Access dienied" page, which is fine.

Ez claims to have fixed the bug so many times but can't find the fix.

Please help.

Cheers.

Smith

Claudia Kosny

Monday 26 February 2007 4:47:04 am

Hi John

The latest news I heard about this was that there was no good fix available. The reason for this problem is that the views are cached based on the role, not on the single user. So if user A and user B share the same role, they will see the same view. If you would cache by user this would be solved, but you would have quite a lot of cache files.

Check also here:
http://ez.no/community/forum/general/do_you_see_the_edit_button/re_do_you_see_the_edit_button__10
and the bug report in the last post in this thread.

Claudia

John Smith

Monday 26 February 2007 4:57:16 am

Hi Claudia,

Thanks for your kind help. Would it be possible for you to help me in writting the template code for caching by user please.

Cheers.

Smith

Xavier Dutoit

Monday 26 February 2007 5:48:38 am

And don't forget to disable the cache view on the template level (TTL=0)

Otherwise, might be easier to have a bit of javascript that hides the buttons when current user != owner than doing that on the server.

X+

P.S. The problem is still present on the forums on ez too,

http://www.sydesy.com

John Smith

Monday 26 February 2007 5:56:26 am

hi there,

I am using the code in the template named as /design/news/templates/full/forum_topic.tpl

{set-block scope=root variable=cache_ttl}0{/set-block}
{cache-block keys=array($uri_string,$current_user.contentobject_id)}

... tpl code

{/cache-block}

It is not doing anything.

Moreover i am not too good at javascript, can you please help me in that.

Cheers

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 19:14:06
Script start
Timing: Jan 18 2025 19:14:06
Module start 'layout'
Timing: Jan 18 2025 19:14:06
Module start 'content'
Timing: Jan 18 2025 19:14:07
Module end 'content'
Timing: Jan 18 2025 19:14:07
Script end

Main resources:

Total runtime0.8034 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 592.5391152.6250
Module start 'layout' 0.00580.0025 745.164139.4453
Module start 'content' 0.00830.7935 784.6094587.7188
Module end 'content' 0.80180.0015 1,372.328112.4766
Script end 0.8033  1,384.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4099160.0002
Check MTime0.00140.1724160.0001
Mysql Total
Database connection0.00130.161410.0013
Mysqli_queries0.739892.0902650.0114
Looping result0.00090.1061630.0000
Template Total0.777196.720.3885
Template load0.00240.299120.0012
Template processing0.774796.428320.3873
Template load and register function0.00030.035410.0003
states
state_id_array0.00080.103910.0008
state_identifier_array0.00100.120820.0005
Override
Cache load0.00210.2561410.0001
Sytem overhead
Fetch class attribute can translate value0.00090.109330.0003
Fetch class attribute name0.00140.171360.0002
XML
Image XML parsing0.00080.101030.0003
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00080.0935160.0000
String conversion0.00000.000940.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs