Forums / Setup & design / Display Template collectedinfo/content/nodeid

Display Template collectedinfo/content/nodeid

Author Message

Lars Eirik R

Thursday 17 December 2009 2:53:05 am

Hi.

Is there a way to have the result page after a form has been submitted not redisplay it self?

I find it somewhat odd that i can retrigger the page /collectedinfo/1301 from other computers and actually have it display the same text as i get when infront of the computer where i submitted the variables.

Do i have to use a redirect function or similar if a variable has not been posted sucessfully? Is this not soemthing the framework actually should handled itself ?

Thanks for a great product guys!

Peter Keung

Thursday 17 December 2009 8:51:33 am

This article by Paul Wilson is a good intro to what eZ Publish forms can do:

http://share.ez.no/articles/ez-publish/how-to-create-ez-publish-forms/

Page 3 is particularly useful, as it explains the settings in collect.ini (see the [DisplaySettings] block):

http://share.ez.no/articles/ez-publish/how-to-create-ez-publish-forms/(page)/3

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Lars Eirik R

Friday 18 December 2009 8:19:59 am

Thanks Peter.

I have already managed to creat my form and it is working as intented.

My questions was mere , how can i make sure no other user can access the confirmation page after the submission?

Should i use the http object and check that a given variable was set or is there another way to do this?

In my case, this page actually outputs a javascript which sends info to a 3rd party which monitors the number of times someone actually has submitted the form.

If another user freely may visit this page , than these statistics will not be correct.

Any other ideas guys?

Nicolas Pastorino

Tuesday 26 January 2010 2:51:01 am

Hei!,

Not knowing whether you actually managed to solve the issue, here are a few hints that might help.

First, in collect.ini, the following configuration directives allow for controlling the information collection's system behaviour right after data was collected :

[DisplaySettings]
# result   - Display IC result, for instance poll result or your form data
# redirect - Redirect to a specific url
# node     - Redirect back to content node
Display=result
# Matches class id or identifier to information collection type
DisplayList[]
#DisplayList[poll]=result
DisplayAttribute=collection_display
# The url to redirect to if DisplayHandling is set to redirect
RedirectURL=/
# Matches class id or identifier to information collection type
RedirectURLList[]
RedirectURLAttribute=collection_redirect

However, i am not sure this blocks the '/collectedinfo/1301' page from being viewed. The latter may contain sensitive data, and/or should not be hit without having submitted the data collection form, this potentially damaging the collected data's relevancy (this seems to be your case, am i wrong ?). One solution (not the cleanest one but can't think of another right now) could be to push some logic in the result template ( content/collectedinfo/form.tpl or the one you defined in collect.ini [InfoSettings] . TypeList ), like testing whether the page was reached after a form submission, or if the current user already has voted for this collection, etc..

Hope it helps,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

eZ debug

Timing: Jan 18 2025 02:19:37
Script start
Timing: Jan 18 2025 02:19:37
Module start 'content'
Timing: Jan 18 2025 02:19:38
Module end 'content'
Timing: Jan 18 2025 02:19:39
Script end

Main resources:

Total runtime1.0500 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.8438180.8125
Module start 'content' 0.00721.0390 768.6563609.6406
Module end 'content' 1.04630.0036 1,378.296946.0703
Script end 1.0499  1,424.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2803140.0002
Check MTime0.00120.1169140.0001
Mysql Total
Database connection0.00090.082410.0009
Mysqli_queries1.002495.4726630.0159
Looping result0.00060.0590610.0000
Template Total1.020397.220.5102
Template load0.00250.236520.0012
Template processing1.017896.937020.5089
Template load and register function0.00010.010010.0001
states
state_id_array0.00150.139910.0015
state_identifier_array0.00110.101520.0005
Override
Cache load0.00170.1647330.0001
Sytem overhead
Fetch class attribute can translate value0.00050.046530.0002
Fetch class attribute name0.00110.100970.0002
XML
Image XML parsing0.00160.154430.0005
class_abstraction
Instantiating content class attribute0.00000.001280.0000
General
dbfile0.00130.1191310.0000
String conversion0.00000.000730.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs