auth::check_local_account_status (private)

 auth::check_local_account_status [ -return_url return_url ] \
    [ -no_dialogue ] -user_id user_id -authority_id authority_id \
    -member_state member_state -email email \
    -email_verified_p email_verified_p -screen_name screen_name \
    -password_age_days password_age_days

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

Check the account status of a user with the given parameters.

Switches:
-return_url (optional)
-no_dialogue (optional, boolean)
If specified, will not send out email or in other ways converse with the user
-user_id (required)
-authority_id (required)
-member_state (required)
-email (required)
-email_verified_p (required)
-screen_name (required)
-password_age_days (required)
Returns:
An array-list with account_status, account_url and account_message

Partial Call Graph (max 5 caller/called nodes):
%3 auth::get_local_account auth::get_local_account (private) auth::check_local_account_status auth::check_local_account_status auth::get_local_account->auth::check_local_account_status auth::get_local_account_status auth::get_local_account_status (public) auth::get_local_account_status->auth::check_local_account_status _ _ (public) auth::check_local_account_status->_ acs_user::ScreenName acs_user::ScreenName (public) auth::check_local_account_status->acs_user::ScreenName ad_acs_kernel_id ad_acs_kernel_id (public) auth::check_local_account_status->ad_acs_kernel_id ad_log ad_log (public) auth::check_local_account_status->ad_log ad_system_name ad_system_name (public) auth::check_local_account_status->ad_system_name

Testcases:
No testcase defined.
Source code:
    # Initialize to 'closed', because most cases below mean the account is closed
    set result(account_status) "closed"

    # system_name and email is used in some of the I18N messages
    set system_name [ad_system_name]

    switch $member_state {
        approved {
            set PasswordExpirationDays [parameter::get  -parameter PasswordExpirationDays  -package_id [ad_acs_kernel_id]  -default 0]

            if { $email_verified_p == "f" } {
                if { !$no_dialogue_p } {
                    set result(account_message) [subst {
                        <p>[_ acs-subsite.lt_Registration_informat]</p>
                        <p>[_ acs-subsite.lt_Please_read_and_follo]</p>
                    }]

                    ad_try {
                        auth::send_email_verification_email -user_id $user_id
                    } on error {errorMsg} {
                        ad_log Error "auth::check_local_account_status: Error sending out email verification email to email $email: $errorMsg"
                        set result(account_message) [_ acs-subsite.Error_sending_verification_mail]
                    }
                }

            } elseif { [acs_user::ScreenName] eq "require"
                       && $screen_name eq ""
                   } {
                set message "Please enter a screen name now."
                set result(account_url) [export_vars -no_empty  -base "[subsite::get_element -element url]user/basic-info-update" {
                                                 message return_url {edit_p 1}
                                             }]

            } elseif$PasswordExpirationDays > 0
                       && ($password_age_days eq "" || $password_age_days > $PasswordExpirationDays)
                   } {
                set message [_ acs-subsite.Password_regular_change_now]
                set result(account_url) [export_vars -base "[subsite::get_element -element url]user/password-update" { return_url message }]
            } else {
                set result(account_status) "ok"
            }
        }
        banned {
            set result(account_message) [_ acs-subsite.lt_Sorry_but_it_seems_th]
        }
        deleted {
            set restore_url [export_vars -base "restore-user" { return_url }]
            set result(account_message) [_ acs-subsite.Account_closed]
        }
        rejected - "needs approval" {
            set result(account_message)  "<p>[_ acs-subsite.lt_registration_request_submitted]</p><p>[_ acs-subsite.Thank_you]</p>"
        }
        default {
            set result(account_message) [_ acs-subsite.Problem_auth_no_memb]
            ns_log Error "auth::check_local_account_status: problem with registration state machine: user_id $user_id has member_state '$member_state'"
        }
    }

    return [array get result]
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: