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.47.2.3 -r1.47.2.4 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 27 Jan 2006 16:53:26 -0000 1.47.2.3 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 13 May 2006 11:21:27 -0000 1.47.2.4 @@ -199,11 +199,18 @@ } ad_proc -public person::name { - {-person_id:required} + {-person_id ""} + {-email ""} } { get the name of a person. Cached. } { - return [util_memoize [list person::name_not_cached -person_id $person_id]] + if {$person_id eq "" && $email eq ""} { + error "You need to provide either person_id or email" + } elseif {![string eq "" $person_id] && ![string eq "" $email]} { + error "Only provide provide person_id OR email, not both" + } else { + return [util_memoize [list person::name_not_cached -person_id $person_id -email $email]] + } } ad_proc -public person::name_flush { @@ -216,11 +223,18 @@ } ad_proc -public person::name_not_cached { - {-person_id:required} + {-person_id ""} + {-email ""} } { get the name of a person } { - db_1row get_person_name {} + if {$email eq ""} { + db_1row get_person_name {} + } else { + # As the old functionality returned an error, but I want an empty string for e-mail + # Therefore for emails we use db_string + set person_name [db_string get_person_name {} -default ""] + } return $person_name } @@ -656,7 +670,13 @@ @return party_id } { - return [db_string select_party_id {*SQL*} -default ""] + # return [db_string select_party_id {*SQL*} -default ""] + + # The following query is identical in the result as the one above + # It just takes into account that some applications (like contacts) make email not unique + # Instead of overwriting this procedure in those packages, I changed it here, as the functionality + # is unchanged. + return [lindex [db_list select_party_id {}] 0] } ad_proc -public party::approved_members {