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.43 -r1.44
--- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl	25 Sep 2003 11:37:32 -0000	1.43
+++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl	25 Sep 2003 14:25:01 -0000	1.44
@@ -1344,6 +1344,12 @@
             set user(email) [string tolower $user(email)]
         }
     }
+
+    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://"] } {
Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v
diff -u -r1.32 -r1.33
--- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl	25 Sep 2003 11:37:32 -0000	1.32
+++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl	25 Sep 2003 14:25:01 -0000	1.33
@@ -533,6 +533,19 @@
     db_dml user_update {}
 }
 
+ad_proc -public acs_user::get_user_id_by_screen_name {
+    {-screen_name:required}
+} {
+    Returns the user_id from a screen_name, or empty string if no user found.
+    Searches all users, including banned, deleted, unapproved, etc.
+} {
+    return [db_string select_user_id_by_screen_name { 
+        select user_id from users where screen_name = :screen_name 
+    } -default {}]
+}
+
+
+
 ad_proc -public acs_user::site_wide_admin_p {
     {-user_id ""}
 } {