download_version_authorize db version_idWhat it does:
given version_id, this procedure will check whether the user has visibility rights over this download. if download doesn't exist page is served to the user informing him that the download doesn't exist. if successfull it will return user_id of the userDefined in: /web/philip/tcl/download-defs.tcl
Source code:
set selection [ns_db 0or1row $db "select download_id from download_versions where version_id = $version_id "] if { [empty_string_p $selection] } { ad_scope_return_complaint 1 "Download Version Doesn't Exist" $db return -code } set_variables_after_query set user_id [ad_verify_and_get_user_id] set user_authorization_status [database_to_tcl_string $db " select download_authorized_p($version_id, $user_id) from dual"] switch $user_authorization_status { authorized { return $user_id } not_authorized { ad_return_warning "Not authorized" "You are not authorized to see this page" ad_script_abort } reg_required { ad_redirect_for_registration ad_script_abort } }