acs_user::get_by_username (public)

 acs_user::get_by_username [ -authority_id authority_id ] \
    -username username

Defined in packages/acs-tcl/tcl/community-core-procs.tcl

Returns user_id from authority and username. Returns the empty string if no user found.

Switches:
-authority_id (optional)
The authority. Defaults to local authority.
-username (required)
The username of the user you're trying to find.
Returns:
user_id of the user, or the empty string if no user found.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_authenticate auth_authenticate (test acs-authentication) acs_user::get_by_username acs_user::get_by_username test_auth_authenticate->acs_user::get_by_username test_auth_create_user auth_create_user (test acs-authentication) test_auth_create_user->acs_user::get_by_username test_auth_password_reset auth_password_reset (test acs-authentication) test_auth_password_reset->acs_user::get_by_username acs_user::get_by_username_not_cached acs_user::get_by_username_not_cached (private) acs_user::get_by_username->acs_user::get_by_username_not_cached auth::authority::get auth::authority::get (public) acs_user::get_by_username->auth::authority::get acs::test::auth::registration::Register acs::test::auth::registration::Register (private) acs::test::auth::registration::Register->acs_user::get_by_username acs_user::get acs_user::get (public) acs_user::get->acs_user::get_by_username acs_user::promote_person_to_user acs_user::promote_person_to_user (public) acs_user::promote_person_to_user->acs_user::get_by_username auth::create_local_account auth::create_local_account (public) auth::create_local_account->acs_user::get_by_username auth::delete_local_account auth::delete_local_account (public) auth::delete_local_account->acs_user::get_by_username

Testcases:
auth_authenticate, auth_create_user, auth_password_reset
Source code:

    if { $authority_id eq "" } {
        #
        # Get the default authority
        #
        set authority_id [auth::authority::get]
    }

    set key [list get_by_username  -authority_id $authority_id -username $username]

    while {1} {
        set user_id [ns_cache eval user_info_cache $key {
            set user_id [acs_user::get_by_username_not_cached  -authority_id $authority_id  -username $username]
            #
            # Don't cache results from invalid usernames.
            #
            if {$user_id eq ""} {
                break
            }
            return $user_id
        }]
        break
    }

    return $user_id
Generic XQL file:
packages/acs-tcl/tcl/community-core-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/community-core-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/community-core-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: