Search

A new extension, "Fingerprint" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Nice idea! May take it for a test drive on the next Events website we build in the studio. Thanks for putting in the effort and time on this one :)

Nice, thanks for releasing this as a separate extension!

What I really like about this extension is how you've crossed the gap between extensions that need to store stuff in a session, and between extensions that need to read stuff from the session. The Session Monster attempted this too, but I think this approach is much neater.

I'll give it a whirl to see if I can spot any problems :)

Fingerprint allows you to create a fingerprint of the hidden inputs for a given form, ensuring that users do not change the values of the hidden inputs prior to submitting the form.

Great idea! this could potentially allow for less processing/datastorage on the backend in custom events.

Very very cool, good work! Don't forget to chuck it on Symphony Extensions too!

Thanks for putting in the effort and time on this one :)

It was a fun challenge for me :)

What I really like about this extension is how you've crossed the gap between extensions that need to store stuff in a session, and between extensions that need to read stuff from the session. The Session Monster attempted this too, but I think this approach is much neater.

It's the result of my rambling in my Stripe thread. Thanks for the idea to save the fingerprint in a session instead of passing them via another hidden input; it's definitely better performance wise and all that more secure.

I'll give it a whirl to see if I can spot any problems :)

I've only tested it with my current project, so please see if you can find any mistakes or break it in any way.

Don't forget to chuck it on Symphony Extensions too!

Indeed, it is. I accidentally added it with an old release date and the extension website has not viewed the updated meta.

Pullrequest sent. :-)

Pullrequest sent. :-)

Thanks! I also made some additional changes after reading the discussion you had with @creativedutchmen on github.

Thanks guys!

Not sure if this is exactly the same use case, but wouldn't omitting hidden fields in the first place and using Default Event Values instead be a more elegant and simpler solution?

Not sure if this is exactly the same use case, but wouldn't omitting hidden fields in the first place and using Default Event Values instead be a more elegant and simpler solution?

Default Event Values only works with page parameters and static values. Fingerprint is good for situations where you need to create the values dynamically in XSLT templates to take advantage of parameters, static values, data sources, and making calculations.

Ah, allright then, thanks for clearing things up.

This is a great extension, currently I am using the paypal extension and I have some JavaScript to calculate the total on the page. Total is based on the value of a few fields, it basically takes the ticket price(there are different ticket levels) and multiplies it by the number of tickets. How would I go about dynamically setting the value in XSLT. I am assuming some how I would need symphony to generate an order confirmation page, which would display all the information they entered on the previous page including the total.

Any idea who I would go about doing this?

Looks useful, starred for checking out on Monday!

Default Event Values also sounds useful, hadn't come across that, so thanks Jens!

Edit: Github is down for maintenance, so I'll star it later… assuming I remember :)

Yeah, Default Event Values is f-a-n-t-a-s-t-i-c.

This is exactly what I've been looking for! Thank you!!

When I use fingerprint with a Select Box Link field as a hidden input, it tells me fingerprint does not match. No problem with plain text input fields though.

Post your form and related XSLT.

Sorry, the select box link was my fault. I was using the value, not the id of the entry. However, I think there is another problem:

When a checkbox field is selected, the fingerprint fails. If the checkbox fields are not selected, then the form will be sent successfully (but select box link field will not save).

Edit: Actually this is a problem with using Form Controls. The checkbox template for some reason creates a hidden field with value 'no' and then the actual checkbox input. Changing this to a basic checkbox input fixes it.

<form method="post">

    <fieldset>
        <legend>Add new listing</legend>

        <xsl:call-template name="form:validation-summary"/>

        <label>
            Title<br/>
            <xsl:call-template name="form:input">
                <xsl:with-param name="handle" select="'title'"/>
            </xsl:call-template>
        </label>

        <label>
            Description<br/>
            <xsl:call-template name="form:textarea">
                <xsl:with-param name="handle" select="'description'"/>
            </xsl:call-template>
        </label>

        <label>
            Room Type<br/>
            <xsl:call-template name="form:select">
                <xsl:with-param name="handle" select="'room-type'"/>
                <xsl:with-param name="options" select="/data/listing-fields/room-type/options/*"/>
                <xsl:with-param name="value" select="'Room'"/>
            </xsl:call-template>
        </label>

        <label>
            Dates<br/>
        </label>
            <input name="fields[dates][start][]" type="text"/>
            to
            <input name="fields[dates][end][]" type="text"/>

        <label>
            Price<br/>
            <xsl:call-template name="form:input">
                <xsl:with-param name="handle" select="'price'"/>
            </xsl:call-template>
        </label>

        <label>
            Address<br/>
            <xsl:call-template name="form:input">
                <xsl:with-param name="handle" select="'address'"/>
            </xsl:call-template>
        </label>

        <label>
            Gender<br/>
            <xsl:call-template name="form:checkbox-list">
                <xsl:with-param name="handle" select="'gender'"/>
                <xsl:with-param name="options" select="/data/listing-fields/gender/options/*"/>
            </xsl:call-template>
        </label>

        <label>
            Climate Control<br/>
            <xsl:call-template name="form:checkbox-list">
                <xsl:with-param name="handle" select="'climate-control'"/>
                <xsl:with-param name="options" select="/data/listing-fields/climate-control/options/*"/>
            </xsl:call-template>
        </label>

        <label>
            Utilities<br/>
            <xsl:call-template name="form:checkbox-list">
                <xsl:with-param name="handle" select="'utilities'"/>
                <xsl:with-param name="options" select="/data/listing-fields/clime-control/options/*"/>
            </xsl:call-template>
        </label>

        <label>
            Bathroom<br/>
            <xsl:call-template name="form:select">
                <xsl:with-param name="handle" select="'bathroom'"/>
                <xsl:with-param name="options" select="/data/listing-fields/bathroom/options/*"/>
                <xsl:with-param name="value" select="'Shared'"/>
            </xsl:call-template>
        </label>

        <label>
            Closets<br/>
            <xsl:call-template name="form:select">
                <xsl:with-param name="handle" select="'closets'"/>
                <xsl:with-param name="options" select="/data/listing-fields/closets/options/*"/>
                <xsl:with-param name="value" select="'0'"/>
            </xsl:call-template>
        </label>

        <label>
            Laundry<br/>
            <xsl:call-template name="form:checkbox-list">
                <xsl:with-param name="handle" select="'laundry'"/>
                <xsl:with-param name="options" select="/data/listing-fields/laundry/options/*"/>
            </xsl:call-template>
        </label>

        <label>
            <xsl:call-template name="form:checkbox">
                <xsl:with-param name="handle" select="'doorman'"/>
            </xsl:call-template>
            Doorman
        </label>

        <label>
            <xsl:call-template name="form:checkbox">
                <xsl:with-param name="handle" select="'elevator'"/>
            </xsl:call-template>
            Elevator
        </label>

        <label>
            <xsl:call-template name="form:checkbox">
                <xsl:with-param name="handle" select="'gym'"/>
            </xsl:call-template>
            Gym
        </label>

        <input name="fields[user]" type="hidden" value="21"/>
        <input type="hidden" name="redirect" value="/done" />

        <input name="action[save-entry]" type="submit" value="Submit"/>
    </fieldset>

</form>

The hidden field created by Form Controls is intentional. Otherwise you wouldn't be able to reset the value to "no" once it has been set to "yes". This has to do with browser behaviour.

Ah I see. Then this creates another dilemma. When someone tries to edit an entry from the frontend, then I would need the hidden "no" input (in case they wish to uncheck the checkbox). But if the checkbox is checked, then Fingerprint won't work again b/c it conflicts with the hidden input. What to do?

Perhaps an interface like Default Event Values where one can choose which fields are being checked?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details