Index: openacs-4/packages/acs-subsite/www/shared/portrait.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/portrait.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-subsite/www/shared/portrait.tcl 21 Jan 2018 01:13:57 -0000 1.12 +++ openacs-4/packages/acs-subsite/www/shared/portrait.tcl 28 May 2018 17:53:50 -0000 1.13 @@ -18,25 +18,31 @@ set subsite_url [subsite::get_element -element url] -if {![db_0or1row user_info { - select first_names, last_name - from persons - where person_id = :user_id -}]} { +if {![person::person_p -party_id $user_id]} { ad_return_warning \ "Account Unavailable" \ "We can't find user #$user_id in the users table." ad_script_abort } +set person [person::get -person_id $user_id] +set first_names [dict get $person first_names] +set last_name [dict get $person last_name] + +set item_id [acs_user::get_portrait_id \ + -user_id $user_id] +set portrait_p [expr {$item_id != 0}] + +if {!$portrait_p} { + ad_return_complaint 1 "
  • You shouldn't have gotten here; we don't have a portrait on file for this person." + return +} + if {![db_0or1row get_item_id { select i.width, i.height, cr.title, cr.description, cr.publish_date - from acs_rels a, cr_items c, cr_revisions cr, images i - where a.object_id_two = c.item_id - and c.live_revision = cr.revision_id - and cr.revision_id = i.image_id - and a.object_id_one = :user_id - and a.rel_type = 'user_portrait_rel' + from cr_revisions cr, images i + where cr.revision_id = i.image_id + and cr.revision_id = (select live_revision from cr_items where item_id = :item_id) }]} { ad_return_complaint 1 "
  • You shouldn't have gotten here; we don't have a portrait on file for this person." return Index: openacs-4/packages/acs-subsite/www/pvt/alerts.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/alerts.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/pvt/alerts.tcl 7 Aug 2017 23:47:59 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/pvt/alerts.tcl 28 May 2018 18:00:16 -0000 1.8 @@ -14,15 +14,13 @@ set user_id [ad_conn user_id] -db_1row name_get { - select first_names, last_name, email, url - from persons, parties - where persons.person_id = parties.party_id and party_id =:user_id -} -bind [ad_tcl_vars_to_ns_set user_id] - -if { $first_names ne "" || $last_name ne "" } { - set full_name "$first_names $last_name" -} else { +set user [acs_user::get -user_id $user_id] +set first_names [dict get $user first_names] +set last_name [dict get $user last_name] +set email [dict get $user email] +set url [dict get $user url] +set full_name [dict get $user name] +if { [string trim $full_name] eq "" } { set full_name "name unknown" } Index: openacs-4/packages/acs-admin/www/users/user-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/user-add-2.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-admin/www/users/user-add-2.tcl 7 Aug 2017 23:47:45 -0000 1.12 +++ openacs-4/packages/acs-admin/www/users/user-add-2.tcl 28 May 2018 18:03:30 -0000 1.13 @@ -30,11 +30,8 @@ set password [ad_generate_random_string] } -set administration_name [db_string admin_name { - select first_names || ' ' || last_name - from persons - where person_id = :admin_user_id -}] +set administration_name [acs_user::get_element \ + -user_id $admin_user_id -element name] set context [list [list "./" "Users"] "Notify added user"] set system_name [ad_system_name]