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):

Variables

Methods


Child classes:

account
Manages the object class "account" for users and hosts.
ieee802Device
Provides MAC addresses for 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.
sambaSamAccount
Manages the object class "sambaSamAccount" for users and hosts.
posixAccount
Manages the object class "posixAccount" for users and hosts.
kolabUser
Manages Kolab user accounts.
sambaGroupMapping
Manages the object class "sambaGroupMapping" for groups.
shadowAccount
Manages the object class "shadowAccount" for users.
ldapPublicKey
Manages SSH public keys.
sambaDomain
Manages Samba 3 domain entries.
inetOrgPerson
This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
inetLocalMailRecipient
Provides mail routing for users.
groupOfNames
Manages group members for the object class groupOfNames.
nisMailAlias
Provides NIS mail alias management.

Class Details

[line 40]
Parent class of all account modules.



Tags:

abstract:  


[ Top ]


Class Variables

$attributes =

[line 58]

contains all ldap attributes which should be written



Tags:

access:  protected

Type:   mixed


[ Top ]

$autoAddObjectClasses =

[line 67]

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



Tags:

access:  protected

Type:   mixed


[ Top ]

$messages =

[line 64]

contains all error messages of a module



Tags:

access:  protected

Type:   mixed


[ Top ]

$meta =

[line 43]

includes all meta data provided by the sub class



Tags:

access:  protected

Type:   mixed


[ Top ]

$moduleSettings =

[line 49]

configuration settings of all modules



Tags:

access:  protected

Type:   mixed


[ Top ]

$orig =

[line 61]

contains all ldap attributes which are loaded from ldap



Tags:

access:  protected

Type:   mixed


[ Top ]

$selfServiceSettings =

[line 52]

self service settings of all modules



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 74]

baseModule __construct( string $scope)

Creates a new base module class



Tags:

access:  public


Overridden in child classes as:

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

Parameters:

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

[ Top ]

method build_uploadAccounts [line 507]

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

In this function the LDAP account is built up.



Tags:

return:  list of error messages if any


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.
posixGroup::build_uploadAccounts()
In this function the LDAP account is built up.
sambaAccount::build_uploadAccounts()
In this function the LDAP account is built up.
sambaSamAccount::build_uploadAccounts()
In this function the LDAP account is built up.
posixAccount::build_uploadAccounts()
In this function the LDAP account is built up.
kolabUser::build_uploadAccounts()
In this function the LDAP account is built up.
sambaGroupMapping::build_uploadAccounts()
In this function the LDAP account is built up.
shadowAccount::build_uploadAccounts()
In this function the LDAP account is built up.
ldapPublicKey::build_uploadAccounts()
In this function the LDAP account is built up.
sambaDomain::build_uploadAccounts()
In this function the LDAP account is built up.
inetOrgPerson::build_uploadAccounts()
In this function the LDAP account is built up.
inetLocalMailRecipient::build_uploadAccounts()
In this function the LDAP account is built up.
groupOfNames::build_uploadAccounts()
In this function the LDAP account is built up.
nisMailAlias::build_uploadAccounts()
In this function the LDAP account is built up.

Parameters:

array   $rawAccounts   list of hash arrays (name => value) from user input
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 172]

boolean can_manage( )

Returns true if this module fits for the current scope.



Tags:

return:  true if module fits


[ Top ]

method checkSelfServiceOptions [line 738]

array checkSelfServiceOptions( string $fields, array $attributes)

Checks if all input values are correct and returns the LDAP commands which should be executed.



Tags:

return:  messages and LDAP commands (array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array()))


Overridden in child classes as:

sambaSamAccount::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.
inetOrgPerson::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 759]

array checkSelfServiceSettings( array $options)

Checks if the self service settings are valid.



Tags:

return:  error messages


Parameters:

array   $options   settings

[ Top ]

method check_configOptions [line 367]

array check_configOptions( array $scopes, array $options)

Checks input values of module settings.



Tags:

return:  list of error messages


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 containing the settings (array('option' => array('value')))

[ Top ]

method check_profileOptions [line 252]

array check_profileOptions( array $options)

Checks input values of account profiles.



Tags:

return:  list of error messages (array(type, title, text)) to generate StatusMessages, if any


Overridden in child classes as:

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

Parameters:

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

[ Top ]

method delete_attributes [line 640]

List delete_attributes( )

Dummy function for modules which use no special options on account deletion.



Tags:

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


Overridden in child classes as:

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

[ Top ]

method display_html_delete [line 649]

meta display_html_delete( )

Dummy function for modules which do not print extra HTML code on account deletion.



Tags:

return:  HTML code


Overridden in child classes as:

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

[ Top ]

method doUploadPostActions [line 575]

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

This function executes one post upload action.



Tags:

return:  current status
array (
'status' => 'finished' | 'inProgress'
'progress' => 0..100
'errors' => array (<array of parameters for StatusMessage>)
)


Overridden in child classes as:

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

Parameters:

array   $data   array containing one account in each element
array   $ids   array(<column_name> => <column number>)
array   $failed   list of accounts which were not created successfully
array   $temp   variable to store temporary data between two post actions
   &$temp  

[ Top ]

method getAccountContainer [line 770]

accountContainer getAccountContainer( )

Returns the accountContainer object.



Tags:

return:  accountContainer object
access:  protected


[ Top ]

method getAttributes [line 784]

array getAttributes( )

Returns the LDAP attributes which are managed in this module.



Tags:

return:  attributes
access:  public


[ Top ]

method getButtonStatus [line 557]

string getButtonStatus( )

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



Tags:

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


Overridden in child classes as:

account::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.
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.

[ Top ]

method getIcon [line 804]

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:

access:  public


[ Top ]

method getLDAPAliases [line 670]

array getLDAPAliases( )

Returns a list of aliases for LDAP attributes.

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




Tags:

return:  list of aliases (alias name => attribute name)


[ Top ]

method getManagedAttributes [line 681]

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


[ Top ]

method getManagedObjectClasses [line 659]

array getManagedObjectClasses( )

Returns a list of managed object classes for this module.

This is used to fix incorrect spelled object class names.




Tags:

return:  list of object classes


[ Top ]

method getOriginalAttributes [line 793]

array getOriginalAttributes( )

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



Tags:

return:  attributes
access:  public


[ Top ]

method getRequiredExtensions [line 691]

array getRequiredExtensions( )

Returns a list of required PHP extensions.



Tags:

return:  extensions


[ Top ]

method getSelfServiceFields [line 712]

array getSelfServiceFields( )

Returns a list of possible input fields and their descriptions Format: array(<field identifier> => <field description>)



Tags:

return:  fields


[ Top ]

method getSelfServiceOptions [line 726]

array getSelfServiceOptions( array $fields, array $attributes)

Returns the meta HTML code for each input field.

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




Tags:

return:  meta HTML


Overridden in child classes as:

posixAccount::getSelfServiceOptions()
Returns the meta HTML code for each input field.
inetOrgPerson::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 701]

array getSelfServiceSearchAttributes( )

Returns a list of possible search attributes for the self service.



Tags:

return:  attributes


[ Top ]

method getSelfServiceSettings [line 748]

array getSelfServiceSettings( )

Returns a list of self service configuration settings.



Tags:

return:  settings


[ Top ]

method get_alias [line 207]

string get_alias( )

Returns an alias name for the module.

This alias is used in various places instead of the less descriptive class name. The alias also has less syntax restrictions and may contain spaces or special characters.




Tags:

return:  alias name


[ Top ]

method get_configOptions [line 351]

array get_configOptions( array $scopes, array $allScopes)

Returns a list of elements for the configuration.



Tags:

return:  configuration elements


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 modules and active scopes

[ Top ]

method get_dependencies [line 231]

array get_dependencies( )

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



Tags:

return:  list of dependencies and conflicts


[ Top ]

method get_help [line 521]

array get_help( string $id, string $scope)

This function return the help entry array for a specific help id. Normally this->meta can be used.



Tags:

return:  The desired help entry.


Parameters:

string   $id   The id string for the help entry needed.
string   $scope   The scope for which the help entry should be retrieved. May be empty when there is now difference of the help entry depending on the actual scope.

[ Top ]

method get_ldap_filter [line 194]

string get_ldap_filter( )

returns an LDAP filter for the account lists



Tags:

return:  LDAP filter


[ Top ]

method get_metaData [line 154]

array get_metaData( )

Dummy function, meta data is provided by sub classes.



Tags:

return:  empty array


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
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
sambaSamAccount::get_metaData()
Returns meta data that is interpreted by parent class
posixAccount::get_metaData()
Returns meta data that is interpreted by parent class
kolabUser::get_metaData()
Returns meta data that is interpreted by parent class
sambaGroupMapping::get_metaData()
Returns meta data that is interpreted by parent class
shadowAccount::get_metaData()
Returns meta data that is interpreted by parent class
ldapPublicKey::get_metaData()
Returns meta data that is interpreted by parent class
sambaDomain::get_metaData()
Returns meta data that is interpreted by parent class
inetOrgPerson::get_metaData()
Returns meta data that is interpreted by parent class
inetLocalMailRecipient::get_metaData()
Returns meta data that is interpreted by parent class
groupOfNames::get_metaData()
Returns meta data that is interpreted by parent class
groupOfUniqueNames::get_metaData()
Returns meta data that is interpreted by parent class
nisMailAlias::get_metaData()
Returns meta data that is interpreted by parent class

[ Top ]

method get_pdfFields [line 451]

array get_pdfFields( string $scope)

Returns an array with all fields available for this account type on the PDF output. This method may be overwritten by subclasses or it may be used by using entries in the $this->meta['PDF_fields'] array of the specific sub- class.



Tags:

return:  list of available fields for PDF output


Parameters:

string   $scope   account type

[ Top ]

method get_pdf_entries [line 466]

array get_pdf_entries( [string $scope = 'user'])

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

syntax of the hashtable is specified by the module specification and the corresponding DTD. This method must be overwritten in case that there are non static things to be returned. The $this->meta['PDF_entries'] array may be used when there is only static content.




Tags:

return:  hastable of entries for the PDF. Each entry is an array where each entry is treated as a new line in the PDF.


Parameters:

string   $scope   account type

[ Top ]

method get_profileOptions [line 241]

profile get_profileOptions( )

Returns a list of elements for the account profiles.



Tags:

return:  elements


Overridden in child classes as:

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

[ Top ]

method get_RDNAttributes [line 221]

array get_RDNAttributes( )

Returns a list of possible LDAP attributes which can be used to form the RDN.

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")




Tags:

return:  list of attributes


[ Top ]

method get_scope [line 163]

string get_scope( )

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



Tags:

return:  account type


[ Top ]

method get_uploadColumns [line 484]

array get_uploadColumns( )

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

Syntax:
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
boolean: required // true, if user must set a value for this column
)




Tags:

return:  column list


Overridden in child classes as:

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

[ Top ]

method get_uploadPreDepends [line 494]

array get_uploadPreDepends( )

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



Tags:

return:  list of module names


[ Top ]

method init [line 95]

void init( string $base)

Initializes the module after it became part of an accountContainer



Overridden in child classes as:

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
sambaSamAccount::init()
Initializes the module after it became part of an accountContainer
posixAccount::init()
Initializes the module after it became part of an accountContainer
sambaGroupMapping::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 184]

boolean is_base_module( )

Returns true if this module is enough to provide a sensible account.

There is no relation to the name of this class.




Tags:

return:  true if base module


[ Top ]

method load_attributes [line 118]

void load_attributes( array $attributes)

This function loads the LDAP attributes for this module.



Overridden in child classes as:

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

Parameters:

array   $attributes   attribute list

[ Top ]

method load_Messages [line 87]

void load_Messages( )

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



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
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
sambaSamAccount::load_Messages()
this functin fills the error message array with messages
posixAccount::load_Messages()
This function fills the error message array with messages.
kolabUser::load_Messages()
This function fills the error message array with messages
sambaGroupMapping::load_Messages()
this functin fills the error message array with messages
shadowAccount::load_Messages()
This function builds up the message array.
sambaDomain::load_Messages()
This function fills the error message array with messages
inetOrgPerson::load_Messages()
This function fills the message array.
inetLocalMailRecipient::load_Messages()
This function fills the error message array with messages
groupOfNames::load_Messages()
This function fills the $messages variable with output messages from this module.
nisMailAlias::load_Messages()
This function fills the error message array with messages

[ Top ]

method load_profile [line 333]

void load_profile( array $profile)

Loads the values of an account profile into internal variables.



Overridden in child classes as:

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.
sambaSamAccount::load_profile()
Loads the values of an account profile into internal variables.
posixAccount::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.
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 548]

boolean module_complete( )

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



Tags:

return:  true, if settings are complete


Overridden in child classes as:

account::module_complete()
This functions returns true if all needed settings are done.
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
posixAccount::module_complete()
This functions is used to check if all settings for this module have been made.
kolabUser::module_complete()
This function returns true if all needed settings are done.
inetOrgPerson::module_complete()
This functions return true if all needed settings are done.
groupOfNames::module_complete()
This functions is used to check if all settings for this module have been made.

[ Top ]

method module_ready [line 539]

boolean module_ready( )

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

It returns false if a module depends on data from other modules which was not yet entered.




Tags:

return:  true, if page can be displayed


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.
sambaSamAccount::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.

[ Top ]

method postDeleteActions [line 631]

void postDeleteActions( )

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



[ Top ]

method postModifyActions [line 614]

void postModifyActions( boolean $newAccount)

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



Overridden in child classes as:

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

Parameters:

boolean   $newAccount   new account

[ Top ]

method preDeleteActions [line 624]

true, preDeleteActions( )

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

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




Tags:

return:  if no problems occured


Overridden in child classes as:

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

[ Top ]

method preModifyActions [line 605]

true, preModifyActions( boolean $newAccount)

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

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




Tags:

return:  if no problems occured


Parameters:

boolean   $newAccount   new account

[ Top ]

method save_attributes [line 594]

array save_attributes( )

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



Tags:

return:  list of modifications
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 may be 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 LDAP entry
"remove" are attributes which have to be removed from LDAP entry
"modify" are attributes which have to been modified in LDAP entry


Overridden in child classes as:

account::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.
sambaSamAccount::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.
kolabUser::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.
shadowAccount::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.
nisMailAlias::save_attributes()
Returns a list of modifications which have to be made to the LDAP account.

[ Top ]


Documentation generated on Sun, 06 Jan 2008 18:58:52 +0100 by phpDocumentor 1.4.0