Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.48 -r1.49 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 3 Oct 2003 16:40:12 -0000 1.48 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 7 Oct 2003 10:16:47 -0000 1.49 @@ -1351,12 +1351,6 @@ } } - if { [info exists user(screen_name)] } { - if { ![empty_string_p [acs_user::get_user_id_by_screen_name -screen_name $user(screen_name)]] } { - set element_messages(screen_name) "This screen name is already taken." - } - } - if { [info exists user(url)] } { if { [empty_string_p $user(url)] || [string equal $user(url) "http://"] } { # The user left the default hint for the url @@ -1367,6 +1361,15 @@ } } + if { [info exists user(screen_name)] } { + set screen_name_user_id [acs_user::get_user_id_by_screen_name -screen_name $user(screen_name)] + if { ![empty_string_p $screen_name_user_id] && (!$update_p || $screen_name_user_id != $user(user_id)) } { + set element_messages(screen_name) "This screen name is already taken." + + # We could do the same logic as below with 'stealing' the screen_name of an old, banned user. + } + } + if { [exists_and_not_null user(email)] } { # Check that email is unique set email $user(email) @@ -1379,7 +1382,7 @@ set element_messages(email) "We already have a group with this email" } else { acs_user::get \ - -user_id $email_party_id \ + -user_id $email_party_id \screen_ -array email_user switch $email_user(member_state) {