Index: openacs-4/packages/invoices/tcl/util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/util-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/invoices/tcl/util-procs.tcl 16 Aug 2005 20:04:32 -0000 1.1 +++ openacs-4/packages/invoices/tcl/util-procs.tcl 28 Sep 2005 19:08:28 -0000 1.2 @@ -48,3 +48,27 @@ } { db_dml set_default_objects {} } + +ad_proc -public iv::util::get_x_field { + -party_id:required + -offer_id:required +} { + Creates the x-field for the email (for party authentification) +} { + db_1row get_offer_creator_data {} + return [ns_sha1 "$party_id $user_password $user_salt"] +} + +ad_proc -public iv::util::valid_x_field_p { + -party_id:required + -offer_id:required + -x_field:required +} { + Verifies the x-field in the email +} { + # generate the expected x-variable + set expected_x [iv::util::get_x_field -party_id $party_id -offer_id $offer_id] + + # Check if both values are the same and return t or f + return [string equal $x_field $expected_x] +}