Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.150 -r1.151 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 27 Jun 2002 15:14:26 -0000 1.150 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 5 Jul 2002 08:13:46 -0000 1.151 @@ -1114,12 +1114,12 @@ set url [get_community_url $sc_id] append chunk "$pretext [get_community_name $sc_id]\n" - if {[dotlrn::user_can_admin_community_p $sc_id]} { + if {[dotlrn::user_can_admin_community_p -community_id $sc_id]} { append chunk "\[ admin \]" } append chunk "\n" - } elseif {[member_p $sc_id $user_id] || [dotlrn::user_can_admin_community_p $sc_id] || [not_closed_p -community_id $sc_id]} { + } elseif {[member_p $sc_id $user_id] || [dotlrn::user_can_admin_community_p -community_id $sc_id] || [not_closed_p -community_id $sc_id]} { # Shows the subcomm if: # 1. I'm a member of this subcomm OR @@ -1150,7 +1150,7 @@ append chunk " \]\n" } - if {[dotlrn::user_can_admin_community_p $sc_id]} { + if {[dotlrn::user_can_admin_community_p -community_id $sc_id]} { append chunk "\[ Administer \]\n" } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.45 -r1.46 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 2 Jun 2002 00:05:56 -0000 1.45 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 5 Jul 2002 08:13:46 -0000 1.46 @@ -14,16 +14,6 @@ # details. # - -# -# Procs for dotLRN Security -# Copyright 2001 OpenForce, inc. -# Distributed under the GNU GPL v2 -# -# October 30th, 2001 -# ben@openforce.net -# - ad_library { Procs to manage DOTLRN Security @@ -221,14 +211,6 @@ } } - ad_proc -private user_get_type { - user_id - } { - returns the dotLRN user role or empty string if not a dotLRN user - } { - return [db_string select_user_type {} -default ""] - } - ad_proc -public set_can_browse { {-user_id ""} {-can_browse:boolean} @@ -261,7 +243,7 @@ } ad_proc -public require_user_browse { - {user_id ""} + {-user_id ""} } { Require that a user be able to browse dotLRN } { @@ -270,35 +252,19 @@ } } - ad_proc -public set_user_read_private_data { - {-user_id:required} - val - } { - set whether or not a user can read private data - } { - acs_privacy::set_user_read_private_data \ - -user_id $user_id \ - -object_id [dotlrn::get_package_id] \ - $val - } - ad_proc -public user_can_read_private_data_p { - {user_id ""} + {-user_id ""} } { Check if a user can read sensitive data in dotLRN } { - if {[empty_string_p $user_id]} { - set user_id [ad_conn user_id] - } - return [acs_privacy::user_can_read_private_data_p \ -user_id $user_id \ -object_id [dotlrn::get_package_id] \ ] } ad_proc -public require_user_read_private_data { - {user_id ""} + {-user_id ""} } { Require that a user be able to read sensitive data } { @@ -309,7 +275,7 @@ ad_proc -public user_can_read_community_type_p { {-user_id ""} - community_type + {-community_type:required} } { Check if a user can read a community type } { @@ -320,18 +286,18 @@ ad_proc -public require_user_read_community_type { {-user_id ""} - community_type + {-community_type:required} } { require that a user be able to read a community type } { - if {![user_can_read_community_type_p -user_id $user_id $community_type]} { + if {![user_can_read_community_type_p -user_id $user_id -community_type $community_type]} { do_abort } } ad_proc -public user_can_read_community_p { {-user_id ""} - community_id + {-community_id:required} } { Check if a user can read a community } { @@ -344,18 +310,18 @@ ad_proc -public require_user_read_community { {-user_id ""} - community_id + {community_id:required} } { require that a user be able to read a community } { - if {![user_can_read_community_p -user_id $user_id $community_id]} { + if {![user_can_read_community_p -user_id $user_id -community_id $community_id]} { do_abort } } ad_proc -public user_is_community_member_p { {-user_id ""} - community_id + {-community_id:required} } { check if a user is a member of a community } { @@ -372,14 +338,14 @@ } { require that a user be member of a particular community } { - if {![user_is_community_member_p -user_id $user_id $community_id]} { + if {![user_is_community_member_p -user_id $user_id -community_id $community_id]} { do_abort } } ad_proc -public user_can_admin_community_p { {-user_id ""} - community_id + {-community_id:required} } { check if a user can admin a community } { @@ -388,11 +354,11 @@ ad_proc -public require_user_admin_community { {-user_id ""} - community_id + {-community_id:required} } { require that user be able to admin a community } { - if {![user_can_admin_community_p -user_id $user_id $community_id]} { + if {![user_can_admin_community_p -user_id $user_id -community_id $community_id]} { do_abort } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 28 Apr 2002 04:08:41 -0000 1.9 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 5 Jul 2002 08:13:46 -0000 1.10 @@ -27,14 +27,6 @@ - - - select type - from dotlrn_users - where user_id = :user_id - > - - update dotlrn_user_profile_rels Index: openacs-4/packages/dotlrn/www/approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/approve.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/approve.tcl 29 Mar 2002 19:14:46 -0000 1.2 +++ openacs-4/packages/dotlrn/www/approve.tcl 5 Jul 2002 08:13:46 -0000 1.3 @@ -35,7 +35,7 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } else { - dotlrn::require_user_admin_community $community_id + dotlrn::require_user_admin_community -community_id $community_id } dotlrn_community::membership_approve -community_id $community_id -user_id $user_id Index: openacs-4/packages/dotlrn/www/community-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 13 Jun 2002 19:22:08 -0000 1.5 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 5 Jul 2002 08:13:46 -0000 1.6 @@ -34,7 +34,7 @@ set user_id [ad_conn user_id] set creation_ip [ad_conn peeraddr] set community_id [dotlrn_community::get_community_id] -dotlrn::require_user_admin_community -user_id $user_id $community_id +dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id set page_title Preview set header_text [dotlrn_community::get_community_header_name $community_id] Index: openacs-4/packages/dotlrn/www/community-edit-revert.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-revert.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-edit-revert.tcl 13 Jun 2002 19:12:56 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-edit-revert.tcl 5 Jul 2002 08:13:46 -0000 1.4 @@ -28,7 +28,7 @@ set user_id [ad_conn user_id] set community_id [dotlrn_community::get_community_id] -dotlrn::require_user_admin_community -user_id $user_id $community_id +dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id if {![empty_string_p $header_logo_only]} { # just blow away the header logo stuff Index: openacs-4/packages/dotlrn/www/community-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-edit.tcl 13 Jun 2002 04:33:31 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-edit.tcl 5 Jul 2002 08:13:46 -0000 1.4 @@ -28,7 +28,7 @@ set user_id [ad_conn user_id] set community_id [dotlrn_community::get_community_id] -dotlrn::require_user_admin_community -user_id $user_id $community_id +dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id set description [dotlrn_community::get_community_description -community_id $community_id] set pretty_name [dotlrn_community::get_community_name $community_id] Index: openacs-4/packages/dotlrn/www/community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/community.tcl 21 May 2002 17:30:02 -0000 1.9 +++ openacs-4/packages/dotlrn/www/community.tcl 5 Jul 2002 08:13:46 -0000 1.10 @@ -39,7 +39,6 @@ # Check that this user is a member if {![dotlrn_community::member_p $community_id $user_id]} { set context_bar [list "Not a member"] - set portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] # Possible that there is no portal page for non-members @@ -53,12 +52,9 @@ return } else { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - set rendered_page [dotlrn::render_page $portal_id] - set context_bar {View} + set admin_p [dotlrn::user_can_admin_community_p -community_id $community_id] - set admin_p [dotlrn::user_can_admin_community_p $community_id] - ad_return_template } Index: openacs-4/packages/dotlrn/www/configure-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/configure-element.tcl 31 May 2002 06:36:01 -0000 1.12 +++ openacs-4/packages/dotlrn/www/configure-element.tcl 5 Jul 2002 08:13:46 -0000 1.13 @@ -35,7 +35,7 @@ if {[parameter::get -parameter community_level_p] == 1} { set community_id [dotlrn_community::get_community_id] - set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id $community_id] + set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] if {[dotlrn_community::member_p $community_id $user_id] || $admin_p} { portal::configure_element $element_id $op "one-community" Index: openacs-4/packages/dotlrn/www/deregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/deregister.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/deregister.tcl 29 Mar 2002 19:14:46 -0000 1.3 +++ openacs-4/packages/dotlrn/www/deregister.tcl 5 Jul 2002 08:13:46 -0000 1.4 @@ -36,7 +36,7 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } else { - dotlrn::require_user_admin_community $community_id + dotlrn::require_user_admin_community -community_id $community_id } dotlrn_community::remove_user $community_id $user_id Index: openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/dotlrn-default-master.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 29 Jun 2002 21:44:47 -0000 1.16 +++ openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 5 Jul 2002 08:13:46 -0000 1.17 @@ -82,7 +82,7 @@ set link $return_url } -set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id $community_id] +set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] if {![info exists show_control_panel]} { if {$have_comm_id_p && $admin_p } { Index: openacs-4/packages/dotlrn/www/join-policy-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/join-policy-toggle.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/join-policy-toggle.tcl 29 Mar 2002 19:14:46 -0000 1.3 +++ openacs-4/packages/dotlrn/www/join-policy-toggle.tcl 5 Jul 2002 08:13:46 -0000 1.4 @@ -40,7 +40,7 @@ set community_id [dotlrn_community::get_community_id] } -dotlrn::require_user_admin_community $community_id +dotlrn::require_user_admin_community -community_id $community_id db_dml update_join_policy {} Index: openacs-4/packages/dotlrn/www/member-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/member-add-2.tcl 21 May 2002 06:52:34 -0000 1.7 +++ openacs-4/packages/dotlrn/www/member-add-2.tcl 5 Jul 2002 08:13:46 -0000 1.8 @@ -30,7 +30,7 @@ set community_id [dotlrn_community::get_community_id] -dotlrn::require_user_admin_community $community_id +dotlrn::require_user_admin_community -community_id $community_id # Get user information db_1row select_user_info { Index: openacs-4/packages/dotlrn/www/members-chunk-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk-table.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/members-chunk-table.tcl 29 Jun 2002 15:40:08 -0000 1.13 +++ openacs-4/packages/dotlrn/www/members-chunk-table.tcl 5 Jul 2002 08:13:46 -0000 1.14 @@ -43,8 +43,8 @@ ] if {!$site_wide_admin_p} { - set admin_p [dotlrn::user_can_admin_community_p -user_id $my_user_id $community_id] - set read_private_data_p [dotlrn::user_can_read_private_data_p $my_user_id] + set admin_p [dotlrn::user_can_admin_community_p -user_id $my_user_id -community_id $community_id] + set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $my_user_id] } else { set admin_p 1 set read_private_data_p 1 Index: openacs-4/packages/dotlrn/www/members-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/members-chunk.tcl 29 Jun 2002 15:40:08 -0000 1.13 +++ openacs-4/packages/dotlrn/www/members-chunk.tcl 5 Jul 2002 08:13:46 -0000 1.14 @@ -34,7 +34,7 @@ set site_wide_admin_p [ad_permission_p -user_id $user_id [acs_magic_object "security_context_root"] "admin"] if {!$site_wide_admin_p} { - set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id $community_id] + set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id] } else { set admin_p 1 Index: openacs-4/packages/dotlrn/www/members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/www/members.tcl 6 May 2002 23:55:02 -0000 1.14 +++ openacs-4/packages/dotlrn/www/members.tcl 5 Jul 2002 08:13:46 -0000 1.15 @@ -28,4 +28,4 @@ set community_id [dotlrn_community::get_community_id] set portal_id [dotlrn_community::get_portal_id -community_id $community_id] -set admin_p [dotlrn::user_can_admin_community_p -user_id [ad_get_user_id] $community_id] +set admin_p [dotlrn::user_can_admin_community_p -user_id [ad_get_user_id] -community_id $community_id] Index: openacs-4/packages/dotlrn/www/one-community-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 21 May 2002 06:52:34 -0000 1.19 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 5 Jul 2002 08:13:46 -0000 1.20 @@ -37,7 +37,7 @@ set user_id [ad_get_user_id] # Permissions -dotlrn::require_user_admin_community -user_id $user_id $community_id +dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id db_1row select_community_info {} Index: openacs-4/packages/dotlrn/www/one-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn/www/one-community.tcl 3 Jun 2002 20:59:48 -0000 1.28 +++ openacs-4/packages/dotlrn/www/one-community.tcl 5 Jul 2002 08:13:46 -0000 1.29 @@ -37,7 +37,7 @@ set pretty_name [dotlrn_community::get_community_name $community_id] set admin_p [dotlrn::user_can_admin_community_p \ -user_id $user_id \ - $community_id + -community_id $community_id ] # Check that this user is a member Index: openacs-4/packages/dotlrn/www/register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/register.tcl 31 May 2002 06:29:00 -0000 1.5 +++ openacs-4/packages/dotlrn/www/register.tcl 5 Jul 2002 08:13:46 -0000 1.6 @@ -36,7 +36,7 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } else { - dotlrn::require_user_admin_community $community_id + dotlrn::require_user_admin_community -community_id $community_id } set join_policy [db_string select_join_policy { Index: openacs-4/packages/dotlrn/www/reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/reject.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/reject.tcl 29 Mar 2002 19:14:46 -0000 1.2 +++ openacs-4/packages/dotlrn/www/reject.tcl 5 Jul 2002 08:13:46 -0000 1.3 @@ -35,7 +35,7 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } else { - dotlrn::require_user_admin_community $community_id + dotlrn::require_user_admin_community -community_id $community_id } dotlrn_community::membership_reject -community_id $community_id -user_id $user_id Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/spam.tcl 16 May 2002 03:56:31 -0000 1.13 +++ openacs-4/packages/dotlrn/www/spam.tcl 5 Jul 2002 08:13:46 -0000 1.14 @@ -36,7 +36,7 @@ set community_id [dotlrn_community::get_community_id] } -dotlrn::require_user_admin_community $community_id +dotlrn::require_user_admin_community -community_id $community_id set sender_id [ad_conn user_id] set portal_id [dotlrn_community::get_portal_id -community_id $community_id] Index: openacs-4/packages/dotlrn/www/subcommunity-archive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-archive.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/subcommunity-archive.tcl 31 May 2002 21:24:13 -0000 1.4 +++ openacs-4/packages/dotlrn/www/subcommunity-archive.tcl 5 Jul 2002 08:13:46 -0000 1.5 @@ -32,7 +32,7 @@ set user_id [ad_get_user_id] -dotlrn::require_user_admin_community $community_id +dotlrn::require_user_admin_community -community_id $community_id set pretty_name [dotlrn_community::get_community_name $community_id] set title "Archive group $pretty_name" Index: openacs-4/packages/dotlrn/www/user-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/www/user-add.tcl 2 Jun 2002 13:41:25 -0000 1.23 +++ openacs-4/packages/dotlrn/www/user-add.tcl 5 Jul 2002 08:13:46 -0000 1.24 @@ -38,7 +38,7 @@ set community_id [dotlrn_community::get_community_id] if {![empty_string_p $community_id]} { - dotlrn::require_user_admin_community [dotlrn_community::get_community_id] + dotlrn::require_user_admin_community -community_id [dotlrn_community::get_community_id] set context_bar {{"one-community-admin" Admin} {Add User}} } else { dotlrn::require_admin Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl 29 Jun 2002 15:40:08 -0000 1.7 +++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl 5 Jul 2002 08:13:47 -0000 1.8 @@ -30,7 +30,7 @@ set referer [ad_conn url] set community_id $config(community_id) -set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id $community_id] +set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id] # Get all users for this community, including role Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 29 Jun 2002 15:40:08 -0000 1.6 +++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 5 Jul 2002 08:13:47 -0000 1.7 @@ -31,7 +31,7 @@ set referer [ad_conn url] set community_id $config(community_id) -set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id $community_id] +set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id] # get all the users in a list of ns_sets @@ -56,5 +56,3 @@ template::util::list_of_ns_sets_to_multirow \ -rows $all_users_list \ -var_name "users" - -