Index: openacs-4/packages/dotlrn/www/register-link.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register-link.adp,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/dotlrn/www/register-link.adp 15 Aug 2002 20:24:50 -0000 1.9
+++ openacs-4/packages/dotlrn/www/register-link.adp 17 Oct 2002 12:58:16 -0000 1.9.2.1
@@ -1,7 +1,7 @@
<%
#
- # Copyright (C) 2001, 2002 MIT
+ # Copyright (C) 2001, 2002 OpenForce, Inc.
#
# This file is part of dotLRN.
#
@@ -17,5 +17,6 @@
#
%>
-
-Join@label@
+
+ ![Join](graphics/join.gif)
@label@
+
Index: openacs-4/packages/dotlrn/www/register.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register.tcl,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/dotlrn/www/register.tcl 9 Aug 2002 18:39:26 -0000 1.7
+++ openacs-4/packages/dotlrn/www/register.tcl 17 Oct 2002 12:58:16 -0000 1.7.2.1
@@ -45,13 +45,101 @@
where community_id = :community_id
}]
-switch -exact $join_policy {
- "open" {
- dotlrn_community::add_user -member_state approved $community_id $user_id
+
+# Check to see if the user is member already.
+# This should prevent most double clicks, leaving
+# the catch below to trap the rest.
+
+if {[dotlrn_community::member_p $community_id $user_id]} {
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+
+if {[catch {
+ switch -exact $join_policy {
+ "open" {
+ dotlrn_community::add_user -member_state approved $community_id $user_id
+ }
+ "needs approval" {
+ dotlrn_community::add_user -member_state "needs approval" $community_id $user_id
+
+ # Following the same proccess as spam.tcl to email
+ # admins in bulk.
+
+ set segment_id [db_string select_admin_rel_segment_id {}]
+ set community_name [dotlrn_community::get_community_name $community_id]
+ set community_url "[ad_parameter -package_id [ad_acs_kernel_id] SystemURL][dotlrn_community::get_community_url $community_id]"
+
+ set query "select parties.email,
+ decode(acs_objects.object_type,
+ 'user',
+ (select first_names
+ from persons
+ where person_id = parties.party_id),
+ 'group',
+ (select group_name
+ from groups
+ where group_id = parties.party_id),
+ 'rel_segment',
+ (select segment_name
+ from rel_segments
+ where segment_id = parties.party_id),
+ '') as first_names,
+ decode(acs_objects.object_type,
+ 'user',
+ (select last_name
+ from persons
+ where person_id = parties.party_id),
+ '') as last_name
+ from party_approved_member_map,
+ parties,
+ acs_objects
+ where party_approved_member_map.party_id = $segment_id
+ and party_approved_member_map.member_id <> $segment_id
+ and party_approved_member_map.member_id = parties.party_id
+ and parties.party_id = acs_objects.object_id"
+
+
+ set full_name "[dotlrn::get_user_name $user_id]"
+ set email "[cc_email_from_party $user_id]"
+ set subject "$full_name ($email) has requested to join $community_name."
+
+ set message "$full_name ($email) has requested to join $community_name.
+
+Visit this link to approve or reject this request:
+$community_url/members
+
+ "
+
+ bulk_mail::new \
+ -package_id [site_node_apm_integration::get_child_package_id -package_id [dotlrn_community::get_package_id $community_id] -package_key [bulk_mail::package_key]] \
+ -from_addr [ad_system_owner] \
+ -subject $subject \
+ -message $message \
+ -query $query
+
+ }
}
- "needs approval" {
- dotlrn_community::add_user -member_state "needs approval" $community_id $user_id
+} errmsg]} {
+
+ # Check to see if they are already a member
+ # (in which case this was likely a double click)
+
+ if {[dotlrn_community::member_p $community_id $user_id]} {
+ ad_returnredirect $referer
+ ad_script_abort
+ } else {
+ ns_log Error "register.tcl failed: $errmsg"
+
+ ad_return_error "Error adding user to community" "An error occured while trying to add a user to a community. This error has been logged."
}
}
ad_returnredirect $referer
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn/www/user-add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add.adp,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/dotlrn/www/user-add.adp 9 Aug 2002 18:39:26 -0000 1.7
+++ openacs-4/packages/dotlrn/www/user-add.adp 17 Oct 2002 12:58:16 -0000 1.7.2.1
@@ -21,5 +21,29 @@
Add A User
@context_bar@
+Add a new user to SloanSpace
+
+
+ Note: use this feature responsibly and think first.
+
+ - If this person is a MIT or Sloan Student have him self-register at sloanspace.mit.edu so he will have a full access account.
+
- Be sure that the person does not already have a SloanSpace account under another email address. Duplicate accounts cause problems for everyone. To add a person with an existing account use Manage Membership.
+
+
- Use this only for an officially registered student in this class who is not a MIT or Sloan student.
+
+
+
+ - This allows you to give a non-MIT person who is not a registered student access to this group.
+
+
+- Information about other members of this community will not be available to this user.
+
- If you wish to give guests full access to forums and surveys you may request that the site-wide admin change the status of your community. This option is not open to classes due to MIT privacy policy.
+
+
+
+
+
+
+
\ No newline at end of file
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.25 -r1.25.2.1
--- openacs-4/packages/dotlrn/www/user-add.tcl 9 Aug 2002 18:39:26 -0000 1.25
+++ openacs-4/packages/dotlrn/www/user-add.tcl 17 Oct 2002 12:58:16 -0000 1.25.2.1
@@ -40,9 +40,11 @@
if {![empty_string_p $community_id]} {
dotlrn::require_user_admin_community -community_id [dotlrn_community::get_community_id]
set context_bar {{"one-community-admin" Admin} {Add User}}
+ set community_p 1
} else {
dotlrn::require_admin
set context_bar {{users Users} {Add User}}
+ set community_p 0
}
set target_user_id [db_nextval acs_object_id_seq]
@@ -55,21 +57,14 @@
-widget hidden \
-value $target_user_id
-element create add_user id \
- -label ID \
- -datatype text \
- -widget text \
- -html {size 30} \
- -value $id
-
element create add_user email \
-label Email \
-datatype text \
-widget text \
-html {size 50} \
-validate {
{expr (([util_email_valid_p $value] == 1) && ([util_email_unique_p $value] == 1))}
- {E-mail address must be valid and unique}
+ {E-mail address must be complete and unique.
This user probably already has a SloanSpace account.
Try adding this user through Manage Membership.}
}
element create add_user first_names \
@@ -122,10 +117,9 @@
if {[form is_valid add_user]} {
form get_values add_user \
- target_user_id id email first_names last_name referer type can_browse_p read_private_data_p dotlrn_interactive_p
+ target_user_id email first_names last_name referer type can_browse_p read_private_data_p dotlrn_interactive_p
db_transaction {
-
if {[empty_string_p [cc_email_from_party $target_user_id]]} {
# create the ACS user
set password [ad_generate_random_string]
@@ -137,7 +131,7 @@
if {!${dotlrn_interactive_p}} {
# make the user a dotLRN user
- dotlrn::user_add -id $id -type $type -can_browse\=$can_browse_p -user_id $target_user_id
+ dotlrn::user_add -type $type -can_browse\=$can_browse_p -user_id $target_user_id
}
}
@@ -157,3 +151,12 @@
}
ad_return_template
+
+
+
+
+
+
+
+
+