lib/modules/fixed_ip.inc

Properties

Description

Manages DHCP host entries.

Classes

fixed_ip

Properties

 
 
modules  
No 
No 

Description

Manages DHCP host entries.
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 ".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 {@link get_metaData()}.

All module classes should extend the baseModule class.

Methods

check_mac, display_html_attributes, extractIP, getButtonStatus, get_metaData, get_pdfEntries, isActive, load_Messages, load_attributes, overlapd_ip, postModifyActions, process_attributes, reload_ips, reset_overlapd_ip, save_attributes, setActive, setIP,

check_mac(   $mac, ) : \true,

Description

Check, if a mac address is invalid

Arguments

Name Type Description Default
$mac n/a

Return value

Type Description
\true, if mac is invalid

display_html_attributes( ) : \htmlElement

Description

Returns the HTML meta data for the main account page.

Return value

Type Description
\htmlElement HTML meta data

extractIP( array   $dhcpStatements, ) : n/a

Description

Extracts the IP from a list of DHCP statements.

Arguments

Name Type Description Default
$dhcpStatements array

values of dhcpStatements attribute

Return value

Type Description
n/a n/a

getButtonStatus( ) : string

Description

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

Return value

Type Description
string status ("enabled", "disabled", "hidden")

get_metaData( ) : array

Description

Returns meta data that is interpreted by parent class

Return value

Type Description
array array with meta data

Tags

Name Description
see

get_pdfEntries( ) : array

Description

Returns the PDF entries for this module.

Return value

Type Description
array list of possible PDF entries

isActive( array   $dhcpStatements, ) : n/a

Description

Returns if this host is active.

Arguments

Name Type Description Default
$dhcpStatements array

values of dhcpStatements attribute

Return value

Type Description
n/a n/a

load_Messages( ) : n/a

Description

This function fills the error message array with messages.

Return value

Type Description
n/a n/a

load_attributes( array   $attr, ) : n/a

Description

This function loads all needed LDAP attributes.

Arguments

Name Type Description Default
$attr array

list of attributes

Return value

Type Description
n/a n/a

overlapd_ip(   $ip, ) : \false,

Description

Checked, if ips are overlapd.

Arguments

Name Type Description Default
$ip n/a

Return value

Type Description
\false, if overlapd, else true.

postModifyActions( boolean   $newAccount, array   $attributes, ) : array

Description

This function is overwritten because the fixed IPs are set after the ldap_add command.

Arguments

Name Type Description Default
$newAccount boolean
$attributes array

LDAP attributes of this entry

Return value

Type Description
array array which contains status messages. Each entry is an array containing the status message parameters.

Tags

Name Description
see

process_attributes( ) : array

Description

Processes user input of the primary module page.
It checks if all input values are correct and updates the associated LDAP attributes.

Return value

Type Description
array list of info/error messages

reload_ips( ) : \true,

Description

Adapt the fixed ip with the subnet.

Return value

Type Description
\true, if ip were edit.

reset_overlapd_ip( ) : n/a

Description

Reset the overlapd_range() function

Return value

Type Description
n/a n/a

save_attributes( ) : array

Description

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

Return value

Type Description
array list of modifications <br>This function returns an array with 3 entries: <br>array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) <br>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) <br>"add" are attributes which have to be added to LDAP entry <br>"remove" are attributes which have to be removed from LDAP entry <br>"modify" are attributes which have to been modified in LDAP entry <br>"info" are values with informational value (e.g. to be used later by pre/postModify actions)

setActive( array   $dhcpStatements, boolean   $active, ) : n/a

Description

Sets if this host is active.

Arguments

Name Type Description Default
$dhcpStatements array

values of dhcpStatements attribute

$active boolean

is active

Return value

Type Description
n/a n/a

setIP( array   $dhcpStatements, String   $ip, ) : n/a

Description

Sets the IP in a list of DHCP statements.

Arguments

Name Type Description Default
$dhcpStatements array

values of dhcpStatements attribute

$ip String

new IP

Return value

Type Description
n/a n/a

Properties

$attributes, $fixed_ip, $orig_ips, $overlapd, $processed,

  public  $attributes =

LDAP attributes


  public  $fixed_ip =

fixed ips


  public  $orig_ips = array()

original IPs


  public  $overlapd =

for check if IPs overlap


  public  $processed = false

already processed?


Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages