ad_page_contract { The vuh handler tries first to parse the url to get the user_id and if that fails falls back to a query variable. } { user_id:integer,optional } set my_user_id [phb::dispatch] foreach {v_user_id v_mode} [split [ad_conn path_info] "/"] { break } if {![info exists v_user_id]} { # See if it's in the query variables if {[info exists user_id]} { ad_returnredirect $user_id } else { ad_returnredirect $my_user_id } ad_script_abort } elseif {![regexp {^[1-9][0-9]*$} $v_user_id]} { ns_returnnotfound ad_script_abort } if {[info exists v_user_id]} { if {[ns_set find [rp_getform] user] == -1} { rp_form_put user $v_user_id } else { ns_set update [rp_getform] user $v_user_id } } if {![info exists v_mode] || [empty_string_p $v_mode]} { set v_mode main } if {[ns_set find [rp_getform] mode] == -1} { rp_form_put mode $v_mode } else { ns_set update [rp_getform] mode $v_mode } rp_internal_redirect ../profile