Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-authentication/tcl/authentication-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-authentication/tcl/authentication-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.87 -r1.87.4.1 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 8 Nov 2010 23:09:10 -0000 1.87 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 25 Aug 2013 20:04:46 -0000 1.87.4.1 @@ -936,7 +936,7 @@ with_catch errmsg { # We create the user without a password # If it's a local account, that'll get set later - set user_id [ad_user_new \ + set user_id [auth::create_local_account_helper \ $user_info(email) \ $user_info(first_names) \ $user_info(last_name) \ @@ -996,7 +996,88 @@ return [array get result] } +ad_proc -private auth::create_local_account_helper { + email + first_names + last_name + password + password_question + password_answer + {url ""} + {email_verified_p "t"} + {member_state "approved"} + {user_id ""} + {username ""} + {authority_id ""} + {screen_name ""} +} { + 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. + + @see auth::create_user + @see auth::create_local_account +} { + if { $user_id eq "" } { + set user_id [db_nextval acs_object_id_seq] + } + if { $password_question eq "" } { + set password_question [db_null] + } + + if { $password_answer eq "" } { + set password_answer [db_null] + } + + if { $url eq "" } { + set url [db_null] + } + + set creation_user "" + set peeraddr "" + + # This may fail, either because there's no connection, or because + # we're in the bootstrap-installer, at which point [ad_conn user_id] is undefined. + catch { + set creation_user [ad_conn user_id] + set peeraddr [ad_conn peeraddr] + } + + set salt [sec_random_token] + set hashed_password [ns_sha1 "$password$salt"] + + set error_p 0 + db_transaction { + + set user_id [db_exec_plsql user_insert {}] + + # set password_question, password_answer + db_dml update_question_answer {*SQL*} + + if {[catch { + # Call the extension + acs_user_extension::user_new -user_id $user_id + } errmsg]} { + # At this point, we don't want the user addition to fail + # if some extension is screwing things up + } + + } on_error { + # we got an error. log it and signal failure. + global errorInfo + ns_log Error "Problem creating a new user: $errorInfo" + set error_p 1 + } + + if { $error_p } { + return 0 + } + # success. + return $user_id +} + + + ad_proc -public auth::update_local_account { {-authority_id:required} {-username:required} Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-authentication/tcl/authentication-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql,v diff -u -r1.18 -r1.18.20.1 --- openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 11 Dec 2003 21:39:56 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 25 Aug 2013 20:04:46 -0000 1.18.20.1 @@ -3,31 +3,6 @@ postgresql7.1 - - - - select acs__add_user( - :user_id, - 'user', - now(), - null, - :peeraddr, - :authority_id, - :username, - :email, - :url, - :first_names, - :last_name, - :hashed_password, - :salt, - :screen_name, - :email_verified_p, - :member_state - ); - - - - select acs__remove_user(:user_id); 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.61 -r1.61.2.1 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 30 Jan 2012 11:17:04 -0000 1.61 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 25 Aug 2013 20:04:46 -0000 1.61.2.1 @@ -80,63 +80,20 @@ @see auth::create_user @see auth::create_local_account } { - if { $user_id eq "" } { - set user_id [db_nextval acs_object_id_seq] - } - - if { $password_question eq "" } { - set password_question [db_null] - } - - if { $password_answer eq "" } { - set password_answer [db_null] - } - - if { $url eq "" } { - set url [db_null] - } - - set creation_user "" - set peeraddr "" - - # This may fail, either because there's no connection, or because - # we're in the bootstrap-installer, at which point [ad_conn user_id] is undefined. - catch { - set creation_user [ad_conn user_id] - set peeraddr [ad_conn peeraddr] - } - - set salt [sec_random_token] - set hashed_password [ns_sha1 "$password$salt"] - - set error_p 0 - db_transaction { - - set user_id [db_exec_plsql user_insert {}] - - # set password_question, password_answer - db_dml update_question_answer {*SQL*} - - if {[catch { - # Call the extension - acs_user_extension::user_new -user_id $user_id - } errmsg]} { - # At this point, we don't want the user addition to fail - # if some extension is screwing things up - } - - } on_error { - # we got an error. log it and signal failure. - global errorInfo - ns_log Error "Problem creating a new user: $errorInfo" - set error_p 1 - } - - if { $error_p } { - return 0 - } - # success. - return $user_id + return [auth::create_local_account_helper \ + $email \ + $first_names \ + $last_name \ + $password \ + $password_question \ + $password_answer \ + $url \ + $email_verified_p \ + $member_state \ + $user_id \ + $username \ + $authority_id \ + $screen_name] } ad_proc -public person::person_p { Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.xql,v diff -u -r1.25 -r1.25.6.1 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 14 Sep 2009 00:13:05 -0000 1.25 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 25 Aug 2013 20:04:46 -0000 1.25.6.1 @@ -186,18 +186,7 @@ - - - update users - set password_question = :password_question, - password_answer = :password_answer - where user_id = :user_id - - - - - select c.item_id