Index: openacs-4/packages/forums/forums.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/forums.info,v
diff -u -r1.46 -r1.47
--- openacs-4/packages/forums/forums.info 7 Aug 2017 23:48:11 -0000 1.46
+++ openacs-4/packages/forums/forums.info 27 Sep 2017 11:07:51 -0000 1.47
@@ -9,7 +9,7 @@
f
t
-
+
OpenACS
Online discussion forums.
2017-08-06
@@ -19,7 +19,7 @@
2
#forums.Forums#
-
+
Index: openacs-4/packages/forums/lib/forums/edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/edit.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/forums/lib/forums/edit.tcl 7 Aug 2017 23:48:11 -0000 1.5
+++ openacs-4/packages/forums/lib/forums/edit.tcl 27 Sep 2017 11:07:51 -0000 1.6
@@ -28,9 +28,6 @@
-presentation_type $presentation_type \
-posting_policy $posting_policy
- forum::posting_policy_set -posting_policy $posting_policy \
- -forum_id $forum_id
-
# Users can create new threads?
if { $new_threads_p && $posting_policy ne "closed" } {
forum::new_questions_allow -forum_id $forum_id
Index: openacs-4/packages/forums/lib/forums/new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/new.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/forums/lib/forums/new.tcl 7 Aug 2017 23:48:11 -0000 1.7
+++ openacs-4/packages/forums/lib/forums/new.tcl 27 Sep 2017 11:07:52 -0000 1.8
@@ -36,9 +36,6 @@
-package_id $package_id \
]
- forum::posting_policy_set -posting_policy $posting_policy \
- -forum_id $forum_id
-
# Users can create new threads?
if { $new_threads_p && $posting_policy ne "closed" } {
forum::new_questions_allow -forum_id $forum_id
Index: openacs-4/packages/forums/lib/message/post.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/post.tcl,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/forums/lib/message/post.tcl 7 Aug 2017 23:48:11 -0000 1.23
+++ openacs-4/packages/forums/lib/message/post.tcl 27 Sep 2017 11:07:52 -0000 1.24
@@ -190,7 +190,7 @@
set db_antwort [db_exec_plsql forums_reading_info__remove_msg {}]
}
- set permissions(moderate_p) [forum::security::can_moderate_message_p -message_id $message_id]
+ set permissions(moderate_p) [forum::security::can_moderate_forum_p -forum_id $forum_id]
db_transaction {
if { $permissions(moderate_p) } {
Index: openacs-4/packages/forums/lib/message/threads-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/threads-chunk.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/forums/lib/message/threads-chunk.tcl 15 Sep 2017 06:58:16 -0000 1.18
+++ openacs-4/packages/forums/lib/message/threads-chunk.tcl 27 Sep 2017 11:07:52 -0000 1.19
@@ -36,16 +36,11 @@
# new postings are allowed if
# 0. The user has post-permissions
-# 1. Users can create new threads AND the posting policy is open or
-# moderated 2. User is a moderator or adminsitrator
+# 1. Users can create new threads or user is a moderator or adminsitrator
if {$permissions(post_p)} {
- if {(
- [forum::new_questions_allowed_p -forum_id $forum_id]
- && ($forum(posting_policy) eq "open" || $forum(posting_policy) eq "moderated")
- )
- || [template::util::is_true $permissions(admin_p)]
- || [template::util::is_true $permissions(moderate_p)]
+ if {($permissions(moderate_p) ||
+ [forum::new_questions_allowed_p -forum_id $forum_id])
} {
lappend actions [_ forums.Post_a_New_Message] \
[export_vars -base "${base_url}message-post" { forum_id }] [_ forums.Post_a_New_Message]
Index: openacs-4/packages/forums/sql/oracle/forums-forums-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/oracle/forums-forums-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/forums/sql/oracle/forums-forums-create.sql 8 Aug 2006 21:26:51 -0000 1.6
+++ openacs-4/packages/forums/sql/oracle/forums-forums-create.sql 27 Sep 2017 11:07:52 -0000 1.7
@@ -58,6 +58,12 @@
not null
constraint forums_enabled_p_ck
check (enabled_p in ('t','f')),
+ new_questions_allowed_p char(1)
+ default 't'
+ constraint forums_new_questions_allowed_p_nn
+ not null
+ constraint forums_new_questions_allowed_p_ck
+ check (enabled_p in ('t','f')),
package_id integer
constraint forums_package_id_nn
not null,
Index: openacs-4/packages/forums/sql/oracle/upgrade/upgrade-1.3-1.3d1.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/oracle/upgrade/upgrade-1.3-1.3d1.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/forums/sql/oracle/upgrade/upgrade-1.3-1.3d1.sql 27 Sep 2017 11:07:52 -0000 1.1
@@ -0,0 +1,18 @@
+begin;
+
+alter table forums_forums
+ add column new_questions_allowed_p char(1)
+ default 't'
+ constraint forums_new_questions_allowed_p_nn
+ not null
+ constraint forums_new_questions_allowed_p_ck
+ check (enabled_p in ('t','f'));
+
+drop view forums_forums_enabled;
+create view forums_forums_enabled
+as
+ select *
+ from forums_forums
+ where enabled_p = true;
+
+end;
Index: openacs-4/packages/forums/sql/postgresql/forums-forums-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-forums-create.sql,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/forums/sql/postgresql/forums-forums-create.sql 7 Aug 2017 23:48:11 -0000 1.11
+++ openacs-4/packages/forums/sql/postgresql/forums-forums-create.sql 27 Sep 2017 11:07:52 -0000 1.12
@@ -56,6 +56,9 @@
default true
constraint forums_enabled_p_nn
not null,
+ new_questions_allowed_p boolean
+ default true
+ not null,
package_id integer
constraint forums_package_id_nn
not null,
Index: openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3-1.3.1d1.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3-1.3.1d1.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3-1.3.1d1.sql 27 Sep 2017 11:07:52 -0000 1.1
@@ -0,0 +1,13 @@
+begin;
+
+alter table forums_forums
+ add column new_questions_allowed_p boolean default true not null;
+
+drop view forums_forums_enabled;
+create view forums_forums_enabled
+as
+ select *
+ from forums_forums
+ where enabled_p = true;
+
+end;
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.25 -r1.26
--- openacs-4/packages/forums/tcl/forums-procs.tcl 7 Aug 2017 23:48:11 -0000 1.25
+++ openacs-4/packages/forums/tcl/forums-procs.tcl 27 Sep 2017 11:07:52 -0000 1.26
@@ -21,7 +21,7 @@
-no_callback:boolean
} {
create a new forum
-} {
+} {
set var_list [list \
[list forum_id $forum_id] \
[list name $name] \
@@ -90,64 +90,65 @@
}
}
-ad_proc -public forum::posting_policy_set {
+ad_proc -deprecated -public forum::posting_policy_set {
{-posting_policy:required}
{-forum_id:required}
} {
- # JCD: this is potentially bad since we are
- # just assuming registered_users is the
- # right group to be granting write to.
+ # # JCD: this is potentially bad since we are
+ # # just assuming registered_users is the
+ # # right group to be granting write to.
- if {"closed" ne $posting_policy } {
- permission::grant -object_id $forum_id \
- -party_id [acs_magic_object registered_users] \
- -privilege write
- } else {
- permission::revoke -object_id $forum_id \
- -party_id [acs_magic_object registered_users] \
- -privilege write
- }
-
+ # if {"closed" ne $posting_policy } {
+ # permission::grant -object_id $forum_id \
+ # -party_id [acs_magic_object registered_users] \
+ # -privilege write
+ # } else {
+ # permission::revoke -object_id $forum_id \
+ # -party_id [acs_magic_object registered_users] \
+ # -privilege write
+ # }
}
ad_proc -public forum::new_questions_allow {
{-forum_id:required}
{-party_id ""}
} {
- if { $party_id eq "" } {
- set party_id [acs_magic_object registered_users]
+ if { $party_id ne "" } {
+ ad_log warning "Attribute party_id is deprecated and was ignored."
}
- # Give the public the right to ask new questions
- permission::grant -object_id $forum_id \
- -party_id $party_id \
- -privilege create
- util_memoize_flush_regexp $forum_id
+
+ db_dml query {
+ update forums_forums set
+ new_questions_allowed_p = true
+ where forum_id = :forum_id
+ }
}
ad_proc -public forum::new_questions_deny {
{-forum_id:required}
{-party_id ""}
} {
- if { $party_id eq "" } {
- set party_id [acs_magic_object registered_users]
+ if { $party_id ne "" } {
+ ad_log warning "Attribute party_id is deprecated and was ignored."
}
- # Revoke the right from the public to ask new questions
- permission::revoke -object_id $forum_id \
- -party_id $party_id \
- -privilege create
- util_memoize_flush_regexp $forum_id
+
+ db_dml query {
+ update forums_forums set
+ new_questions_allowed_p = false
+ where forum_id = :forum_id
+ }
}
ad_proc -public forum::new_questions_allowed_p {
{-forum_id:required}
{-party_id ""}
} {
- if { $party_id eq "" } {
- set party_id [acs_magic_object registered_users]
+ if { $party_id ne "" } {
+ ad_log warning "Attribute party_id is deprecated and was ignored."
}
- permission::permission_p -object_id $forum_id \
- -party_id $party_id \
- -privilege create
+
+ forum::get -forum_id $forum_id -array forum
+ return $forum(new_questions_allowed_p)
}
ad_proc -public forum::enable {
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.15 -r1.16
--- openacs-4/packages/forums/tcl/forums-security-procs.tcl 7 Aug 2017 23:48:11 -0000 1.15
+++ openacs-4/packages/forums/tcl/forums-security-procs.tcl 27 Sep 2017 11:07:52 -0000 1.16
@@ -37,142 +37,130 @@
}
}
- ad_proc -public can_read_message_p {
+ ad_proc -public can_post_forum_p {
{-user_id ""}
- {-message_id:required}
+ {-forum_id:required}
} {
- # if the user is a guest, they can't see any forum messages at all
- if { ![acs_privacy::user_can_read_private_data_p -user_id $user_id -object_id [ad_conn package_id]] } {
- return 0
+ if {[ad_conn user_id] == 0} {
+ return false
} else {
- return [permission::permission_p -party_id $user_id -object_id $message_id -privilege read]
+ forum::get -forum_id $forum_id -array forum
+ return [expr {$forum(posting_policy) ne "closed"}]
}
}
- ad_proc -public require_read_message {
+ ad_proc -public require_post_forum {
{-user_id ""}
- {-message_id:required}
+ {-forum_id:required}
} {
- if {![can_read_message_p -user_id $user_id -message_id $message_id]} {
+ if {![can_post_forum_p -user_id $user_id -forum_id $forum_id]} {
do_abort
}
}
- ad_proc -public can_post_forum_p {
+ ad_proc -public can_moderate_forum_p {
{-user_id ""}
{-forum_id:required}
} {
- return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege create]
+ return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_moderate]
}
- ad_proc -public require_post_forum {
+ ad_proc -public require_moderate_forum {
{-user_id ""}
{-forum_id:required}
} {
- if {![can_post_forum_p -user_id $user_id -forum_id $forum_id]} {
+ if {![can_moderate_forum_p -user_id $user_id -forum_id $forum_id]} {
do_abort
}
}
- ad_proc -public can_post_message_p {
+ ad_proc -public permissions {
+ {-forum_id:required}
{-user_id ""}
+ array_name
+ } {
+ upvar $array_name array
+
+ set array(admin_p) [forum::security::can_moderate_forum_p -forum_id $forum_id]
+ set array(moderate_p) $array(admin_p)
+ set array(post_p) [expr {$array(admin_p) || [forum::security::can_post_forum_p -forum_id $forum_id -user_id $user_id]}]
+ }
+
+ ### Deprecated procs ###
+ # 2017-09-26:
+ # we decided to simplify forums management and unwire dependency
+ # with the registered_users group. This prevented forums package
+ # to be ever used in a subsite aware context. Now posting policy
+ # and new-threads-allowed won't be managed via setting
+ # permsissions, but through plain table columns. Forum will also
+ # decide for permissions on the messages.
+
+ ad_proc -deprecated -public can_read_message_p {
+ {-user_id ""}
{-message_id:required}
} {
- return [permission::permission_p -party_id $user_id -object_id $message_id -privilege write]
+ forum::message::get -message_id $message_id -array message
+ return [can_read_forum_p -forum_id $message(forum_id) -user_id $user_id]
}
- ad_proc -public require_post_message {
+ ad_proc -deprecated -public require_read_message {
{-user_id ""}
{-message_id:required}
} {
- if {![can_post_message_p -user_id $user_id -message_id $message_id]} {
- do_abort
- }
+ forum::message::get -message_id $message_id -array message
+ return [require_read_forum -forum_id $message(forum_id) -user_id $user_id]
}
-
- ad_proc -public can_moderate_forum_p {
+
+ ad_proc -deprecated -public can_post_message_p {
{-user_id ""}
- {-forum_id:required}
+ {-message_id:required}
} {
- return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_moderate]
+ forum::message::get -message_id $message_id -array message
+ return [can_post_forum_p -forum_id $message(forum_id) -user_id $user_id]
}
- ad_proc -public require_moderate_forum {
+ ad_proc -deprecated -public require_post_message {
{-user_id ""}
- {-forum_id:required}
+ {-message_id:required}
} {
- if {![can_moderate_forum_p -user_id $user_id -forum_id $forum_id]} {
- do_abort
- }
+ forum::message::get -message_id $message_id -array message
+ return [require_post_forum -forum_id $message(forum_id) -user_id $user_id]
}
- ad_proc -public can_moderate_message_p {
+ ad_proc -deprecated -public can_moderate_message_p {
{-user_id ""}
{-message_id:required}
} {
- return [permission::permission_p -party_id $user_id -object_id $message_id -privilege forum_moderate]
+ forum::message::get -message_id $message_id -array message
+ return [can_moderate_forum_p -forum_id $message(forum_id) -user_id $user_id]
}
- ad_proc -public require_moderate_message {
+ ad_proc -deprecated -public require_moderate_message {
{-user_id ""}
{-message_id:required}
} {
- if {![can_moderate_message_p -user_id $user_id -message_id $message_id]} {
- do_abort
- }
+ forum::message::get -message_id $message_id -array message
+ return [require_moderate_forum_p -forum_id $message(forum_id) -user_id $user_id]
}
- ad_proc -public can_admin_forum_p {
+ # admin == moderate!
+ ad_proc -deprecated -public can_admin_forum_p {
{-user_id ""}
{-forum_id:required}
} {
- return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_moderate]
+ return [can_moderate_p -user_id $user_id -forum_id $forum_id]
}
- ad_proc -public require_admin_forum {
+ ad_proc -deprecated -public require_admin_forum {
{-user_id ""}
{-forum_id:required}
} {
- if {![can_admin_forum_p -user_id $user_id -forum_id $forum_id]} {
+ if {![can_moderate_forum_p -user_id $user_id -forum_id $forum_id]} {
do_abort
}
}
- ad_proc -public permissions {
- {-forum_id:required}
- {-user_id ""}
- array_name
- } {
- upvar $array_name array
-
- array set array [list admin_p [forum::security::can_admin_forum_p -forum_id $forum_id]]
-
- if { !$array(admin_p) } {
- array set array [list moderate_p [forum::security::can_moderate_forum_p -forum_id $forum_id]]
- if { !$array(moderate_p) } {
-
- # Set post_p according to permissions ...
- array set array [list post_p [forum::security::can_post_forum_p -forum_id $forum_id -user_id $user_id]]
-
- # ... alternatively, we could use a parameter to behave like
- # in earlier versions just leave it is a reminder, if
- # someone still likes the old behavior. This code should be
- # removed later....
- #
- # if {$user_id == 0 && [parameter::get -parameter "OfferPostForAnonymousUserP" -default 1]} {
- # array set array [list post_p 1]
- # } else {
- # array set array [list post_p [forum::security::can_post_forum_p -forum_id $forum_id -user_id $user_id]]
- # }
- } else {
- # moderators can always post
- array set array [list post_p 1]
- }
- } else {
- array set array [list moderate_p 1]
- array set array [list post_p 1]
- }
- }
+ ###
}
# Local variables:
Index: openacs-4/packages/forums/www/message-email.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-email.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/forums/www/message-email.tcl 7 Aug 2017 23:48:11 -0000 1.18
+++ openacs-4/packages/forums/www/message-email.tcl 27 Sep 2017 11:07:52 -0000 1.19
@@ -13,10 +13,9 @@
# require login to avoid abuse from spammers
auth::require_login
-forum::security::require_read_message -message_id $message_id
-
# Get the message information
forum::message::get -message_id $message_id -array message
+forum::security::require_read_forum -forum_id $message(forum_id)
set message(tree_level) 0
form create message
Index: openacs-4/packages/forums/www/message-post.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v
diff -u -r1.44 -r1.45
--- openacs-4/packages/forums/www/message-post.tcl 7 Aug 2017 23:48:11 -0000 1.44
+++ openacs-4/packages/forums/www/message-post.tcl 27 Sep 2017 11:07:52 -0000 1.45
@@ -48,13 +48,17 @@
forum::security::require_post_forum -forum_id $forum_id
forum::get -forum_id $forum_id -array forum
+ # check if we can post new threads
+ if {!$forum(new_questions_allowed_p)} {
+ forum::security::do_abort
+ }
} else {
# get the parent message information
forum::message::get -message_id $parent_id -array parent_message
set parent_message(tree_level) 0
# see if they're allowed to add to this thread
- forum::security::require_post_message -message_id $parent_id
+ forum::security::require_post_forum -forum_id $parent_message(forum_id)
forum::get -forum_id $parent_message(forum_id) -array forum
}
@@ -66,8 +70,8 @@
|| [forum::security::can_post_forum_p \
-forum_id $forum_id -user_id 0])
&& ($parent_id eq ""
- || [forum::security::can_post_message_p \
- -message_id $parent_id -user_id 0])}]
+ || [forum::security::can_post_forum_p \
+ -forum_id $parent_message(forum_id) -user_id 0])}]
set attachments_enabled_p [forum::attachments_enabled_p]
Index: openacs-4/packages/forums/www/message-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v
diff -u -r1.53 -r1.54
--- openacs-4/packages/forums/www/message-view.tcl 7 Aug 2017 23:48:11 -0000 1.53
+++ openacs-4/packages/forums/www/message-view.tcl 27 Sep 2017 11:07:52 -0000 1.54
@@ -36,27 +36,9 @@
}
set user_id [ad_conn user_id]
-forum::security::require_read_message -message_id $message_id
+forum::security::require_read_forum -forum_id $message(forum_id)
forum::security::permissions -forum_id $message(forum_id) -- permissions
-# Check if the user has admin on the message
-set permissions(moderate_p) [forum::security::can_moderate_message_p -message_id $message_id]
-if { !$permissions(moderate_p) } {
- # Set post_p according to permissions ...
- set permissions(post_p) [forum::security::can_post_message_p -message_id $message_id]
- # ... alternatively, we could use a parameter to behave like
- # in earlier versions just leave it is a reminder, if
- # someone still likes the old behavior. This code should be
- # removed later....
- # if {$user_id == 0 && [parameter::get -parameter "OfferPostForAnonymousUserP" -default 1]} {
- # set permissions(post_p) 1
- # } else {
- # set permissions(post_p) [forum::security::can_post_forum_p -forum_id $message(forum_id)]
- # }
-} else {
- set permissions(post_p) 1
-}
-
# Check if the message is approved
if {!$permissions(moderate_p) && $message(state) ne "approved" } {
ad_returnredirect "forum-view?forum_id=$message(forum_id)"
Index: openacs-4/packages/forums/www/moderate/message-approve.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-approve.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/forums/www/moderate/message-approve.tcl 7 Aug 2017 23:48:12 -0000 1.6
+++ openacs-4/packages/forums/www/moderate/message-approve.tcl 27 Sep 2017 11:07:52 -0000 1.7
@@ -12,7 +12,8 @@
}
# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
+forum::message::get -message_id $message_id -array message
+forum::security::require_moderate_forum -forum_id $message(forum_id)
# Approve the message
forum::message::approve -message_id $message_id
Index: openacs-4/packages/forums/www/moderate/message-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-delete.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/forums/www/moderate/message-delete.tcl 7 Aug 2017 23:48:12 -0000 1.17
+++ openacs-4/packages/forums/www/moderate/message-delete.tcl 27 Sep 2017 11:07:52 -0000 1.18
@@ -12,21 +12,19 @@
{confirm_p:boolean 0}
}
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
-
# Select the stuff
forum::message::get -message_id $message_id -array message
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
+
# stylesheets
set lang [ad_conn language]
template::head::add_css -href /resources/forums/forums.css -media all -lang $lang
# js scripts
template::head::add_script -type "text/javascript" -src "/resources/forums/forums.js"
-ad_return_template
-
# Local variables:
# mode: tcl
# tcl-indent-level: 4
Index: openacs-4/packages/forums/www/moderate/message-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-move.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/forums/www/moderate/message-move.tcl 7 Aug 2017 23:48:12 -0000 1.4
+++ openacs-4/packages/forums/www/moderate/message-move.tcl 27 Sep 2017 11:07:52 -0000 1.5
@@ -11,13 +11,11 @@
{confirm_p:boolean 0}
}
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
-
# Select the stuff
forum::message::get -message_id $message_id -array message
-ad_return_template
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
# Local variables:
# mode: tcl
Index: openacs-4/packages/forums/www/moderate/message-reject.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-reject.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/forums/www/moderate/message-reject.tcl 7 Aug 2017 23:48:12 -0000 1.6
+++ openacs-4/packages/forums/www/moderate/message-reject.tcl 27 Sep 2017 11:07:52 -0000 1.7
@@ -12,7 +12,8 @@
}
# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
+forum::message::get -message_id $message_id -array message
+forum::security::require_moderate_forum -forum_id $message(forum_id)
# Reject the message
forum::message::reject -message_id $message_id
Index: openacs-4/packages/forums/www/moderate/move-thread-thread.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/move-thread-thread.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/forums/www/moderate/move-thread-thread.tcl 7 Aug 2017 23:48:12 -0000 1.7
+++ openacs-4/packages/forums/www/moderate/move-thread-thread.tcl 27 Sep 2017 11:07:52 -0000 1.8
@@ -13,12 +13,12 @@
set table_border_color [parameter::get -parameter table_border_color]
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $msg_id
-
# Select the stuff
forum::message::get -message_id $msg_id -array message
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
+
#form to confirm
ad_form -name confirmed_move -mode {display} -actions [list [list [_ forums.Yes] yes] [list No no] ] -export { msg_id return_url selected_message} -html {enctype multipart/form-data} -form {
{data:text(hidden) {value 0}}
Index: openacs-4/packages/forums/www/moderate/move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/move.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/forums/www/moderate/move.tcl 7 Aug 2017 23:48:12 -0000 1.7
+++ openacs-4/packages/forums/www/moderate/move.tcl 27 Sep 2017 11:07:52 -0000 1.8
@@ -13,12 +13,12 @@
set table_border_color [parameter::get -parameter table_border_color]
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
-
# Select the stuff
forum::message::get -message_id $message_id -array message
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
+
#form to confirm if a user want to move the thread
ad_form -name confirmed_move -mode {display} \
-actions [list [list [_ forums.Yes] yes] [list No no] ] \
Index: openacs-4/packages/forums/www/moderate/thread-move-thread.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/thread-move-thread.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/forums/www/moderate/thread-move-thread.tcl 7 Aug 2017 23:48:12 -0000 1.4
+++ openacs-4/packages/forums/www/moderate/thread-move-thread.tcl 27 Sep 2017 11:07:52 -0000 1.5
@@ -11,13 +11,11 @@
{confirm_p:boolean 0}
}
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
-
# Select the stuff
forum::message::get -message_id $message_id -array message
-ad_return_template
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
# Local variables:
# mode: tcl
Index: openacs-4/packages/forums/www/moderate/thread-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/thread-move.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/forums/www/moderate/thread-move.tcl 7 Aug 2017 23:48:12 -0000 1.5
+++ openacs-4/packages/forums/www/moderate/thread-move.tcl 27 Sep 2017 11:07:52 -0000 1.6
@@ -11,11 +11,12 @@
{confirm_p:boolean 0}
}
-# Check that the user can moderate the forum
-forum::security::require_moderate_message -message_id $message_id
-
# Select the stuff
forum::message::get -message_id $message_id -array message
+
+# Check that the user can moderate the forum
+forum::security::require_moderate_forum -forum_id $message(forum_id)
+
set title "#forums.Confirm_Move_to# \"$message(subject)\""
ad_return_template