prevent "spoofing" sender's email address in tip a friend

Author Message

Herman Hardenbol

Thursday 09 February 2006 3:09:26 am

I have the standard "Tip a friend" option turned on. In my intranet installation everybody needs to logon. How could I force users to use there own user name en user email as a sender and not changed the prefilled name and email? (in ezpublish 3.6.2)

I am looking for a more secure solution than just making the HTML fields read only.

Any small hint is more than welcome. Thanks a lot.

Martin Lekvall

Friday 10 February 2006 2:39:58 am

Hi

This is an idea, not tested.
You might want to override the tipafriend-template and make the email and name-formfields hidden. The value of these fields are prefilled with address automagicaly if user is logged in, right?

For usabillity i guess printing out that "tip will sent from John Doe (john@foo.bar)" or similar is a good idea.

/martin

EzP 3.5.0, OE 2.0
RH-EL3 2.4, mySql 4.1.7, php 4.3.9, apache 1.3.33

Herman Hardenbol

Sunday 12 February 2006 1:54:46 pm

Thanks Martin. I was just about to hack the kernel, when I found that the kernel supplies the username and useremail for the logged in user account when name and email are not sent from the HTML form.

In /templates/content/tipafriend.tpl I have removed the input fields for sender's name and sender's email and that's all!! I am happy. :-)

Nice solution for my intranet environment where everybody needs to login and everybody has an email address.

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 22:36:55
Script start
Timing: Jan 18 2025 22:36:55
Module start 'layout'
Timing: Jan 18 2025 22:36:55
Module start 'content'
Timing: Jan 18 2025 22:36:56
Module end 'content'
Timing: Jan 18 2025 22:36:56
Script end

Main resources:

Total runtime1.5032 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1328152.6406
Module start 'layout' 0.00570.0044 740.773439.4766
Module start 'content' 0.01021.4917 780.2500495.5313
Module end 'content' 1.50190.0013 1,275.78138.1094
Script end 1.5032  1,283.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2231160.0002
Check MTime0.00150.0968160.0001
Mysql Total
Database connection0.00070.047610.0007
Mysqli_queries1.462197.2639570.0257
Looping result0.00050.0341550.0000
Template Total1.458397.020.7292
Template load0.00180.121320.0009
Template processing1.456596.890720.7282
Template load and register function0.00030.019010.0003
states
state_id_array0.00250.166310.0025
state_identifier_array0.00240.160220.0012
Override
Cache load0.00150.0984160.0001
Sytem overhead
Fetch class attribute can translate value0.00060.037120.0003
Fetch class attribute name0.00090.061830.0003
XML
Image XML parsing0.00020.016120.0001
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00060.0432100.0001
String conversion0.00000.000540.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs