Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/dotlrn.info 13 Nov 2001 16:21:01 -0000 1.14 +++ openacs-4/packages/dotlrn/dotlrn.info 27 Nov 2001 23:32:03 -0000 1.15 @@ -90,6 +90,9 @@ + + + @@ -120,6 +123,9 @@ + + + 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.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 13 Nov 2001 17:57:30 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 27 Nov 2001 23:32:03 -0000 1.6 @@ -19,6 +19,12 @@ namespace eval dotlrn { + ad_proc -private do_abort {} { + do an abort if security violation + } { + return -code error + } + ad_proc -public user_add { {-role "user"} user_id @@ -183,6 +189,8 @@ } { check if a user can admin a community } { + # FIXME + return 1 } ad_proc -public require_user_admin_community { @@ -191,6 +199,9 @@ } { require that user be able to admin a community } { + if {![user_can_admin_community_p -user_id $user_id $community_id]} { + do_abort + } } } Index: openacs-4/packages/dotlrn/www/community-applets.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applets.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-applets.adp 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,22 @@ + +@context_bar@ +dotLRN Community Admin: @pretty_name@ + +Here you can do all sorts of administrative stuff. + +

+ +

Active Applets

+
    + +
  • @active_applets.applet_pretty_name@ - (cannot be removed yet) + +
+ +

+

Applets to Add

+
    + +
  • @all_applets.applet_pretty_name@ - [add] + +
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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-applets.tcl 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,40 @@ + + +ad_page_contract { + Community Applets + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-10-05 +} { + community_id +} + +set user_id [ad_conn user_id] + +# Load some community type info +db_1row select_community_info {} + +# Get active applets +set list_of_active_applets [dotlrn_community::list_applets $community_id] + +template::multirow create active_applets applet_key applet_pretty_name + +foreach applet_key $list_of_active_applets { + template::multirow append active_applets $applet_key [dotlrn_community::applet_call $applet_key GetPrettyName] +} + + +# List all applets +set list_of_applets [dotlrn_community::list_applets] + +template::multirow create all_applets applet_key applet_pretty_name + +foreach applet_key $list_of_applets { + if {[lsearch $list_of_active_applets $applet_key] == -1} { + template::multirow append all_applets $applet_key [dotlrn_community::applet_call $applet_key GetPrettyName] + } +} + +set context_bar {Admin} + +ad_return_template Index: openacs-4/packages/dotlrn/www/community-applets.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applets.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-applets.xql 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select pretty_name from dotlrn_communities where community_id = :community_id + + + + Index: openacs-4/packages/dotlrn/www/community-user-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add-2.adp 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,17 @@ + +dotLRN Admin: Add a User to a Community + +You're adding @first_names@ @last_name@ (@email@):

+ +

+ + +Role: + + + +
Index: openacs-4/packages/dotlrn/www/community-user-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add-2.tcl 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,24 @@ + +ad_page_contract { + Search for a new user for dotLRN + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { + user_id + community_id +} + +# Get user information +db_1row select_user_info "select first_names, last_name, email from dotlrn_users_full where user_id=:user_id" + +# Depending on the community_type, we have allowable rel_types +set rel_types [dotlrn_community::get_allowed_rel_types -community_id $community_id] + +template::multirow create roles rel_type pretty_name + +foreach rel_type $rel_types { + template::multirow append roles [lindex $rel_type 0] [lindex $rel_type 1] +} + +ad_return_template Index: openacs-4/packages/dotlrn/www/community-user-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add-3.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add-3.tcl 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,16 @@ + +ad_page_contract { + Add the new user + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { + community_id + user_id + rel_type +} + +# Add the relation +dotlrn_community::add_user -rel_type $rel_type $community_id $user_id + +ad_returnredirect "one-class-instance?class_instance_id=$community_id" 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add.adp 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,12 @@ + +dotLRN Admin: Add a User to a Community + +The results of your search are: + + + + Index: openacs-4/packages/dotlrn/www/community-user-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add.tcl 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,15 @@ + +ad_page_contract { + Search for a new user for dotLRN + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { + search_text + community_id +} + +# Just search +db_multirow users select_users {} + +ad_return_template Index: openacs-4/packages/dotlrn/www/community-user-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-user-add.xql 27 Nov 2001 23:32:03 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select user_id, first_names, last_name, email from dotlrn_users_full where lower(last_name) like lower('%' || :search_text || '%') or lower(email) like lower('%' || :search_text || '%') and user_id not in (select user_id from dotlrn_member_rels_full where community_id= :community_id) + + + + Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/one-community-admin.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/one-community-admin.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/one-community-admin.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/one-community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/one-community-type.adp 11 Nov 2001 18:48:01 -0000 1.7 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 27 Nov 2001 23:32:03 -0000 1.8 @@ -22,7 +22,7 @@

Active Communities of this Type

Index: openacs-4/packages/dotlrn/www/one-community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 13 Nov 2001 16:21:01 -0000 1.4 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 27 Nov 2001 23:32:03 -0000 1.5 @@ -37,11 +37,18 @@ set list_of_active_communities [dotlrn_community::get_active_communities $community_type] # data source -template::multirow create active_communities community_id community_type pretty_name description url +template::multirow create active_communities community_id community_type pretty_name description url admin_p # Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) foreach comm $list_of_active_communities { - template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] + # See if user can admin this + if {[dotlrn::user_can_admin_community_p [lindex $comm 0]]} { + set admin_p 1 + } else { + set admin_p 0 + } + + template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] $admin_p } set context_bar {View} Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-applets.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-applets.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-applets.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add-2.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add-3.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/community-user-add.xql'. Fisheye: No comparison available. Pass `N' to diff?