Index: openacs-4/packages/forums/tcl/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/forums/tcl/forums-procs.tcl 11 Jun 2018 22:04:00 -0000 1.32 +++ openacs-4/packages/forums/tcl/forums-procs.tcl 28 Jun 2018 15:27:42 -0000 1.33 @@ -85,6 +85,8 @@ } ad_proc -public forum::attachments_enabled_p {} { + @return 1 if the attachments are enabled in the forums, 0 otherwise. +} { if {"forums" eq [ad_conn package_key]} { set return_value [site_node_apm_integration::child_package_exists_p \ -package_id [ad_conn package_id] -package_key attachments] @@ -158,10 +160,12 @@ {-forum_id:required} {-party_id ""} } { + Allow the users to create new threads in the forum +} { if { $party_id ne "" } { ad_log warning "Attribute party_id is deprecated and was ignored." } - + db_dml query { update forums_forums set new_questions_allowed_p = true @@ -173,10 +177,12 @@ {-forum_id:required} {-party_id ""} } { + Deny the users to create new threads in the forum +} { if { $party_id ne "" } { ad_log warning "Attribute party_id is deprecated and was ignored." } - + db_dml query { update forums_forums set new_questions_allowed_p = false @@ -188,6 +194,8 @@ {-forum_id:required} {-party_id ""} } { + Check if the users can create new threads in the forum +} { if { $party_id ne "" } { ad_log warning "Attribute party_id is deprecated and was ignored." } @@ -199,17 +207,23 @@ ad_proc -public forum::enable { {-forum_id:required} } { + Enable a forum +} { # Enable the forum, no big deal db_dml update_forum_enabled_p {} } ad_proc -public forum::disable { {-forum_id:required} } { + Disable a forum +} { db_dml update_forum_disabled_p {} } ad_proc -public forum::use_ReadingInfo_p {} { + @return 1 if the UseReadingInfo package parameter is true, 0 otherwise. +} { return [string is true -strict [parameter::get_from_package_key -package_key forums -parameter UseReadingInfo -default f]] } @@ -233,7 +247,7 @@ return $result } - + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/forums/tcl/forums-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-security-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/forums/tcl/forums-security-procs.tcl 25 Jun 2018 09:26:58 -0000 1.23 +++ openacs-4/packages/forums/tcl/forums-security-procs.tcl 28 Jun 2018 15:27:42 -0000 1.24 @@ -36,6 +36,8 @@ {-user_id ""} {-forum_id:required} } { + Abort if the user doesn't have 'read' permissions in the forum. + } { # Probably this whole proc could be replaced by just permission::require_permission if { ![permission::permission_p -party_id $user_id -object_id $forum_id -privilege "read"] } { do_abort @@ -46,6 +48,8 @@ {-user_id ""} {-forum_id:required} } { + @return 1 if the user can post in the forum, 0 otherwise. + } { set user_id [expr {$user_id eq "" ? [ad_conn user_id] : $user_id}] # Moderators can always post @@ -68,6 +72,8 @@ {-user_id ""} {-forum_id:required} } { + Abort if the user doesn't have permissions to post in the forum. + } { if {![can_post_forum_p -user_id $user_id -forum_id $forum_id]} { do_abort } @@ -88,6 +94,8 @@ {-user_id ""} {-forum_id:required} } { + Abort if the user doesn't have 'forum_moderate' permissions in the forum. + } { # Probably this whole proc could be replaced by just permission::require_permission if { ![permission::permission_p \ -party_id $user_id \ Index: openacs-4/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.tcl,v diff -u -r1.54 -r1.55 --- openacs-4/packages/forums/tcl/messages-procs.tcl 28 Jun 2018 09:44:29 -0000 1.54 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 28 Jun 2018 15:27:42 -0000 1.55 @@ -79,6 +79,8 @@ {-message_id:required} {-user_id ""} } { + Perform the notifications +} { # Select all the important information forum::message::get -message_id $message_id -array message @@ -340,9 +342,9 @@ -forum_id:required -order_by:required } { - Return a piece of HTML for toggling the sort order of threads (subjects) - in a forum. The user can either sort by the first postings in subjects - (the creation date of the subjects) or the last one. + @return a piece of HTML for toggling the sort order of threads (subjects) + in a forum. The user can either sort by the first postings in + subjects (the creation date of the subjects) or the last one. @author Peter Marklund } {