Forums / General / Forums - Edit Button Problem

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

eZ debug

Timing: Jan 18 2025 16:10:04
Script start
Timing: Jan 18 2025 16:10:04
Module start 'content'
Timing: Jan 18 2025 16:10:05
Module end 'content'
Timing: Jan 18 2025 16:10:05
Script end

Main resources:

Total runtime0.6915 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.8203180.8438
Module start 'content' 0.00760.5672 769.6641592.7969
Module end 'content' 0.57490.1166 1,362.4609337.6953
Script end 0.6914  1,700.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5481210.0002
Check MTime0.00140.2057210.0001
Mysql Total
Database connection0.00080.117610.0008
Mysqli_queries0.624890.35162020.0031
Looping result0.00190.26962000.0000
Template Total0.662095.720.3310
Template load0.00200.289520.0010
Template processing0.660095.449020.3300
Template load and register function0.00010.015010.0001
states
state_id_array0.00090.130910.0009
state_identifier_array0.00120.172420.0006
Override
Cache load0.00160.2303410.0000
Sytem overhead
Fetch class attribute can translate value0.00170.240340.0004
Fetch class attribute name0.00080.122260.0001
XML
Image XML parsing0.00090.128640.0002
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00190.2743270.0001
String conversion0.00000.001130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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