Index: openacs-4/packages/acs-templating/www/doc/demo/bind.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/bind.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/doc/demo/bind.tcl 27 Oct 2014 16:40:18 -0000 1.3 +++ openacs-4/packages/acs-templating/www/doc/demo/bind.tcl 7 Aug 2017 23:48:02 -0000 1.4 @@ -1,17 +1,30 @@ ad_page_contract { - @cvs-id $Id$ + @cvs-id $Id$ } { - user_id:naturalnum,notnull + user_id:naturalnum,notnull } -properties { - users:onerow + users:onerow +} -validate { + valid_user_id -requires user_id { + if {![db_0or1row user_exists { + select 1 from ad_template_sample_users + where user_id = :user_id + }]} { + ad_complain "Invalid user ID" + } + } } - - set query "select first_name, last_name from ad_template_sample_users where user_id = :user_id" db_1row users_query $query -column_array users + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: