# Account modules (modules.inc)

Modules.inc provides the interface to all module specific functions. It includes a list of account independent function and the accountContainer class. This class represents an LDAP account.
You should never call module functions directly, always use a function in modules.inc.

## Account independent functions:

### General functions:

getModuleAlias: This returns the alias name of a module. It is used to label buttons or fieldsets.
parseHtml: Converts the LAM meta HTML code to real HTML code.

### Functions for LAM configuration:

is_base_module: When the given module is a base module then this returns true. Every account type needs exactly one base module.
getModulesDependencies: Account modules can specify dependencies to other modules. E.g. Samba accounts always need a Unix part.
check_module_depends/check_module_conflicts: This function checks if all module dependencies are satisfied.
getAvailableModules: Returns a list of available modules. If you need a list of all active modules use $_SESSION['config']->get_AccountModules().
getConfigOptions: Returns a list of all configuration options which were defined by the modules.
getConfigDescriptions: Returns a list of all configuration descriptions and titles for the fieldsets.
checkConfigOptions: Checks if the user filled in valid values for each option.

### Account list functions:

get_ldap_filter: Each account list shows only entries which match a given LDAP search filter.

### Profile/account pages:

getRDNAttributes: This returns a list of possible LDAP RDN attributes. LAM needs this to build the DN for new accounts.
getProfileOptions: Returns a list of all profile options which were defined by the account modules.
checkProfileOptions: Checks if all module options are correct.

### Help functions:

getHelp: Returns a module help entry.

### PDF functions:

getAvailablePDFFields: Returns a list of possible PDF fields.

### Upload functions:

getUploadColumns: Returns a list of possible upload columns and additional information like a description, help entry and example value.
buildUploadAccounts: Takes the input of the CSV file and builds the LDAP accounts.
doUploadPostActions: Manages the execution of actions which need to be done after the accounts are created.

## Class accountContainer:

This class represents a complete LDAP account. It manages all functions which concern a specific LDAP entry.

#### Important variables:

There are some class variables which can be of important use in the account modules.
module: List of account modules (array('name' => 'object')).
isNewAccount: This variable is true when the account is newly created, false if loaded from LDAP.

#### Function list:

continue_main: This function is called when an account page is displayed. It generates the HTML code for the account pages.
save_module_attributes: Finds differences between current and original account.
load_account: Loads an LDAP account.
new_account: Creates a new account.
save_account: Saves an account to LDAP.
get_pdfEntries: Returns the PDF values of an account.