Forums / Setup & design / Spam protection only for anonymous users/depending on role

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