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.14 -r1.15 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 17 May 2003 10:04:18 -0000 1.14 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 22 Aug 2003 11:53:11 -0000 1.15 @@ -61,7 +61,20 @@ return [util_memoize [list cc_lookup_name_group $name]] } -ad_proc ad_user_new {email first_names last_name password password_question password_answer {url ""} {email_verified_p "t"} {member_state "approved"} {user_id ""} } { +ad_proc ad_user_new { + email + first_names + last_name + password + password_question + password_answer + {url ""} + {email_verified_p "t"} + {member_state "approved"} + {user_id ""} + {username ""} + {authority_id ""} +} { Creates a new user in the system. The user_id can be specified as an argument to enable double click protection. If this procedure succeeds, returns the new user_id. Otherwise, returns 0. @@ -105,7 +118,19 @@ end; } ] + + if { [empty_string_p $username] } { + set username $email + } + # Add username, authority_id + db_dml update_users { + update users + set username = :username, + authority_id = :authority_id + where user_id = :user_id + } + if {[catch { # Call the extension acs_user_extension::user_new -user_id $user_id