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.26 -r1.27 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 5 Sep 2003 13:52:09 -0000 1.26 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 8 Sep 2003 16:06:15 -0000 1.27 @@ -512,6 +512,7 @@ {-screen_name} {-password_question} {-password_answer} + {-email_verified_p} } { Update information about a user. Feel free to expand this with more switches later as needed, as long as they're optional. @@ -522,11 +523,12 @@ @option screen_name The new screen_name for the user @option password_question The new password_question for the user @option password_answer The new password_question for the user + @option email_verified_p Whether the email address has been verified @author Lars Pind (lars@collaboraid.biz) } { set cols [list] - foreach var { authority_id username screen_name password_question password_answer } { + foreach var { authority_id username screen_name password_question password_answer email_verified_p } { if { [info exists $var] } { lappend cols "$var = :$var" } @@ -555,8 +557,8 @@ ad_proc -public party::update { {-party_id:required} - {-email:required} - {-url:required} + {-email} + {-url} } { Update information about a party. @@ -566,5 +568,22 @@ @author Lars Pind (lars@collaboraid.biz) } { + set cols [list] + foreach var { email url } { + if { [info exists $var] } { + lappend cols "$var = :$var" + } + } db_dml party_update {} } + +ad_proc -public party::get_by_email { + {-email:required} +} { + Return the party_id of the party with the given email. Returns empty string if no party found. + + @return party_id +} { + return [db_string select_party_id {} -default {}] +} + 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.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 4 Sep 2003 13:07:03 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 8 Sep 2003 16:06:15 -0000 1.8 @@ -185,11 +185,20 @@ update parties - set email = :email, - url = :url + set [join $cols ", "] where party_id = :party_id - + + + + + select party_id + from parties + where email = :email + + + +