lib/modules/dhcp_settings.inc

Properties

Description

Manages DHCP entries.

Functions

check_ip( String   $ip, boolean   $subnet = false, ) : n/a

Description

Checks if the given IP is valid.

Arguments

Name Type Description Default
$ip String

IP address

$subnet boolean

IP must be a subnet

false

Return value

Type Description
n/a n/a

Classes

dhcp_settings

Properties

 
 
modules  
No 
No 

Description

Manages DHCP 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

__construct, build_uploadAccounts, calculateNetMask, checkSubnetMask, display_html_attributes, getDHCPOption, getDefaultLeaseTime, getMaxLeaseTime, getUnknownClients, get_metaData, get_pdfEntries, load_Messages, load_profile, process_attributes, save_attributes, setDHCPOption, setDefaultLeaseTime, setMaxLeaseTime, setUnknownClients,

__construct( string   $scope, ) : n/a

Description

Creates a new dhcp_settings object.

Arguments

Name Type Description Default
$scope string

account type

Return value

Type Description
n/a n/a

build_uploadAccounts( array   $rawAccounts, array   $ids, array   $partialAccounts, array   $selectedModules, ) : array

Description

In this function the LDAP account is built up.

Arguments

Name Type Description Default
$rawAccounts array

list of hash arrays (name => value) from user input

$ids array

list of IDs for column position (e.g. "posixAccount_uid" => 5)

$partialAccounts array

list of hash arrays (name => value) which are later added to LDAP

$selectedModules array

list of selected account modules

Return value

Type Description
array list of error messages if any

calculateNetMask( String   $subnet, ) : integer

Description

Calculates the net mask from the subnet.

Arguments

Name Type Description Default
$subnet String

subnet

Return value

Type Description
integer netmask

checkSubnetMask( String   $mask, ) : boolean

Description

Checks if the subnet mask is valid.

Arguments

Name Type Description Default
$mask String

subnet mask

Return value

Type Description
boolean correct or incorrect

display_html_attributes( ) : \htmlElement

Description

Returns the HTML meta data for the main account page.

Return value

Type Description
\htmlElement HTML meta data

getDHCPOption( String   $name, ) : String

Description

Returns a DHCP option.

Arguments

Name Type Description Default
$name String

option name

Return value

Type Description
String value

getDefaultLeaseTime( ) : String

Description

Returns the default lease time.

Return value

Type Description
String time

getMaxLeaseTime( ) : String

Description

Returns the maximum lease time.

Return value

Type Description
String time

getUnknownClients( ) : String

Description

Returns the unknown clients option.

Return value

Type Description
String unknown clients value

get_metaData( ) : array

Description

Returns meta data that is interpreted by parent class

Return value

Type Description
array array with meta data

get_pdfEntries( ) : array

Description

Returns the PDF entries for this module.

Return value

Type Description
array list of possible PDF entries

load_Messages( ) : n/a

Description

This function fills the message array.

Return value

Type Description
n/a n/a

load_profile( array   $profile, ) : n/a

Description

Loads the values of an account profile into internal variables.

Arguments

Name Type Description Default
$profile array

hash array with profile values (identifier => value)

Return value

Type Description
n/a n/a

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

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)

setDHCPOption( String   $name, String   $value, ) : n/a

Description

Sets a DHCP option.

Arguments

Name Type Description Default
$name String

option name

$value String

option value

Return value

Type Description
n/a n/a

setDefaultLeaseTime( String   $time, ) : n/a

Description

Sets the default lease time.

Arguments

Name Type Description Default
$time String

time

Return value

Type Description
n/a n/a

setMaxLeaseTime( String   $time, ) : n/a

Description

Sets the maximum lease time.

Arguments

Name Type Description Default
$time String

time

Return value

Type Description
n/a n/a

setUnknownClients( String   $option, ) : n/a

Description

Sets the unknown clients option.

Arguments

Name Type Description Default
$option String

allow/deny

Return value

Type Description
n/a n/a

Properties

$all_netbios_node_types, $allowDenyOptions, $attributes,

  private  $all_netbios_node_types =

all netbios node types


  private  $allowDenyOptions =

unknown-client options


  public  $attributes =

LDAP attributes


Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages