auth::delete_local_account (public)

 auth::delete_local_account -authority_id authority_id \
    -username username

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

Delete the local account for a user.

Switches:
-authority_id (required)
-username (required)
Returns:
Array list containing the following entries:
  • delete_status: ok, delete_error, failed_to_connect. Says whether user deletion succeeded.
  • delete_message: Information about the problem, to be relayed to the user. If delete_status is not ok, then delete_message is guaranteed to be nonempty. May contain HTML.
All entries are guaranteed to always be set, but may be empty.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth__delete_local_account auth__delete_local_account (test acs-authentication) auth::delete_local_account auth::delete_local_account test_auth__delete_local_account->auth::delete_local_account _ _ (public) auth::delete_local_account->_ acs_user::ban acs_user::ban (public) auth::delete_local_account->acs_user::ban acs_user::get_by_username acs_user::get_by_username (public) auth::delete_local_account->acs_user::get_by_username auth::sync::job::action auth::sync::job::action (public) auth::sync::job::action->auth::delete_local_account

Testcases:
auth__delete_local_account
Source code:
    array set result {
        delete_status ok
        delete_message {}
        user_id {}
    }

    set user_id [acs_user::get_by_username  -authority_id $authority_id  -username $username]

    if { $user_id eq "" } {
        set result(delete_status) "delete_error"
        set result(delete_message) [_ acs-subsite.No_user_with_this_username]
        return [array get result]
    }

    # Mark the account banned
    acs_user::ban -user_id $user_id

    set result(user_id) $user_id

    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: