Index: openacs-4/packages/general-comments/www/comment-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add-3.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/general-comments/www/comment-add-3.tcl 5 May 2007 15:54:47 -0000 1.9 +++ openacs-4/packages/general-comments/www/comment-add-3.tcl 27 Oct 2014 16:41:42 -0000 1.10 @@ -8,12 +8,12 @@ @creation-date 2000-10-12 @cvs-id $Id$ } { - comment_id:integer,notnull - object_id:integer,notnull + comment_id:naturalnum,notnull + object_id:naturalnum,notnull title:notnull content:html,notnull comment_mime_type - { context_id "$object_id" } + { context_id:naturalnum "$object_id" } { category "" } { return_url "" } { attach_p "f" } @@ -29,11 +29,11 @@ set user_id [ad_conn user_id] # check to see if the user can create comments on this object -ad_require_permission $object_id general_comments_create +permission::require_permission -object_id $object_id -privilege general_comments_create # insert the comment into the database set creation_ip [ad_conn peeraddr] -set is_live [ad_parameter AutoApproveCommentsP {general-comments} {t}] +set is_live [parameter::get -parameter AutoApproveCommentsP -default {t}] general_comment_new \ -object_id $object_id \ @@ -47,7 +47,7 @@ -category $category \ -content $content -if { [string equal $attach_p "f"] && ![empty_string_p $return_url] } { +if { $attach_p == "f" && $return_url ne "" } { ad_returnredirect $return_url } else { ad_returnredirect "view-comment?[export_vars { comment_id return_url }]"