Index: openacs-4/packages/dotfolio/tcl/dotfolio-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/tcl/dotfolio-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotfolio/tcl/dotfolio-procs.tcl 19 May 2005 15:19:32 -0000 1.2 +++ openacs-4/packages/dotfolio/tcl/dotfolio-procs.tcl 5 Jun 2005 12:28:37 -0000 1.3 @@ -121,7 +121,7 @@ set group_id [application_group::group_id_from_package_id \ -package_id $package_id] group::add_member -group_id $group_id -user_id $owner_id \ - -rel_type "admin_rel" + -rel_type "membership_rel" # Give dotfolio owner admin permission for their blog. array set blog_node_info [site_node::get -url $blog_url] Index: openacs-4/packages/dotfolio/tcl/dotfolio-security-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/tcl/dotfolio-security-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotfolio/tcl/dotfolio-security-procs-postgresql.xql 5 May 2005 08:51:31 -0000 1.1 +++ openacs-4/packages/dotfolio/tcl/dotfolio-security-procs-postgresql.xql 5 Jun 2005 12:28:37 -0000 1.2 @@ -30,12 +30,4 @@ - - - SELECT rel_id - FROM dotfolio_users - WHERE user_id = :user_id - - - \ No newline at end of file Index: openacs-4/packages/dotfolio/tcl/dotfolio-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/tcl/dotfolio-security-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotfolio/tcl/dotfolio-security-procs.tcl 5 May 2005 08:51:31 -0000 1.1 +++ openacs-4/packages/dotfolio/tcl/dotfolio-security-procs.tcl 5 Jun 2005 12:28:37 -0000 1.2 @@ -22,7 +22,7 @@ @version $Id$ } -namespace eval dotfolio { +namespace eval dotfolio::security { ad_proc -private do_abort {} { Do an abort if security violation @@ -83,49 +83,4 @@ return $localized_list } - ad_proc -public user_add { - {-type owner} - {-id ""} - {-user_id:required} - } { - Add a user as a dotfolio user. - } { - # Check if the user is already a dotfolio user - if {[user_p -user_id $user_id]} { - return - } - - # Set default ID to email address - if {[empty_string_p $id]} { - set id [cc_email_from_party $user_id] - } - - # set up extra vars - set extra_vars [ns_set create] - ns_set put $extra_vars user_id $user_id - ns_set put $extra_vars id $id - - # Add the relation (no need for object_id_one or two). - set rel_id [relation_add \ - -extra_vars $extra_vars \ - -member_state approved \ - [get_rel_type_from_user_type -type $type] \ - "" \ - $user_id \ - ] - - return $rel_id - } - - ad_proc -public user_remove { - {-user_id:required} - } { - Remove a user from the set of dotFOLIO users - } { - set rel_id [db_string select_rel_id {} -default ""] - - if {![empty_string_p $rel_id]} { - relation_remove $rel_id - } - } } \ No newline at end of file Index: openacs-4/packages/dotfolio/tcl/dotfolio-users-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/tcl/dotfolio-users-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotfolio/tcl/dotfolio-users-procs-postgresql.xql 27 May 2005 05:01:20 -0000 1.5 +++ openacs-4/packages/dotfolio/tcl/dotfolio-users-procs-postgresql.xql 5 Jun 2005 12:28:37 -0000 1.6 @@ -53,4 +53,12 @@ + + + SELECT rel_id + FROM dotfolio_users + WHERE user_id = :user_id + + + Index: openacs-4/packages/dotfolio/tcl/dotfolio-users-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/tcl/dotfolio-users-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotfolio/tcl/dotfolio-users-procs.tcl 27 May 2005 05:01:20 -0000 1.4 +++ openacs-4/packages/dotfolio/tcl/dotfolio-users-procs.tcl 5 Jun 2005 12:28:37 -0000 1.5 @@ -158,4 +158,50 @@ return [db_string select_user_id {} -default ""] } + ad_proc -public remove { + {-user_id:required} + } { + Remove a user from the set of dotFOLIO users + } { + set rel_id [db_string select_rel_id {} -default ""] + + if {![empty_string_p $rel_id]} { + relation_remove $rel_id + } + } + + ad_proc -public add { + {-type owner} + {-id ""} + {-user_id:required} + } { + Add a user as a dotfolio user. + } { + # Check if the user is already a dotfolio user + if {[user_p -user_id $user_id]} { + return + } + + # Set default ID to email address + if {[empty_string_p $id]} { + set id [cc_email_from_party $user_id] + } + + # set up extra vars + set extra_vars [ns_set create] + ns_set put $extra_vars user_id $user_id + ns_set put $extra_vars id $id + + # Add the relation (no need for object_id_one or two). + set rel_id [relation_add \ + -extra_vars $extra_vars \ + -member_state approved \ + [get_rel_type_from_user_type -type $type] \ + "" \ + $user_id \ + ] + + return $rel_id + } + } Index: openacs-4/packages/dotfolio/www/admin/user-add-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/www/admin/user-add-type.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotfolio/www/admin/user-add-type.tcl 5 May 2005 08:51:32 -0000 1.1 +++ openacs-4/packages/dotfolio/www/admin/user-add-type.tcl 5 Jun 2005 12:28:38 -0000 1.2 @@ -55,7 +55,7 @@ set email_from [ad_parameter -package_id [ad_acs_kernel_id] SystemOwner] # Add the user as a dotfolio user. - dotfolio::user_add -id $id -type $type -user_id $user_id + dotfolio::user::add -id $id -type $type -user_id $user_id # If the user is of type "owner", then create a dotfolio space for # the user. Index: openacs-4/packages/dotfolio/www/admin/user-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/www/admin/user-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotfolio/www/admin/user-edit.tcl 5 May 2005 08:51:32 -0000 1.1 +++ openacs-4/packages/dotfolio/www/admin/user-edit.tcl 5 Jun 2005 12:28:38 -0000 1.2 @@ -52,10 +52,10 @@ db_transaction { # remove the user - dotfolio::user_remove -user_id $user_id + dotfolio::user::remove -user_id $user_id # add the user - dotfolio::user_add -id $id -type $type -user_id $user_id + dotfolio::user::add -id $id -type $type -user_id $user_id } } -after_submit { Index: openacs-4/packages/dotfolio/www/admin/users-bulk-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio/www/admin/users-bulk-upload-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotfolio/www/admin/users-bulk-upload-2.tcl 27 May 2005 05:01:20 -0000 1.1 +++ openacs-4/packages/dotfolio/www/admin/users-bulk-upload-2.tcl 5 Jun 2005 12:28:38 -0000 1.2 @@ -98,7 +98,7 @@ doc_body_append "[_ dotfolio.creating_user] $row(username)...." # Now we make them a dotFOLIO user - dotfolio::user_add -user_id $user_id -id $row(username) -type $row(type) + dotfolio::user::add -user_id $user_id -id $row(username) -type $row(type) # If user is an owner, then create a dotfolio site using their # username.