Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-security-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-security-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-security-create.sql 29 Nov 2001 03:44:21 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-security-create.sql 29 Nov 2001 06:05:37 -0000 1.2 @@ -31,7 +31,7 @@ acs_privilege.create_privilege('dotlrn_view_community_type'); -- the ability to admin a community type - acs.privilege.create_privilege('dotlrn_admin_community_type'); + acs_privilege.create_privilege('dotlrn_admin_community_type'); -- the ability to create a community type acs_privilege.create_privilege('dotlrn_create_community_type'); @@ -43,7 +43,7 @@ -- inheritance acs_privilege.add_child('create', 'dotlrn_create_community_type'); acs_privilege.add_child('create', 'dotlrn_create_community'); - acs_privilege.add_child('edit', 'dotlrn_edit_community'); + acs_privilege.add_child('write', 'dotlrn_edit_community'); acs_privilege.add_child('read', 'dotlrn_view_community'); acs_privilege.add_child('read', 'dotlrn_view_community_type'); acs_privilege.add_child('admin', 'dotlrn_admin_community'); 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.26 -r1.27 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 29 Nov 2001 05:10:36 -0000 1.26 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 29 Nov 2001 06:05:37 -0000 1.27 @@ -162,15 +162,13 @@ set community_name [get_community_name $community_id] db_transaction { - # Go through the allowed rel types - foreach rel_type [get_allowed_rel_types -community_id $community_id] { - set rel_type_key [lindex $rel_type 0] - set rel_type_name [lindex $rel_type 1] - set name "${rel_type_name}s for $community_name" + # Create a rel segment for Admins + set member_segment_id [rel_segments_new $community_id dotlrn_member_rel "Members of $community_name"] + set admin_segment_id [rel_segments_new $community_id dotlrn_admin_rel "Admins of $community_name"] - # Create the segment - rel_segments_new $community_id $rel_type_key $name - } + # Grant permissions + ad_permission_grant $member_segment_id $community_id edit + ad_permission_grant $admin_segment_id $community_id admin } } @@ -179,24 +177,17 @@ } { remove the rel segments for a community } { - set rel_types [get_allowed_rel_types -community_id $community_id] - set segment_ids [list] - - # Collect the segment IDs - foreach rel_type $rel_types { - lappend segment_ids [get_rel_segment_id -community_id $community_id -rel_type [lindex $rel_type 0]] - } + # Take care of the admins + set admin_segment_id [get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] + ad_permission_revoke $admin_segment_id $community_id admin + rel_segments_delete $admin_segment_id - db_transaction { - # Go through the segment IDs - foreach segment_id $segment_ids { - # Delete the segment - rel_segments_delete $segment_id - } - } + # Take care of the members + set member_segment_id [get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] + ad_permission_revoke $member_segment_id $community_id edit + rel_segments_delete $member_segment_id } - ad_proc -public list_admin_users { community_id } { Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 13 Nov 2001 17:57:30 -0000 1.10 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 29 Nov 2001 06:05:37 -0000 1.11 @@ -69,6 +69,8 @@ set parent_node_id [db_string select_node_id {}] # Mount + # FIXME: here we want to figure out how to set the context_id correctly! + # THIS IS A SERIOUS ISSUE set new_package_id [site_node_mount_application -return package_id $parent_node_id $mount_point $package_key $package_key] # Return the newly created package_id Index: openacs-4/packages/dotlrn/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/navigation-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 13 Nov 2001 16:21:01 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 29 Nov 2001 06:05:37 -0000 1.3 @@ -23,6 +23,24 @@ return "/dotlrn" } + ad_proc -public admin_navbar { + args + } { + do an admin navbar + } { + # Prepend some args + set first_args [list [list [root_url] "dotLRN"]] + if {[llength $args] > 0} { + lappend first_args [list "[root_url]/admin" Admin] + } else { + lappend first_args Admin + } + + set args [concat $first_args $args] + + return [raw_navbar $args] + } + ad_proc -public navbar { { -community_id "" } { -community_type "" } @@ -40,16 +58,30 @@ set community_type [dotlrn_community::get_community_type_from_community_id $community_id] } - set list_of_links [list "dotLRN"] + set first_args [] + lappend first_args [list [root_url] dotLRN] + lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [dotlrn_community::get_community_type_name $community_type]] - lappend list_of_links "[dotlrn_community::get_community_type_name $community_type]" - if {![empty_string_p $community_id]} { - lappend list_of_links "[dotlrn_community::get_community_name $community_id]" + lappend first_args [list [dotlrn_community::get_community_url $community_id] [dotlrn_community::get_community_name $community_id]] } + return [raw_navbar [concat $first_args $args]] + } + + ad_proc -public raw_navbar { + list_of_args + } { + do the raw navbar thing (both for admin and such) + } { + set args $list_of_args + set list_of_links [list] + set total_n_args [llength $args] + set count 0 + foreach arg $args { - if {[llength $arg] == 2} { + incr count + if {[llength $arg] == 2 && $count < $total_n_args} { lappend list_of_links "[lindex $arg 1]" } else { lappend list_of_links "$arg" Index: openacs-4/packages/dotlrn/www/community-applets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applets.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/community-applets.tcl 28 Nov 2001 00:11:48 -0000 1.2 +++ openacs-4/packages/dotlrn/www/community-applets.tcl 29 Nov 2001 06:05:37 -0000 1.3 @@ -36,6 +36,6 @@ } } -set context_bar {Applets} +set context_bar {{one-community-admin Admin} Applets} ad_return_template Index: openacs-4/packages/dotlrn/www/community-user-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-user-add.adp 28 Nov 2001 00:11:48 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-user-add.adp 29 Nov 2001 06:05:37 -0000 1.4 @@ -1,5 +1,6 @@ dotLRN Admin: Add a User to a Community +@context_bar@ The results of your search are: