Index: openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl 11 Nov 2003 15:46:26 -0000 1.8 +++ openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl 9 Feb 2004 14:45:28 -0000 1.9 @@ -36,8 +36,8 @@ {-title:required} {-description ""} {-page_body ""} - {-creation_user_id} - {-creation_user_ip} + {-creation_user} + {-creation_ip} {-content_type content_revision} } { creates a new page and its first revision @@ -48,22 +48,22 @@ @param title title of the page @param description description of the page @param page_body the contents of a page - @param creation_user_id user_id creating this page - @param creation_user_ip ip address which this page is created + @param creation_user user_id creating this page + @param creation_ip ip address which this page is created @returns the page_id of the newly created page } { - if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } + if {![info exists creation_user]} { set creation_user [ad_conn user_id] } if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } db_transaction { set page_id [bcms::item::create_item -item_name $page_name -parent_id $folder_id -content_type $content_type \ - -storage_type text -creation_user_id $creation_user_id -creation_ip $creation_ip] + -storage_type text -creation_user $creation_user -creation_ip $creation_ip] set revision_id [bcms::revision::add_revision -item_id $page_id \ -title $title -content $page_body -description $description \ -mime_type $mime_type \ - -creation_user_id $creation_user_id -creation_ip $creation_ip] + -creation_user $creation_user -creation_ip $creation_ip] } return $page_id @@ -76,8 +76,8 @@ {-title:required} {-description ""} {-upload_file:required} - {-creation_user_id} - {-creation_user_ip} + {-creation_user} + {-creation_ip} {-content_type content_revision} } { uploads a new file and its first revision @@ -88,22 +88,25 @@ @param title title of the file @param description description of the file @param upload_file the file you want to upload - @param creation_user_id user_id creating this page - @param creation_user_ip ip address which this page is created + @param creation_user user_id creating this page + @param creation_ip ip address which this page is created @returns the file_id of the newly created file } { - if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } +# we need to check for an existing conn before doing this in tcl +# probably better to just set them to NULL + + if {![info exists creation_user]} { set creation_user [ad_conn user_id] } if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } db_transaction { set file_id [bcms::item::create_item -item_name $file_name -parent_id $folder_id -content_type $content_type \ - -storage_type file -creation_user_id $creation_user_id -creation_ip $creation_ip] + -storage_type file -creation_user $creation_user -creation_ip $creation_ip] set revision_id [bcms::revision::upload_file_revision -item_id $file_id \ -title $title -description $description \ -upload_file $upload_file \ - -creation_user_id $creation_user_id -creation_ip $creation_ip] + -creation_user $creation_user -creation_ip $creation_ip] }