Spam protection only for anonymous users/depending on role

Author Message

Kjell Knudsen

Thursday 23 September 2004 1:36:03 am

Hi there,

I'd like to make exceptions for the wash(email) feature depending on roles. I've currently setup

{*Routine to check if user has permission to view e-mails*}
	{let currentuser=fetch('user','current_user')
		ismember=false()}
		{let member_groups=fetch( user, member_of, hash( id, $currentuser.contentobject_id ) )}
			{section loop=$member_groups}
				{section show=$:item.name|eq('E-mail View')}
					{set ismember=true()}
				{/section}
			{/section}
        	{/let}
	        {section show=$ismember}
				{attribute_view_gui attribute=$node.object.data_map.intro}
			</div>
			{$node.object.data_map.body.content.output.output_text}
		{section-else}
			{$node.object.data_map.intro.content.output.output_text|wash("email")}
			</div>
 			{$node.object.data_map.body.content.output.output_text|wash("email")}
		{/section}
	{/let}

But since I want to use this more than once and in several templates I think it would be smoother to edit the template where the wash is actually done. But ... I just can't figure that out/find the template. Wondering if that is done outside of templates. Probably it is. Anyone who can give me a clue as to where I'd look?
Or a better solve for this. I thought of editing/overriding
\templates\content\datatype\view\ezxmltags\link.tpl with the same. But that only brings me half the way.

any clues would be great to have,

-kjell

Kjell Knudsen
http://www.icbl.org

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

Main resources:

Total runtime0.0291 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.3906151.2422
Module start 'layout' 0.00760.0050 739.6328220.7500
Module start 'content' 0.01260.0149 960.3828997.9922
Module end 'content' 0.02740.0016 1,958.375029.9922
Script end 0.0291  1,988.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00268.8603140.0002
Check MTime0.00113.7689140.0001
Mysql Total
Database connection0.00072.299110.0007
Mysqli_queries0.005418.603030.0018
Looping result0.00000.051610.0000
Template Total0.00124.210.0012
Template load0.00092.958610.0009
Template processing0.00041.233910.0004
Override
Cache load0.00061.995910.0006
General
dbfile0.00175.902580.0002
String conversion0.00000.031140.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