Forum OpenACS Q&A: tcl procs to get user information?

Collapse
Posted by tammy m on
I see this code in the standard oacs index.tcl:

if { ![empty_string_p $user_id]} {
    # The user is loged in.
    if {[db_0or1row user_name_select {
        select first_names || ' ' || last_name as name, email
        from persons, parties
        where person_id = :user_id
        and person_id = party_id
    }]} {
        set home_url [ad_pvt_home]
        set home_url_name [ad_pvt_home_name]
    }
    set requires_registration_p_clause ""
}

Does this mean there are not tcl procs to fetch basic user info in the oacs library somewhere? If there are, could someone point me to where/what they are?

thanks

Collapse
Posted by Dave Bauer on
Try oacs::user::get https://openacs.org/api-doc/proc-view?proc=oacs%3a%3auser%3a%3aget

That code predates the tcl proc, but noone has taken the time to update the code because it was working :)

Collapse
Posted by tammy m on
Thanks:) I knew I had to be missing something!
Collapse
Posted by Randy O'Meara on
Any reason not to use the procs in the acs_user:: namespace? There's also a 'get' proc in there. Looks like the acs_user::get returns additional information and utilizes the cc_users view.

The oacs::user::get proc explicitly joins the users, parties, and persons tables to do essentially the same thing. The oacs:: namespace is pretty sparse... it contains only the oacs::user::get proc.

In general, is it better to join the three tables or use the cc_users view?

Collapse
Posted by Roberto Mello on
Use acs_user::. We should deprecate oacs::user::get. Anyone see a reason why we shouldn't?

-Roberto

Collapse
Posted by Benjamin Bytheway on
In my work to add a screen name / real parameter to acs-subsite, I had planned to add all my tcl procs as part of acs_subsite in the user_display:: namespace.  Should my changes instead be a part of acs_user::, even though the parameter is controlled by acs-subsite?
Collapse
Posted by tammy m on
How come I can't see acs_user::get in the api-doc? I searched in the latest docs on OpenACS.org and it just doesn't come up.
Collapse
Posted by Randy O'Meara on
CVS Log
Revision 1.12.2.4 / (download) - annotate - [select for diffs], Wed Jul 2 19:24:30 2003 UTC (5 weeks, 2 days ago) by lars
Branch: oacs-4-6
Changes since 1.12.2.3: +171 -0 lines
Diff to previous 1.12.2.3 (colored) to branchpoint 1.12 (colored)
Added API for setting/getting bio, updating users and parties, and getting user information ==================================================================================

Looks like it was added on the 4-6 branch by Lars 5 weeks and 2 days ago.