Index: openacs-4/packages/invoices/tcl/invoices-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/invoices-callback-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/invoices/tcl/invoices-callback-procs.tcl 28 Sep 2005 17:19:12 -0000 1.3 +++ openacs-4/packages/invoices/tcl/invoices-callback-procs.tcl 28 Sep 2005 19:08:28 -0000 1.4 @@ -125,6 +125,12 @@ } { } +ad_proc -public -callback iv::offer_accepted { + {-offer_id:required} + {-party_id:required} +} { +} + ad_proc -public -callback contacts::populate::organization::customer_attributes -impl invoices { {-list_id:required} } { 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] +} Index: openacs-4/packages/invoices/tcl/util-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/util-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/invoices/tcl/util-procs.xql 16 Aug 2005 20:04:32 -0000 1.1 +++ openacs-4/packages/invoices/tcl/util-procs.xql 28 Sep 2005 19:08:28 -0000 1.2 @@ -26,4 +26,15 @@ + + + + select u.password as user_password, u.salt as user_salt + from users u, acs_objects o + where u.user_id = o.creation_user + and o.object_id = :offer_id + + + +