Index: openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 14 Feb 2002 18:03:07 -0000 1.1
+++ openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 12 Mar 2002 05:25:58 -0000 1.2
@@ -23,6 +23,12 @@
-widget hidden \
-value $users
+element create select_community referer \
+ -label "Referer" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
set communities [db_list_of_lists select_all_communities {
select pretty_name, community_id
from dotlrn_communities
Index: openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 12 Mar 2002 05:15:57 -0000 1.3
+++ openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 12 Mar 2002 05:25:58 -0000 1.4
@@ -31,50 +31,58 @@
oacs_util::csv_foreach -file $file_location -array_name row {
# We need to insert the ACS user
set password [ad_generate_random_string]
- set user_id [ad_user_new $row(email) $row(first_names) $row(last_name) $password "" "" "" "t" "approved"]
- lappend list_of_user_ids $user_id
-
- if {![info exists row(type)]} {
- set row(type) student
- }
-
- if {![info exists row(access_level)]} {
- set row(access_level) full
- }
-
- if {![info exists row(guest)]} {
- set row(guest) f
- }
-
- # Now we make them a dotLRN user
- dotlrn::user_add -id $row(id) -type $row(type) -access_level $row(access_level) -user_id $user_id
-
- if {$row(guest) == "f"} {
- set inverse_row_guest "t"
+ # Check if this user already exists
+ set user_id [cc_lookup_email_user $row(email)]
+ if {![empty_string_p $user_id]} {
+ doc_body_append "User $row(email) already exists... storing user_id"
+ lappend list_of_user_ids $user_id
} else {
- set inverse_row_guest "f"
+ set user_id [ad_user_new $row(email) $row(first_names) $row(last_name) $password "" "" "" "t" "approved"]
+
+ lappend list_of_user_ids $user_id
+
+ if {![info exists row(type)]} {
+ set row(type) student
+ }
+
+ if {![info exists row(access_level)]} {
+ set row(access_level) full
+ }
+
+ if {![info exists row(guest)]} {
+ set row(guest) f
+ }
+
+ # Now we make them a dotLRN user
+ dotlrn::user_add -id $row(id) -type $row(type) -access_level $row(access_level) -user_id $user_id
+
+ if {$row(guest) == "f"} {
+ set inverse_row_guest "t"
+ } else {
+ set inverse_row_guest "f"
+ }
+
+ # Set the privacy
+ acs_privacy::set_user_read_private_data -user_id $user_id -object_id [dotlrn::get_package_id] -value $inverse_row_guest
+
+ doc_body_append "User $row(email) created...."
+ set message "
+ You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl].
+
+ Login: $row(email)
+ Password: $password
+ "
+
+ # Send note to new user
+ if [catch {ns_sendmail "$row(email)" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]" "$message"} errmsg] {
+ doc_body_append "emailing this user failed!"
+ set fail_p 1
+ } else {
+ doc_body_append "email sent"
+ }
}
- # Set the privacy
- acs_privacy::set_user_read_private_data -user_id $user_id -object_id [dotlrn::get_package_id] -value $inverse_row_guest
-
- doc_body_append "User $row(email) created...."
- set message "
- You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl].
-
- Login: $row(email)
- Password: $password
- "
-
- # Send note to new user
- if [catch {ns_sendmail "$row(email)" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]" "$message"} errmsg] {
- doc_body_append "emailing this user failed!"
- set fail_p 1
- } else {
- doc_body_append "email sent"
- }
-
doc_body_append "
"
}
@@ -86,5 +94,6 @@
doc_body_append "
" doc_body_append "or, return to User Management." Index: openacs-4/packages/dotlrn/www/admin/users-bulk-upload.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-upload.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/users-bulk-upload.adp 12 Mar 2002 05:05:42 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/users-bulk-upload.adp 12 Mar 2002 05:25:58 -0000 1.3 @@ -16,6 +16,11 @@ guest (t for guest, f for non-guest).
+ +Note: you will have the option of adding these users to a group +once they have been uploaded. +
+