modules
[ class tree: modules ] [ index: modules ] [ all elements ]

Class: baseModule

Source Location: /lib/baseModule.inc

Class Overview


Parent class of all account modules.


Author(s):

  • Roland Gruber

Variables

Methods


Child classes:

account
Manages the object class "account" for users and hosts.
ieee802Device
Provides MAC addresses for hosts.
inetLocalMailRecipient
Provides mail routing for users.
inetOrgPerson
This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
kolabUser
Manages Kolab user accounts.
ldapPublicKey
Manages SSH public keys.
nisMailAlias
Provides NIS mail alias management.
posixAccount
Manages the object class "posixAccount" for users and hosts.
posixGroup
Manages the object class "posixGroup" for groups.
quota
Manages quotas for users and groups.
sambaAccount
Manages the object class "sambaAccount" for users and hosts.
sambaDomain
Manages Samba 3 domain entries.
sambaGroupMapping
Manages the object class "sambaGroupMapping" for groups.
sambaSamAccount
Manages the object class "sambaSamAccount" for users and hosts.
shadowAccount
Manages the object class "shadowAccount" for users.

Class Details

[line 53]
Parent class of all account modules.

It implements the complete module interface and uses meta-data provided by the account modules for its functions.

Location and naming of modules
All LAM modules are placed in lib/modules/ and are named "<class name>.inc". E.g. if you create a new module and its class name is "qmail" then the filename would be "qmail.inc". The class name of a module must contain only a-z, A-Z, 0-9, -, and _.

You can avoid to override many functions by using get_metaData().

All module classes should extend the baseModule class.




Tags:

author:  Roland Gruber
abstract:  


[ Top ]


Class Variables

$attributes =

[line 71]

contains all ldap attributes which should be written



Tags:

access:  protected

Type:   mixed


[ Top ]

$autoAddObjectClasses =

[line 80]

if true, managed object classes are added when an account is created or loaded (default: true)



Tags:

access:  protected

Type:   mixed


[ Top ]

$messages =

[line 77]

contains all error messages of a module



Tags:

access:  protected

Type:   mixed


[ Top ]

$meta =

[line 56]

includes all meta data provided by the sub class



Tags:

access:  protected

Type:   mixed


[ Top ]

$moduleSettings =

[line 62]

configuration settings of all modules



Tags:

access:  protected

Type:   mixed


[ Top ]

$orig =

[line 74]

contains all ldap attributes which are loaded from ldap



Tags:

access:  protected

Type:   mixed


[ Top ]

$selfServiceSettings =

[line 65]

self service settings of all modules



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 87]

baseModule __construct( string $scope)

Creates a new base module class



Tags:

access:  public


Overridden in child classes as:

kolabUser::__construct()
Creates a new kolabUser object.
sambaAccount::__construct()
Creates a new sambaAccount object.
sambaGroupMapping::__construct()
Creates a new module for Samba 3 groups.
sambaSamAccount::__construct()
Creates a new sambaSamAccount object.

Parameters:

string   $scope   the account type (user, group, host)

[ Top ]

method build_uploadAccounts [line 854]

array build_uploadAccounts( array $rawAccounts, array $ids, &$partialAccounts, array $partialAccounts)

In this function the LDAP accounts are built.

Calling this method does not require the existence of an enclosing accountContainer.

Returns an array which contains subarrays to generate StatusMessages if any errors occured.




Tags:

return:  list of error messages if any
access:  public


Overridden in child classes as:

account::build_uploadAccounts()
In this function the LDAP account is built up.
ieee802Device::build_uploadAccounts()
In this function the LDAP account is built up.
inetLocalMailRecipient::build_uploadAccounts()
In this function the LDAP account is built up.
inetOrgPerson::build_uploadAccounts()
In this function the LDAP account is built up.
kolabUser::build_uploadAccounts()
In this function the LDAP account is built up.
ldapPublicKey::build_uploadAccounts()
In this function the LDAP account is built up.
nisMailAlias::build_uploadAccounts()
In this function the LDAP account is built up.
posixAccount::build_uploadAccounts()
In this function the LDAP account is built up.
posixGroup::build_uploadAccounts()
In this function the LDAP account is built up.
sambaAccount::build_uploadAccounts()
In this function the LDAP account is built up.
sambaDomain::build_uploadAccounts()
In this function the LDAP account is built up.
sambaGroupMapping::build_uploadAccounts()
In this function the LDAP account is built up.
sambaSamAccount::build_uploadAccounts()
In this function the LDAP account is built up.
shadowAccount::build_uploadAccounts()
In this function the LDAP account is built up.

Parameters:

array   $rawAccounts   the user input data, contains one subarray for each account.
array   $partialAccounts   list of hash arrays (name => value) which are later added to LDAP
array   $ids   list of IDs for column position (e.g. "posixAccount_uid" => 5)
   &$partialAccounts  

[ Top ]

method can_manage [line 397]

boolean can_manage( )

Returns true if this module can manage accounts of the current type, otherwise false.

Calling this method does not require the existence of an enclosing accountContainer.




Tags:

return:  true if module fits
see:  baseModule::get_metaData()
access:  public


[ Top ]

method checkSelfServiceOptions [line 1216]

array checkSelfServiceOptions( string $fields, array $attributes)

Checks if all input values are correct and returns the LDAP attributes which should be changed.

Calling this method does not require the existence of an enclosing accountContainer.




Tags:

return:  messages and attributes (array('messages' => array(), 'add' => array('mail' => array('test@test.com')), 'del' => array(), 'mod' => array()))
access:  public


Overridden in child classes as:

inetOrgPerson::checkSelfServiceOptions()
Checks if all input values are correct and returns the LDAP commands which should be executed.
posixAccount::checkSelfServiceOptions()
Checks if all input values are correct and returns the LDAP commands which should be executed.
sambaSamAccount::checkSelfServiceOptions()
Checks if all input values are correct and returns the LDAP commands which should be executed.

Parameters:

string   $fields   input fields
array   $attributes   LDAP attributes

[ Top ]

method checkSelfServiceSettings [line 1252]

array checkSelfServiceSettings( array $options)

Checks if the self service settings are valid.

Calling this method does not require the existence of an enclosing accountContainer.

If the input data is invalid the return value is an array that contains arrays to build StatusMessages (message type, message head, message text). If no errors occured the function returns an empty array.




Tags:

return:  error messages
access:  public


Parameters:

array   $options   hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.

[ Top ]

method check_configOptions [line 670]

array check_configOptions( array $scopes, array $options)

Checks input values of module settings.

Calling this method does not require the existence of an enclosing accountContainer.

If the input data is invalid the return value is an array that contains subarrays to build StatusMessages ('message type', 'message head', 'message text').
If no errors occured the function returns an empty array.




Tags:

return:  list of error messages
see:  baseModule::get_metaData()
access:  public


Overridden in child classes as:

posixAccount::check_configOptions()
Checks input values of module settings.

Parameters:

array   $scopes   list of account types which are used
array   $options   hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.

[ Top ]

method check_profileOptions [line 536]

array check_profileOptions( array $options)

Checks input values of account profiles.

Calling this method does not require the existence of an enclosing accountContainer.

$options is an hash array (option name => value) that contains the user input. The option values are all arrays containing one or more elements.
If the input data is invalid the return value is an array that contains arrays to build StatusMessages (message type, message head, message text). If no errors occured the function returns an empty array.




Tags:

return:  list of error messages (array(type, title, text)) to generate StatusMessages, if any
see:  baseModule::get_metaData()
access:  public


Overridden in child classes as:

quota::check_profileOptions()
Checks input values of account profiles.

Parameters:

array   $options   a hash array (name => value) containing the user input

[ Top ]

method delete_attributes [line 1054]

List delete_attributes( )

This function returns an array with the same syntax as save_attributes().

Calling this method requires the existence of an enclosing accountContainer.

It allows additional LDAP changes when an account is deleted.




Tags:

return:  of LDAP operations, same as for save_attributes()
access:  public


Overridden in child classes as:

posixAccount::delete_attributes()
Additional LDAP operations on delete.
posixGroup::delete_attributes()
Checks if the group which should be deleted is still used as primary group.

[ Top ]

method display_html_attributes [line 1095]

meta display_html_attributes( )

This function creates meta HTML code to display the module page.

Calling this method requires the existence of an enclosing accountContainer.




Tags:

return:  HTML
see:  parseHtml()
abstract:  
access:  public


Overridden in child classes as:

account::display_html_attributes()
Returns the HTML meta data for the main account page.
ieee802Device::display_html_attributes()
Returns the HTML meta data for the main account page.
inetLocalMailRecipient::display_html_attributes()
Returns the HTML meta data for the main account page.
inetOrgPerson::display_html_attributes()
Returns the HTML meta data for the main account page.
kolabUser::display_html_attributes()
Returns the HTML meta data for the main account page.
ldapPublicKey::display_html_attributes()
Returns the HTML meta data for the main account page.
nisMailAlias::display_html_attributes()
Returns the HTML meta data for the main account page.
posixAccount::display_html_attributes()
Returns the HTML meta data for the main account page.
posixGroup::display_html_attributes()
Returns the HTML meta data for the main account page.
quota::display_html_attributes()
Returns the HTML meta data for the main account page.
sambaAccount::display_html_attributes()
Returns the HTML meta data for the main account page.
sambaDomain::display_html_attributes()
Returns the HTML meta data for the main account page.
sambaGroupMapping::display_html_attributes()
Returns the HTML meta data for the main account page.
sambaSamAccount::display_html_attributes()
Returns the HTML meta data for the main account page.
shadowAccount::display_html_attributes()
This function will create the meta HTML code to show a page with all attributes.

[ Top ]

method display_html_delete [line 1069]

meta display_html_delete( )

This function creates meta HTML code which will be displayed when an account should be deleted.

Calling this method requires the existence of an enclosing accountContainer.

This can be used to interact with the user, e.g. should the home directory be deleted? The output of all modules is displayed on a single page.




Tags:

return:  HTML code
see:  parseHtml()
access:  public


Overridden in child classes as:

posixAccount::display_html_delete()
Displays the delete homedir option for the delete page.

[ Top ]

method doUploadPostActions [line 967]

array doUploadPostActions( array $data, array $ids, array $failed, &$temp, array $temp)

This function is responsible to do additional tasks after the account has been created in LDAP (e.g. modifying group memberships, adding Quota etc..).

Calling this method does not require the existence of an enclosing accountContainer.

This function is called as long as the returned status is 'finished'. Please make sure that one function call lasts no longer than 3-4 seconds. Otherwise the upload may fail because the time limit is exceeded. You should not make more than one LDAP operation in each call.




Tags:

return:  current status
array (
'status' => 'finished' | 'inProgress' // defines if all operations are complete
'progress' => 0..100 // the progress of the operations in percent
'errors' => array // list of arrays which are used to generate StatusMessages
)
access:  public


Overridden in child classes as:

posixAccount::doUploadPostActions()
This function executes one post upload action.
quota::doUploadPostActions()
This function executes one post upload action.

Parameters:

array   $data   array containing one account in each element
array   $ids   maps the column names to keys for the sub arrays (array(<column_name> => <column number>))
array   $failed   list of account numbers which could not be successfully uploaded to LDAP
array   $temp   variable to store temporary data between two post actions
   &$temp  

[ Top ]

method getAccountContainer [line 1264]

accountContainer getAccountContainer( )

Returns the accountContainer object.



Tags:

return:  accountContainer object
see:  accountContainer
access:  protected


[ Top ]

method getAttributes [line 1278]

array getAttributes( )

Returns the LDAP attributes which are managed in this module.



Tags:

return:  attributes
access:  public


[ Top ]

method getButtonStatus [line 942]

string getButtonStatus( )

Controls if the module button the account page is visible and activated.

Calling this method requires the existence of an enclosing accountContainer.

Possible return values:

  • enabled: button is visible and active
  • disabled: button is visible and deactivated (greyed)
  • hidden: no button will be shown




Tags:

return:  status ("enabled", "disabled", "hidden")
access:  public


Overridden in child classes as:

account::getButtonStatus()
Controls if the module button the account page is visible and activated.
inetOrgPerson::getButtonStatus()
Controls if the module button the account page is visible and activated.
nisMailAlias::getButtonStatus()
Controls if the module button the account page is visible and activated.
posixGroup::getButtonStatus()
Controls if the module button the account page is visible and activated.

[ Top ]

method getIcon [line 1300]

unknown getIcon( )

Returns the path to the module icon.

The path must be releative to graphics (e.g. key.png). You can also set $this->meta['icon']. The preferred size is 32x32px.




Tags:

see:  baseModule::get_metaData()
access:  public


[ Top ]

method getLDAPAliases [line 1126]

array getLDAPAliases( )

Returns a list of aliases for LDAP attributes.

Calling this method does not require the existence of an enclosing accountContainer.

All alias attributes will be renamed to the given attribute names.




Tags:

return:  list of aliases like array("alias name" => "attribute name")
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getManagedAttributes [line 1139]

array getManagedAttributes( )

Returns a list of LDAP attributes which are managed by this module.

All attribute names will be renamed to match the given spelling.




Tags:

return:  list of attributes
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getManagedObjectClasses [line 1110]

array getManagedObjectClasses( )

Returns a list of managed object classes for this module.

Calling this method does not require the existence of an enclosing accountContainer.

This is used to fix spelling errors in LDAP-Entries (e.g. if "posixACCOUNT" is read instead of "posixAccount" from LDAP).

Example: return array('posixAccount')




Tags:

return:  list of object classes
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getOriginalAttributes [line 1287]

array getOriginalAttributes( )

Returns the LDAP attributes which are managed in this module (with unchanged values).



Tags:

return:  attributes
access:  public


[ Top ]

method getRequiredExtensions [line 1153]

array getRequiredExtensions( )

This function returns a list of PHP extensions (e.g. mhash) which are needed by this module.

Calling this method does not require the existence of an enclosing accountContainer.




Tags:

return:  extensions
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getSelfServiceFields [line 1183]

array getSelfServiceFields( )

Returns a list of possible input fields and their descriptions.

Calling this method does not require the existence of an enclosing accountContainer.

Format: array(<field identifier> => <field description>)




Tags:

return:  fields
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getSelfServiceOptions [line 1202]

array getSelfServiceOptions( array $fields, array $attributes)

Returns the meta HTML code for each input field.

Calling this method does not require the existence of an enclosing accountContainer.

Format: array(<field1> => array(<META HTML>), ...)
It is not possible to display help links.




Tags:

return:  meta HTML
see:  parseHtml()
access:  public


Overridden in child classes as:

inetOrgPerson::getSelfServiceOptions()
Returns the meta HTML code for each input field.
posixAccount::getSelfServiceOptions()
Returns the meta HTML code for each input field.

Parameters:

array   $fields   list of active fields
array   $attributes   attributes of LDAP account (attribute names in lower case)

[ Top ]

method getSelfServiceSearchAttributes [line 1167]

array getSelfServiceSearchAttributes( )

This function returns a list of possible LDAP attributes (e.g. uid, cn, ...) which can be used to search for LDAP objects.

Calling this method does not require the existence of an enclosing accountContainer.




Tags:

return:  attributes
see:  baseModule::get_metaData()
access:  public


[ Top ]

method getSelfServiceSettings [line 1235]

array getSelfServiceSettings( )

Returns a list of self service configuration settings.

Calling this method does not require the existence of an enclosing accountContainer.

The type "fieldset" is not allowed here. The name attributes are used as keywords to load and save settings. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.




Tags:

return:  meta HTML code
see:  baseModule::get_metaData()
see:  parseHtml()
access:  public


[ Top ]

method get_alias [line 452]

string get_alias( )

Returns an alias name for the module.

Calling this method does not require the existence of an enclosing accountContainer.

This function returns a more descriptive string than the class name. Alias names are used for the buttons on the account pages and the module selection in the configuration wizard.
Please take care that your alias name is not too long. It may contain any character but should not include parts that may be interpreted by the browser (e.g. '<' or '>'). If you use different aliases dependent on the account type please make sure that there is a general alias for unknown types.




Tags:

return:  alias name
see:  baseModule::get_metaData()
access:  public


[ Top ]

method get_configOptions [line 647]

array get_configOptions( array $scopes, array $allScopes)

Returns a list of configuration options.

Calling this method does not require the existence of an enclosing accountContainer.

The type "fieldset" is not allowed here. The name attributes are used as keywords to load and save settings. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.




Tags:

return:  meta HTML code
see:  baseModule::get_metaData()
see:  parseHtml()
access:  public


Overridden in child classes as:

posixGroup::get_configOptions()
Returns a list of elements for the configuration.

Parameters:

array   $scopes   account types (user, group, host)
array   $allScopes   list of all active account modules and their scopes (module => array(scopes))

[ Top ]

method get_dependencies [line 495]

array get_dependencies( )

This function returns a list with all depending and conflicting modules.

Calling this method does not require the existence of an enclosing accountContainer.

The return value is an array with two sub arrays, "depends" and "conflicts". All values of the conflict array are string values with module names. All values of the depends array are either string values with module names or arrays which include only string values with module names.
If an element of the depends array is itself an array, this means that your module depends on one of these modules.

Example: return array("depends" => array("posixAccount", array("qmail", "sendmail")), "conflicts" => array("exim"))




Tags:

return:  list of dependencies and conflicts
see:  baseModule::get_metaData()
access:  public


[ Top ]

method get_help [line 884]

array get_help( string $id)

This function returns the help entry array for a specific help id.

Calling this method does not require the existence of an enclosing accountContainer.

The result is an hashtable with the following keys:

  • Headline (required)
    The headline of this help entry. Can consist of any alpha-numeric characters. No HTML/CSS elements are allowed.
  • Text (required)
    The text of the help entry which may contain any alpha-numeric characters.
  • SeeAlso (optional)
    A reference to anonther related web site. It must be an array containing a field called "text" with the link text that should be displayed and a field called "link" which is the link target.

Example:

array('Headline' => 'This is the head line', 'Text' => 'Help content', 'SeeAlso' => array('text' => 'LAM homepage', 'link' => 'http://lam.sf.net'))




Tags:

return:  The desired help entry.
see:  baseModule::get_metaData()
access:  public


Parameters:

string   $id   The id string for the help entry needed.

[ Top ]

method get_ldap_filter [line 434]

string get_ldap_filter( )

Returns an LDAP filter for the account lists

Calling this method does not require the existence of an enclosing accountContainer.

Returns an array('or' => '...', 'and' => '...') that is used to build the LDAP filter. Usually, this is used to filter object classes. All "or" filter parts of the base modules are combined with OR and then combined with the "and" parts.
The resulting LDAP filter will look like this: (&(|(OR1)(OR2)(OR3))(AND1)(AND2)(AND3))

Example: return array('or' => '(objectClass=posixAccount)', 'and' => '(!(uid=*$))')




Tags:

return:  LDAP filter
see:  baseModule::get_metaData()
access:  public


[ Top ]

method get_metaData [line 375]

array get_metaData( )

This function provides meta data which is interpreted by baseModule.

Only subclasses will return real data.

The aim of the meta data is to reduce the number of functions in the subclasses. All major data is centralized in one place.

The returned array contains a list of key-value pairs for the different functions.

  • can_manage()

    Key: account_types
    Value: array of account types

    Example: "account_types" => array("user", "host")

  • is_base_module()

    Key: is_base
    Value: boolean

    Example: "is_base" => true

  • get_ldap_filter()

    Key: ldap_filter
    Value: array of filters

    Example: "ldap_filter" => array('or' => 'objectClass=posixAccount', 'and' => '(!(uid=*$))')

  • getManagedObjectClasses()

    Key: objectClasses
    Value: array of object classes

    Example: "objectClasses" => array('posixAccount')

  • getLDAPAliases()

    Key: LDAPaliases
    Value: array of aliases

    Example: "LDAPaliases" => array('commonName' => 'cn')

  • get_RDNAttributes()

    Key: RDN
    Value: array of RDNs

    Example: "RDN" => array('uid' => 'normal', 'cn' => 'low')

  • get_dependencies()

    Key: dependencies
    Value: array of dependencies

    Example: "dependencies" => array("depends" => array("posixAccount", array("qmail", "sendmail")), "conflicts" => array("exim"))

  • get_profileOptions()

    Key: profile_options
    Value: array of profile options

    The syntax for the value array is the same as for the return value of get_profileOptions().

  • check_profileOptions()

    Key: profile_checks
    Value: array of checks (array("optionName" => array()))

    The "optionName" keys of the value array are the names of the option identifiers.
    Each array element is an array itself containing these values:
    • type: determines how to check input
      Possible values:
      • regex: check with regular expression from regex variable, case sensitive
      • regex_i: check with regular expression from regex variable, case insensitive
      • int_greater: integer value of cmp_name1 must be greater than the integer value from the option cmp_name2
      • int_greaterOrEqual: integer value of cmp_name1 must be greater or equal than the integer value from the option cmp_name2
    • error_message: message that is displayed if input value was syntactically incorrect
      error_message is an array to build StatusMessages (message type, message head, message text, additional variables)
    • regex: regular expression string (only if type is regex/regex_i)
    • cmp_name1: name of first input variable that is used for comparison (only if type is int_greater/int_greaterOrEqual)
    • cmp_name2: name of second input variable that is used for comparison (only if type is int_greater/int_greaterOrEqual)
    • required: true or false, if this input field must be filled set to true (optional)
    • required_message: message that is displayed if no input value was given (only if required == true)
      required_message is an array to build StatusMessages (message type, message head, message text, additional variables)


  • load_profile()

    Key: profile_mappings
    Value: array('profile_identifier1' => 'LDAP_attribute1', 'profile_identifier2' => 'LDAP_attribute2')

    The mapped values are stored directly in $this->attributes.
    Example: "profile_mappings" => array('inetOrgPerson_title' => 'title')

  • get_configOptions()

    Key: config_options
    Value: array('user' => array, 'host' => array, 'all' => array)

    The values from 'all' are always returned, the other values only if they are inside the $scopes array.
    The syntax for sub arrays is the same as for the return value of get_configOptions().

  • check_configOptions()

    Key: config_checks
    Value: array('user' => array, 'host' => 'array', 'all' => array)

    The values from 'all' are always used for checking, the other values only if they are inside the $scopes array. The syntax for sub arrays is the same as for check_configOptions().

  • get_uploadColumns()

    Key: upload_columns
    Value: array

    The syntax for array is the same as for the return value of get_uploadColumns().

  • get_uploadPreDepends()

    Key: upload_preDepends
    Value: array

    The syntax for array is the same as for the return value of get_uploadPreDepends().

  • getRequiredExtensions()

    Key: extensions
    Value: array of extension names

    Example: "extensions" => array('mhash')

  • get_help()

    Key: help
    Value: hashtable of help entries

    The hashtable is an array which maps help IDs to help entries.

    Example: 'help' => array('myEntry' => array('Headline' => 'This is the head line', 'Text' => 'Help content'))

  • getSelfServiceSearchAttributes()

    Key: selfServiceSearchAttributes
    Value: array of attribute names

    Example: "selfServiceSearchAttributes" => array('uid')

  • getSelfServiceFields()

    Key: selfServiceFieldSettings
    Value: array of self service fields

    Example: "selfServiceFieldSettings" => array('pwd' => 'Password')

Example: return array("is_base" => true);




Tags:

return:  meta data
access:  public


Overridden in child classes as:

account::get_metaData()
Returns meta data that is interpreted by parent class
ieee802Device::get_metaData()
Returns meta data that is interpreted by parent class
inetLocalMailRecipient::get_metaData()
Returns meta data that is interpreted by parent class
inetOrgPerson::get_metaData()
Returns meta data that is interpreted by parent class
kolabUser::get_metaData()
Returns meta data that is interpreted by parent class
ldapPublicKey::get_metaData()
Returns meta data that is interpreted by parent class
nisMailAlias::get_metaData()
Returns meta data that is interpreted by parent class
posixAccount::get_metaData()
Returns meta data that is interpreted by parent class
posixGroup::get_metaData()
Returns meta data that is interpreted by parent class
quota::get_metaData()
Returns meta data that is interpreted by parent class
sambaAccount::get_metaData()
Returns meta data that is interpreted by parent class
sambaDomain::get_metaData()
Returns meta data that is interpreted by parent class
sambaGroupMapping::get_metaData()
Returns meta data that is interpreted by parent class
sambaSamAccount::get_metaData()
Returns meta data that is interpreted by parent class
shadowAccount::get_metaData()
Returns meta data that is interpreted by parent class

[ Top ]

method get_pdfFields [line 794]

array get_pdfFields( string $scope)

Returns a hashtable with all entries that may be printed out in the PDF.

Calling this method does not require the existence of an enclosing accountContainer.

This method must be overwritten in case that there are non static values to be returned. The $this->meta['PDF_fields'] array may be used for static content.

Format of returned hashtable:

This function uses XML formatted commands to define the PDF output. Each part in the PDF document is surrounded by "<block>" and "</block>".
Inside the <block> tags there are different ways to format the output:

  • simple line with attribute name and value: <block><key>attribute name</key><value>attribute value</value></block>
  • table: <block><key>attribute name</key><tr><td>value<td><td>value<td></tr></block><block><tr><td>value</td><td>value<td></tr></block>
Special commands:
  • Alignment in <td>: You can specify the alignment in <td> tags with align=(L|R|C) (e.g. <td align=\"L\">)
  • Cell width: <td> allows an attribute "width" to set the cell width (e.g. <td width=20%> or <td width=30>).
  • Line breaks: Line breaks can be specified by adding a <br> tag. The new line will start at the left border of the PDF document.

Examples:

Simple name+value lines:

In most cases you will just want to display a single line per attribute with its name and value.

'myAttribute' => '<block><key>AttrName</key><value>12345</value></block>'

This will give the following PDF output:

Attribute name: 12345


Multiline values:

Sometimes you have multivalued attributes where it is not applicable to write all values in one line but where you want to list your values one below the other or show a table. This can be done by using the <td> tag.

This example only uses one column but you can just use more <td> tags per <block> tag to display more columns.

'myAttribute' => '<block><key>AttrName</key><tr><td align=\"L\">123</td></tr></block><block><tr><td align=\"L\">456</td></tr></block><block><tr><td align=\"L\">789</td></tr></block>'




Tags:

return:  PDF entries
see:  baseModule::get_metaData()
access:  public


Parameters:

string   $scope   account type

[ Top ]

method get_profileOptions [line 515]

array get_profileOptions( )

This function defines what attributes will be used in the account profiles and their appearance in the profile editor.

Calling this method does not require the existence of an enclosing accountContainer.

The return value is an array that contains meta HTML code.
The type "fieldset" is not allowed here. The name attributes are used as keywords to load and save profiles. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.




Tags:

return:  meta HTML code
see:  baseModule::get_metaData()
see:  parseHtml()
access:  public


Overridden in child classes as:

posixAccount::get_profileOptions()
Returns a list of elements for the account profiles.
quota::get_profileOptions()
Returns a list of elements for the account profiles.
sambaGroupMapping::get_profileOptions()
Returns a list of elements for the account profiles.
sambaSamAccount::get_profileOptions()
Returns a list of elements for the account profiles.

[ Top ]

method get_RDNAttributes [line 472]

array get_RDNAttributes( )

Returns a hash array containing a list of possible LDAP attributes that can be used to form the RDN (Relative Distinguished Name).

Calling this method does not require the existence of an enclosing accountContainer.

The returned elements have this form: <attribute> => <priority>
<attribute> is the name of the LDAP attribute
<priority> defines the priority of the attribute (can be "low", "normal", "high")

Example: return array('uid' => 'normal', 'cn' => 'low')




Tags:

return:  list of attributes
see:  baseModule::get_metaData()
access:  public


[ Top ]

method get_scope [line 384]

string get_scope( )

Returns the account type of this module (user, group, host)



Tags:

return:  account type
access:  public


[ Top ]

method get_uploadColumns [line 821]

array get_uploadColumns( )

Returns an array containing all input columns for the file upload.

Calling this method does not require the existence of an enclosing accountContainer.

This funtion returns an array which contains subarrays which represent an upload column. Syntax of column arrays:

array(
string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>)
string: description, // short descriptive name
string: help, // help ID
string: example, // example value
string: values, // possible input values (optional)
string: default, // default value (optional)
boolean: required // true, if user must set a value for this column
boolean: unique // true if all values of this column must be different values (optional, default: "false")
)




Tags:

return:  column list
see:  baseModule::get_metaData()
access:  public


Overridden in child classes as:

quota::get_uploadColumns()
Returns an array containing all input columns for the file upload.

[ Top ]

method get_uploadPreDepends [line 837]

array get_uploadPreDepends( )

Returns a list of module names which must be processed in building the account befor this module.

Calling this method does not require the existence of an enclosing accountContainer.

The named modules may not be active, LAM will check this automatically.




Tags:

return:  list of module names
see:  baseModule::get_metaData()
access:  public


[ Top ]

method init [line 112]

void init( string $base)

Initializes the module after it became part of an accountContainer

Calling this method requires the existence of an enclosing accountContainer.




Tags:

access:  public


Overridden in child classes as:

posixAccount::init()
Initializes the module after it became part of an accountContainer
posixGroup::init()
This functin will be called when the module will be loaded *
sambaAccount::init()
Initializes the module after it became part of an accountContainer
sambaGroupMapping::init()
Initializes the module after it became part of an accountContainer
sambaSamAccount::init()
Initializes the module after it became part of an accountContainer

Parameters:

string   $base   the name of the accountContainer object ($_SESSION[$base])

[ Top ]

method is_base_module [line 414]

boolean is_base_module( )

Returns true if your module is a base module and otherwise false.

Calling this method does not require the existence of an enclosing accountContainer.

Every account type needs exactly one base module. A base module manages a structural object class. E.g. the inetOrgPerson module is a base module since its object class is structural.




Tags:

return:  true if base module (defaults to false if no meta data is provided)
see:  baseModule::get_metaData()
access:  public


[ Top ]

method load_attributes [line 140]

void load_attributes( array $attributes)

This function loads the LDAP attributes when an account should be loaded.

Calling this method requires the existence of an enclosing accountContainer.

By default this method loads the object classes and accounts which are specified in getManagedObjectClasses() and getManagedAttributes().




Tags:

access:  public


Overridden in child classes as:

posixAccount::load_attributes()
This function loads all needed LDAP attributes.
sambaAccount::load_attributes()
This function loads the LDAP attributes for this module.
sambaSamAccount::load_attributes()
This function loads the LDAP attributes for this module.

Parameters:

array   $attributes   array like the array returned by get_ldap_attributes(dn of account) but without count indices

[ Top ]

method load_Messages [line 102]

void load_Messages( )

This function fills the $messages variable with output messages from this module.

Calling this method requires the existence of an enclosing accountContainer.




Tags:

access:  protected


Overridden in child classes as:

account::load_Messages()
This function fills the message array.
ieee802Device::load_Messages()
This function fills the error message array with messages
inetLocalMailRecipient::load_Messages()
This function fills the error message array with messages
inetOrgPerson::load_Messages()
This function fills the message array.
kolabUser::load_Messages()
This function fills the error message array with messages
nisMailAlias::load_Messages()
This function fills the error message array with messages
posixAccount::load_Messages()
This function fills the error message array with messages.
posixGroup::load_Messages()
This function fills the $messages variable with output messages from this module.
quota::load_Messages()
this functin fills the error message array with messages
sambaAccount::load_Messages()
this functin fills the error message array with messages
sambaDomain::load_Messages()
This function fills the error message array with messages
sambaGroupMapping::load_Messages()
this functin fills the error message array with messages
sambaSamAccount::load_Messages()
this functin fills the error message array with messages
shadowAccount::load_Messages()
This function builds up the message array.

[ Top ]

method load_profile [line 621]

void load_profile( array $profile)

This function loads the values from an account profile to the module's internal data structures.

Calling this method does not require the existence of an enclosing accountContainer.




Tags:

see:  baseModule::get_metaData()
access:  public


Overridden in child classes as:

posixAccount::load_profile()
Loads the values of an account profile into internal variables.
quota::load_profile()
Loads the values of an account profile into internal variables.
sambaAccount::load_profile()
Loads the values of an account profile into internal variables.
sambaGroupMapping::load_profile()
Loads the values of an account profile into internal variables.
sambaSamAccount::load_profile()
Loads the values of an account profile into internal variables.
shadowAccount::load_profile()
Loads the values of an account profile into internal variables.

Parameters:

array   $profile   hash array with profile values (identifier => value)

[ Top ]

method module_complete [line 924]

boolean module_complete( )

This functions is used to check if all settings for this module have been made.

Calling this method requires the existence of an enclosing accountContainer.

This function tells LAM if it can create/modify the LDAP account. If your module needs any additional input then set this to false. The user will be notified that your module needs more input.
This method's return value defaults to true.




Tags:

return:  true, if settings are complete
access:  public


Overridden in child classes as:

account::module_complete()
This functions returns true if all needed settings are done.
inetOrgPerson::module_complete()
This functions return true if all needed settings are done.
kolabUser::module_complete()
This function returns true if all needed settings are done.
posixAccount::module_complete()
This functions is used to check if all settings for this module have been made.
posixGroup::module_complete()
This functions is used to check if all settings for this module have been made.
sambaAccount::module_complete()
This functions returns true if all needed settings are done

[ Top ]

method module_ready [line 908]

boolean module_ready( )

This function is used to check if this module page can be displayed.

Calling this method requires the existence of an enclosing accountContainer.

Your module might depend on input of other modules. This function determines if the user can change to your module page or not. The return value is true if your module accepts input, otherwise false.
This method's return value defaults to true.




Tags:

return:  true, if page can be displayed
access:  public


Overridden in child classes as:

quota::module_ready()
This function is used to check if this module page can be displayed.
sambaAccount::module_ready()
This function is used to check if this module page can be displayed.
sambaGroupMapping::module_ready()
This function is used to check if this module page can be displayed.
sambaSamAccount::module_ready()
This function is used to check if this module page can be displayed.

[ Top ]

method postDeleteActions [line 1041]

void postDeleteActions( )

Allows the module to run commands after the LDAP entry is deleted.

Calling this method requires the existence of an enclosing accountContainer.




Tags:

access:  public


[ Top ]

method postModifyActions [line 1019]

void postModifyActions( boolean $newAccount)

Allows the module to run commands after the LDAP entry is changed or created.

Calling this method requires the existence of an enclosing accountContainer.




Tags:

access:  public


Overridden in child classes as:

posixAccount::postModifyActions()
Allows the module to run commands after the LDAP entry was changed or created.
quota::postModifyActions()
Allows the module to run commands after the LDAP entry is changed or created.

Parameters:

boolean   $newAccount   new account

[ Top ]

method preDeleteActions [line 1032]

true, preDeleteActions( )

Allows the module to run commands before the LDAP entry is deleted.

Calling this method requires the existence of an enclosing accountContainer.

An error message should be printed if the function returns false.




Tags:

return:  if no problems occured
access:  public


Overridden in child classes as:

posixAccount::preDeleteActions()
Allows the module to run commands before the LDAP entry is deleted.
quota::preDeleteActions()
Allows the module to run commands before the LDAP entry is deleted.

[ Top ]

method preModifyActions [line 1008]

true, preModifyActions( boolean $newAccount)

Allows the module to run commands before the LDAP entry is changed or created.

Calling this method requires the existence of an enclosing accountContainer.

An error message should be printed if the function returns false.




Tags:

return:  if no problems occured
access:  public


Parameters:

boolean   $newAccount   new account

[ Top ]

method process_attributes [line 1084]

array process_attributes( )

This function processes user input.

Calling this method requires the existence of an enclosing accountContainer.

It checks the user input and saves changes in the module's data structures.

Example: return array(array('ERROR', 'Invalid input!', 'This is not allowed here.'));




Tags:

return:  Array which contains status messages. Each entry is an array containing the status message parameters.
abstract:  
access:  public


Overridden in child classes as:

account::process_attributes()
Processes user input of the primary module page.
ieee802Device::process_attributes()
Processes user input of the primary module page.
inetLocalMailRecipient::process_attributes()
Processes user input of the primary module page.
inetOrgPerson::process_attributes()
Processes user input of the primary module page.
kolabUser::process_attributes()
Processes user input of the primary module page.
ldapPublicKey::process_attributes()
Processes user input of the primary module page.
nisMailAlias::process_attributes()
Processes user input of the primary module page.
posixAccount::process_attributes()
Processes user input of the primary module page.
posixGroup::process_attributes()
Processes user input of the primary module page.
quota::process_attributes()
Processes user input of the primary module page.
sambaAccount::process_attributes()
Processes user input of the primary module page.
sambaDomain::process_attributes()
Processes user input of the primary module page.
sambaGroupMapping::process_attributes()
Processes user input of the primary module page.
sambaSamAccount::process_attributes()
Processes user input of the primary module page.
shadowAccount::process_attributes()
Processes user input of the primary module page.

[ Top ]

method save_attributes [line 994]

array save_attributes( )

Returns a list of modifications which have to be made to the LDAP account.

Calling this method requires the existence of an enclosing accountContainer.


This function returns an array with 3 entries:
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... )
DN is the DN to change. It is possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid)

"add" are attributes which have to be added to the LDAP entry
"remove" are attributes which have to be removed from the LDAP entry
"modify" are attributes which have to be modified in the LDAP entry
"notchanged" are attributes which stay unchanged

This builds the required comands from $this-attributes and $this->orig.




Tags:

return:  list of modifications
access:  public


Overridden in child classes as:

account::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
inetOrgPerson::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
kolabUser::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
nisMailAlias::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
posixAccount::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
posixGroup::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
sambaAccount::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
sambaGroupMapping::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
sambaSamAccount::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.
shadowAccount::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.

[ Top ]


Documentation generated on Thu, 07 Feb 2008 20:26:18 +0100 by phpDocumentor 1.4.0