password-procs.tcl

Tcl API for password management.

Location:
packages/acs-authentication/tcl/password-procs.tcl
Created:
2003-09-03
Author:
Lars Pind <lars@collaobraid.biz>
CVS Identification:
$Id: password-procs.tcl,v 1.26.2.2 2021/04/08 16:18:58 antoniop Exp $

Procedures in this file

Detailed information

auth::password::CanChangePassword (private)

 auth::password::CanChangePassword -authority_id authority_id

Invoke the CanChangePassword operation on the given authority. Returns 0 if the authority does not have a password management driver.

Switches:
-authority_id (required)
The ID of the authority that we are inquiring about.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::can_change_p auth::password::can_change_p (public) auth::password::CanChangePassword auth::password::CanChangePassword auth::password::can_change_p->auth::password::CanChangePassword auth::password::create_contract auth::password::create_contract (private) auth::password::create_contract->auth::password::CanChangePassword acs_sc::invoke acs_sc::invoke (public) auth::password::CanChangePassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::CanChangePassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::CanChangePassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::CanResetPassword (private)

 auth::password::CanResetPassword -authority_id authority_id

Invoke the CanResetPassword operation on the given authority. Returns 0 if the authority does not have a password management driver.

Switches:
-authority_id (required)
The ID of the authority that we are inquiring about.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::can_reset_p auth::password::can_reset_p (public) auth::password::CanResetPassword auth::password::CanResetPassword auth::password::can_reset_p->auth::password::CanResetPassword auth::password::create_contract auth::password::create_contract (private) auth::password::create_contract->auth::password::CanResetPassword acs_sc::invoke acs_sc::invoke (public) auth::password::CanResetPassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::CanResetPassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::CanResetPassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::CanRetrievePassword (private)

 auth::password::CanRetrievePassword -authority_id authority_id

Invoke the CanRetrievePassword operation on the given authority. Returns 0 if the authority does not have a password management driver.

Switches:
-authority_id (required)
The ID of the authority that we are inquiring about.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::can_retrieve_p auth::password::can_retrieve_p (public) auth::password::CanRetrievePassword auth::password::CanRetrievePassword auth::password::can_retrieve_p->auth::password::CanRetrievePassword auth::password::create_contract auth::password::create_contract (private) auth::password::create_contract->auth::password::CanRetrievePassword acs_sc::invoke acs_sc::invoke (public) auth::password::CanRetrievePassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::CanRetrievePassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::CanRetrievePassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::ChangePassword (private)

 auth::password::ChangePassword -username username \
    [ -old_password old_password ] -new_password new_password \
    -authority_id authority_id

Invoke the ChangePassword operation on the given authority. Throws an error if the authority does not have a password management driver.

Switches:
-username (required)
-old_password (optional)
-new_password (required)
-authority_id (required)
The ID of the authority the user belongs to.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::change auth::password::change (public) auth::password::ChangePassword auth::password::ChangePassword auth::password::change->auth::password::ChangePassword auth::password::create_contract auth::password::create_contract (private) auth::password::create_contract->auth::password::ChangePassword acs_sc::invoke acs_sc::invoke (public) auth::password::ChangePassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::ChangePassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::ChangePassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::ResetPassword (private)

 auth::password::ResetPassword -username username \
    [ -authority_id authority_id ]

Invoke the ResetPassword operation on the given authority. Throws an error if the authority does not have a password management driver.

Switches:
-username (required)
-authority_id (optional)
The ID of the authority the user belongs to.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::create_contract auth::password::create_contract (private) auth::password::ResetPassword auth::password::ResetPassword auth::password::create_contract->auth::password::ResetPassword auth::password::reset auth::password::reset (public) auth::password::reset->auth::password::ResetPassword acs_sc::invoke acs_sc::invoke (public) auth::password::ResetPassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::ResetPassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::ResetPassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::RetrievePassword (private)

 auth::password::RetrievePassword -username username \
    -authority_id authority_id

Invoke the RetrievePassword operation on the given authority. Throws an error if the authority does not have a password management driver.

Switches:
-username (required)
-authority_id (required)
The ID of the authority the user belongs to.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::password::create_contract auth::password::create_contract (private) auth::password::RetrievePassword auth::password::RetrievePassword auth::password::create_contract->auth::password::RetrievePassword auth::password::retrieve auth::password::retrieve (public) auth::password::retrieve->auth::password::RetrievePassword acs_sc::invoke acs_sc::invoke (public) auth::password::RetrievePassword->acs_sc::invoke auth::authority::get_element auth::authority::get_element (public) auth::password::RetrievePassword->auth::authority::get_element auth::driver::get_parameter_values auth::driver::get_parameter_values (public) auth::password::RetrievePassword->auth::driver::get_parameter_values

Testcases:
No testcase defined.

auth::password::can_change_p (public)

 auth::password::can_change_p -user_id user_id

Returns whether we can change the password for the given user. This depends on the user's authority and the configuration of that authority.

Switches:
-user_id (required)
The ID of the user whose password you want to change.
Returns:
1 if the user can change password, 0 otherwise.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_can_change_reset_retrieve_p auth_password_can_change_reset_retrieve_p (test acs-authentication) auth::password::can_change_p auth::password::can_change_p test_auth_password_can_change_reset_retrieve_p->auth::password::can_change_p acs_user::get_user_info acs_user::get_user_info (public) auth::password::can_change_p->acs_user::get_user_info ad_log ad_log (public) auth::password::can_change_p->ad_log ad_try ad_try (public) auth::password::can_change_p->ad_try auth::password::CanChangePassword auth::password::CanChangePassword (private) auth::password::can_change_p->auth::password::CanChangePassword packages/acs-admin/lib/password-update.tcl packages/acs-admin/ lib/password-update.tcl packages/acs-admin/lib/password-update.tcl->auth::password::can_change_p packages/acs-subsite/www/user/password-reset.tcl packages/acs-subsite/ www/user/password-reset.tcl packages/acs-subsite/www/user/password-reset.tcl->auth::password::can_change_p packages/acs-subsite/www/user/password-update.tcl packages/acs-subsite/ www/user/password-update.tcl packages/acs-subsite/www/user/password-update.tcl->auth::password::can_change_p

Testcases:
auth_password_can_change_reset_retrieve_p

auth::password::can_reset_p (public)

 auth::password::can_reset_p -authority_id authority_id

Returns whether the given authority can reset forgotten passwords.

Switches:
-authority_id (required)
The ID of the authority that the user is trying to log into.
Returns:
1 if the authority allows resetting passwords, 0 otherwise.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_can_change_reset_retrieve_p auth_password_can_change_reset_retrieve_p (test acs-authentication) auth::password::can_reset_p auth::password::can_reset_p test_auth_password_can_change_reset_retrieve_p->auth::password::can_reset_p ad_log ad_log (public) auth::password::can_reset_p->ad_log ad_try ad_try (public) auth::password::can_reset_p->ad_try auth::password::CanResetPassword auth::password::CanResetPassword (private) auth::password::can_reset_p->auth::password::CanResetPassword auth::password::get_forgotten_url auth::password::get_forgotten_url (public) auth::password::get_forgotten_url->auth::password::can_reset_p auth::password::recover_password auth::password::recover_password (public) auth::password::recover_password->auth::password::can_reset_p packages/acs-admin/www/users/one.tcl packages/acs-admin/ www/users/one.tcl packages/acs-admin/www/users/one.tcl->auth::password::can_reset_p

Testcases:
auth_password_can_change_reset_retrieve_p

auth::password::can_retrieve_p (public)

 auth::password::can_retrieve_p -authority_id authority_id

Returns whether the given authority can retrieve forgotten passwords.

Switches:
-authority_id (required)
The ID of the authority that the user is trying to log into.
Returns:
1 if the authority allows retrieving passwords, 0 otherwise.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_can_change_reset_retrieve_p auth_password_can_change_reset_retrieve_p (test acs-authentication) auth::password::can_retrieve_p auth::password::can_retrieve_p test_auth_password_can_change_reset_retrieve_p->auth::password::can_retrieve_p ad_log ad_log (public) auth::password::can_retrieve_p->ad_log ad_try ad_try (public) auth::password::can_retrieve_p->ad_try auth::password::CanRetrievePassword auth::password::CanRetrievePassword (private) auth::password::can_retrieve_p->auth::password::CanRetrievePassword auth::password::get_forgotten_url auth::password::get_forgotten_url (public) auth::password::get_forgotten_url->auth::password::can_retrieve_p auth::password::recover_password auth::password::recover_password (public) auth::password::recover_password->auth::password::can_retrieve_p

Testcases:
auth_password_can_change_reset_retrieve_p

auth::password::change (public)

 auth::password::change -user_id user_id -old_password old_password \
    -new_password new_password

Change the user's password.

Switches:
-user_id (required)
The ID of the user whose password you want to change.
-old_password (required)
The current password of that user. This is required for security purposes.
-new_password (required)
The desired new password of the user.
Returns:
An array list with the following entries:
  • password_status: "ok", "no_account", "not_supported", "old_password_bad", "new_password_bad", "change_error", "failed_to_connect"
  • password_message: A human-readable description of what went wrong.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_email_on_password_change auth_email_on_password_change (test acs-authentication) auth::password::change auth::password::change test_auth_email_on_password_change->auth::password::change test_auth_password_change auth_password_change (test acs-authentication) test_auth_password_change->auth::password::change acs_user::get_user_info acs_user::get_user_info (public) auth::password::change->acs_user::get_user_info ad_conn ad_conn (public) auth::password::change->ad_conn ad_log ad_log (public) auth::password::change->ad_log ad_try ad_try (public) auth::password::change->ad_try ad_user_login ad_user_login (public) auth::password::change->ad_user_login packages/acs-admin/lib/password-update.tcl packages/acs-admin/ lib/password-update.tcl packages/acs-admin/lib/password-update.tcl->auth::password::change packages/acs-subsite/www/user/password-reset.tcl packages/acs-subsite/ www/user/password-reset.tcl packages/acs-subsite/www/user/password-reset.tcl->auth::password::change packages/acs-subsite/www/user/password-update.tcl packages/acs-subsite/ www/user/password-update.tcl packages/acs-subsite/www/user/password-update.tcl->auth::password::change

Testcases:
auth_password_change, auth_email_on_password_change

auth::password::email_password (private)

 auth::password::email_password -username username \
    -authority_id authority_id -password password \
    [ -subject_msg_key subject_msg_key ] \
    [ -body_msg_key body_msg_key ] [ -from from ]

Send an email to the user with given username and authority with the new password.

Switches:
-username (required)
-authority_id (required)
-password (required)
-subject_msg_key (optional, defaults to "acs-subsite.email_subject_Forgotten_password")
The message key you wish to use for the email subject.
-body_msg_key (optional, defaults to "acs-subsite.email_body_Forgotten_password")
The message key you wish to use for the email body.
-from (optional)
The email's from address. Can be in email@foo.com format. Defaults to ad_system_owner.
Returns:
Does not return anything. Any errors caused by acs_mail_lite::send are propagated
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::local::registration::Register auth::local::registration::Register (private) auth::password::email_password auth::password::email_password auth::local::registration::Register->auth::password::email_password auth::password::reset auth::password::reset (public) auth::password::reset->auth::password::email_password auth::password::retrieve auth::password::retrieve (public) auth::password::retrieve->auth::password::email_password _ _ (public) auth::password::email_password->_ acs_mail_lite::send acs_mail_lite::send (public) auth::password::email_password->acs_mail_lite::send acs_user::get_by_username acs_user::get_by_username (public) auth::password::email_password->acs_user::get_by_username ad_conn ad_conn (public) auth::password::email_password->ad_conn ad_pad ad_pad (public) auth::password::email_password->ad_pad

Testcases:
No testcase defined.

auth::password::get_change_url (public)

 auth::password::get_change_url -user_id user_id

Returns the URL to redirect to for changing passwords. If the user's authority has a "change_pwd_url" set, it'll return that, otherwise it'll return a link to /user/password-update under the nearest subsite.

Switches:
-user_id (required)
The ID of the user whose password you want to change.
Returns:
A URL that can be linked to for changing password.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_get_change_url auth_password_get_change_url (test acs-authentication) auth::password::get_change_url auth::password::get_change_url test_auth_password_get_change_url->auth::password::get_change_url db_1row db_1row (public) auth::password::get_change_url->db_1row export_vars export_vars (public) auth::password::get_change_url->export_vars subsite::get_element subsite::get_element (public) auth::password::get_change_url->subsite::get_element

Testcases:
auth_password_get_change_url

auth::password::get_forgotten_url (public)

 auth::password::get_forgotten_url [ -authority_id authority_id ] \
    [ -username username ] [ -email email ] [ -remote_only ]

Returns the URL to redirect to for forgotten passwords.

Switches:
-authority_id (optional)
The ID of the authority that the user is trying to log into.
-username (optional)
The username that the user's trying to log in with.
-email (optional)
-remote_only (optional, boolean)
If provided, only return any remote URL (not on this server).
Returns:
A URL that can be linked to when the user has forgotten his/her password, or the empty string if none can be found.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_get_forgotten_url auth_password_get_forgotten_url (test acs-authentication) auth::password::get_forgotten_url auth::password::get_forgotten_url test_auth_password_get_forgotten_url->auth::password::get_forgotten_url acs_user::get_user_info acs_user::get_user_info (public) auth::password::get_forgotten_url->acs_user::get_user_info auth::authority::get_element auth::authority::get_element (public) auth::password::get_forgotten_url->auth::authority::get_element auth::authority::local auth::authority::local (public) auth::password::get_forgotten_url->auth::authority::local auth::password::can_reset_p auth::password::can_reset_p (public) auth::password::get_forgotten_url->auth::password::can_reset_p auth::password::can_retrieve_p auth::password::can_retrieve_p (public) auth::password::get_forgotten_url->auth::password::can_retrieve_p auth::password::email_password auth::password::email_password (private) auth::password::email_password->auth::password::get_forgotten_url auth::password::recover_password auth::password::recover_password (public) auth::password::recover_password->auth::password::get_forgotten_url packages/acs-subsite/lib/login.tcl packages/acs-subsite/ lib/login.tcl packages/acs-subsite/lib/login.tcl->auth::password::get_forgotten_url

Testcases:
auth_password_get_forgotten_url

auth::password::recover_password (public)

 auth::password::recover_password [ -authority_id authority_id ] \
    [ -username username ] [ -email email ]

Handles forgotten passwords. Attempts to retrieve a password; if not possible, attempts to reset a password. If it succeeds, it emails the user. For all outcomes, it returns a message to be displayed.

Switches:
-authority_id (optional)
The ID of the authority that the user is trying to log into.
-username (optional)
The username that the user's trying to log in with.
-email (optional)
Email can be supplied instead of authority_id and username.
Returns:
Array list with the following entries:
  • password_status: ok, no_support, failed_to_connect
  • password_message: Human-readable message to be relayed to the user. May contain HTML.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_recover auth_password_recover (test acs-authentication) auth::password::recover_password auth::password::recover_password test_auth_password_recover->auth::password::recover_password _ _ (public) auth::password::recover_password->_ acs_user::get_user_info acs_user::get_user_info (public) auth::password::recover_password->acs_user::get_user_info ad_returnredirect ad_returnredirect (public) auth::password::recover_password->ad_returnredirect ad_script_abort ad_script_abort (public) auth::password::recover_password->ad_script_abort auth::UseEmailForLoginP auth::UseEmailForLoginP (public) auth::password::recover_password->auth::UseEmailForLoginP packages/acs-subsite/www/register/recover-password.tcl packages/acs-subsite/ www/register/recover-password.tcl packages/acs-subsite/www/register/recover-password.tcl->auth::password::recover_password

Testcases:
auth_password_recover

auth::password::reset (public)

 auth::password::reset [ -admin ] -authority_id authority_id \
    -username username

Reset the user's password, which means setting it to a new randomly generated password and inform the user of that new password.

Switches:
-admin (optional, boolean)
Specify this flag if this call represents an admin changing a user's password.
-authority_id (required)
The authority of the user
-username (required)
The username of the user
Returns:
An array list with the following entries:
  • password_status: ok, no_account, not_supported, reset_error, failed_to_connect
  • password_message: A human-readable message to be relayed to the user. May be empty if password_status is ok. May include HTML. Could be empty if password_status is ok.
  • password: The new, automatically generated password. If no password is included in the return array, that means the new password has already been sent to the user somehow. If it is returned, it means that caller is responsible for informing the user of his/her new password.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_reset auth_password_reset (test acs-authentication) auth::password::reset auth::password::reset test_auth_password_reset->auth::password::reset _ _ (public) auth::password::reset->_ ad_conn ad_conn (public) auth::password::reset->ad_conn ad_log ad_log (public) auth::password::reset->ad_log ad_try ad_try (public) auth::password::reset->ad_try auth::password::ResetPassword auth::password::ResetPassword (private) auth::password::reset->auth::password::ResetPassword auth::password::recover_password auth::password::recover_password (public) auth::password::recover_password->auth::password::reset packages/acs-admin/www/users/password-reset.tcl packages/acs-admin/ www/users/password-reset.tcl packages/acs-admin/www/users/password-reset.tcl->auth::password::reset

Testcases:
auth_password_reset

auth::password::retrieve (public)

 auth::password::retrieve -authority_id authority_id -username username

Retrieve the user's password.

Switches:
-authority_id (required)
The ID of the authority that the user is trying to log into.
-username (required)
The username that the user's trying to log in with.
Returns:
An array list with the following entries:
  • password_status: ok, no_account, not_supported, retrieve_error, failed_to_connect
  • password_message: A human-readable message to be relayed to the user. May be empty if password_status is ok. May include HTML.
  • password: The retrieved password.

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_password_retrieve auth_password_retrieve (test acs-authentication) auth::password::retrieve auth::password::retrieve test_auth_password_retrieve->auth::password::retrieve _ _ (public) auth::password::retrieve->_ ad_log ad_log (public) auth::password::retrieve->ad_log ad_try ad_try (public) auth::password::retrieve->ad_try auth::password::RetrievePassword auth::password::RetrievePassword (private) auth::password::retrieve->auth::password::RetrievePassword auth::password::email_password auth::password::email_password (private) auth::password::retrieve->auth::password::email_password auth::password::recover_password auth::password::recover_password (public) auth::password::recover_password->auth::password::retrieve

Testcases:
auth_password_retrieve
[ show source ]