Esmith::FormMagick::Panel::useraccounts

From SME Server
Jump to navigationJump to search

NAME

esmith::FormMagick::Panels::useraccounts - useful panel functions

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc esmith::FormMagick::Panels::useraccounts

SYNOPSIS

      use esmith::FormMagick::Panels::useraccount;

      my $panel = esmith::FormMagick::Panel::useraccount->new(); $panel->display();

DESCRIPTION

new();

Exactly as for esmith::FormMagick

HTML GENERATION ROUTINES

Routines for generating chunks of HTML needed by the panel.

print_user_table

Prints out the user table on the front page.

print_acctName_field

This subroutine is used to generate the Account name field on the form in the case of "create user", or to make it a plain uneditable string in the case of "modify user".

print_groupMemberships_field()

Builds a list of groups for the create/modify user screen.

print_page_description($self, "reset│lock│remove")

Generates the page description for the the somewhat similar Reset Password, Lock Account and Remove Account pages.

ROUTINES FOR FILLING IN FIELD DEFAULT VALUES

get_ldap_value($field)

This subroutine generates the default field value on the form using the parameter specified.

In this case, the default field values come from LDAP/directory settings.

If a CGI parameter has been passed that contains an account name, we assume that a value has already been set, as we’re modifying a user, and use that value instead of a default.

VALIDATION ROUTINES

pseudonym_clash

Validation routine to check whether a the first/last names clash with existing pseudonyms.

Note that it won’t be considered a "clash" if there is an existing pseudonym which belongs to the same user -- it’s only a clash if the generated pseudonyms are the same but the usernames aren’t.

emailforward()

Validation routine for email forwarding

verifyPasswords()

Returns an error message if the two new passwords input don’t match.

CREATING AND MODIFYING USERS

handle_user_accounts()

This is the routine called by the "Save" button on the create/modify page. It checks the "action" param and calls either create_user() or modify_user() as appropriate.

print_save_or_add_button()

modify_admin($self)

modify_user($self)

create_user

Adds a user to the accounts db.

set_groups

Sets a user’s groups in the accounts db. This is called as part of the create_user() routine.

REMOVING ACCOUNTS

remove_account()

RESETTING THE PASSWORD

reset_password()

LOCKING AN ACCOUNT

lock_account()

MISCELLANEOUS ROUTINES

build_user_cgi_params()

Builds a CGI query string based on user data, using various sensible defaults and esmith::FormMagick’s props_to_query_string() method.

validate_acctName

Checks that the name supplied does not contain any unacceptable chars. Returns OK on success or a localised error message otherwise.

validate_account_length FM ACCOUNTNAME

returns ’OK’ if the account name is shorter than the maximum account name length returns ’ACCOUNT_TOO_LONG’ otherwise

validate_acctName_conflict

Returns ’OK’ if the account name doesn’t yet exist. Returns a localised error otherwise.

check_password

Validates the password using the desired strength

get_prop ITEM PROP

A simple accessor for esmith::ConfigDB::Record::prop

System Password manipulation routines XXX FIXME - These should be merged with the useraccouts versions

system_password_compare

system_valid_password

Throw an error if the password doesn’t consist solely of one or more printable characters.

system_check_password

Validates the password using the desired strength

authenticate_password

Compares the password with the current system password

system_change_password

If everything has been validated, properly, go ahead and set the new password.