auth::get_registration_elements (public)

 auth::get_registration_elements

Defined in packages/acs-authentication/tcl/authentication-procs.tcl

Get the list of required/optional elements for user registration.

Returns:
Array-list with two entries
  • required: a list of required elements
  • optional: a list of optional elements
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_get_registration_elements auth_get_registration_elements (test acs-authentication) auth::get_registration_elements auth::get_registration_elements test_auth_get_registration_elements->auth::get_registration_elements test_auth_use_email_for_login_p auth_use_email_for_login_p (test acs-authentication) test_auth_use_email_for_login_p->auth::get_registration_elements acs_user::ScreenName acs_user::ScreenName (public) auth::get_registration_elements->acs_user::ScreenName auth::get_register_authority auth::get_register_authority (public) auth::get_registration_elements->auth::get_register_authority auth::registration::GetElements auth::registration::GetElements (private) auth::get_registration_elements->auth::registration::GetElements auth::get_registration_form_elements auth::get_registration_form_elements (public) auth::get_registration_form_elements->auth::get_registration_elements packages/acs-subsite/lib/user-new.tcl packages/acs-subsite/ lib/user-new.tcl packages/acs-subsite/lib/user-new.tcl->auth::get_registration_elements

Testcases:
auth_get_registration_elements, auth_use_email_for_login_p
Source code:
    set authority_id [auth::get_register_authority]

    array set element_info [auth::registration::GetElements -authority_id $authority_id]

    if { ![info exists element_info(required)] } {
        set element_info(required) {}
    }
    if { ![info exists element_info(optional)] } {
        set element_info(optional) {}
    }

    set local_required_elms { first_names last_name email }
    set local_optional_elms {}

    switch [acs_user::ScreenName] {
        require {
            lappend local_required_elms "screen_name"
        }
        solicit {
            lappend local_optional_elms "screen_name"
        }
    }

    # Handle required elements for local account
    foreach elm $local_required_elms {
        # Add to required
        if { $elm ni $element_info(required) } {
            lappend element_info(required) $elm
        }

        # Remove from optional
        set index [lsearch $element_info(optional) $elm]
        if { $index != -1 } {
            set element_info(optional) [lreplace $element_info(optional) $index $index]
        }
    }

    foreach elm $local_optional_elms {
        # Add to required
        if { $elm ni $element_info(required) && $elm ni $element_info(optional) } {
            lappend element_info(optional) $elm
        }
    }

    return [array get element_info]
Generic XQL file:
packages/acs-authentication/tcl/authentication-procs.xql

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

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

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