diff --git a/lam/HISTORY b/lam/HISTORY index 6b0694d5..d5f88764 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -2,6 +2,7 @@ March 2013 4.1 - updated EDU person module (RFE 3599128) - Personal: allow management of user certificates (RFE 1753030) - Unix: Support Samba Unix Id pool for automatic UID/GID generation + - DHCP: support separated dhcpServer and dhcpService entries - LAM Pro: -> support Qmail groups - fixed bugs: diff --git a/lam/docs/manual-sources/howto.xml b/lam/docs/manual-sources/howto.xml index 2c67b992..1ab43dbf 100644 --- a/lam/docs/manual-sources/howto.xml +++ b/lam/docs/manual-sources/howto.xml @@ -3116,8 +3116,13 @@ Have fun! You can mange your DHCP server with LAM. It supports to manage subnets, fixed IP entries, IP ranges and DDNS. The DHCP can be activated by adding the account type DHCP to your server profile. Please also add - the DHCP modules. LAM requires that you use an LDAP entry with the - object class "dhcpServer" as suffix for this account type. + the DHCP modules. + + LAM requires that you use an LDAP entry with the object class + "dhcpService" or "dhcpServer" as suffix for this account type. If the + "dhcpServer" entry points to a "dhcpService" entry via "dhcpServiceDN" + then you need to use the DN of the "dhcpService" entry as LDAP suffix + for DHCP. @@ -3208,7 +3213,8 @@ Run slapindex to rebuild the index. - You can manage the settings of your DHCP server entry: + You can manage the settings of your DHCP service/server + entry: diff --git a/lam/docs/manual-sources/images/ddns.png b/lam/docs/manual-sources/images/ddns.png index 7f1a4be0..64d65401 100644 Binary files a/lam/docs/manual-sources/images/ddns.png and b/lam/docs/manual-sources/images/ddns.png differ diff --git a/lam/docs/manual-sources/images/dhcpMainSettings.png b/lam/docs/manual-sources/images/dhcpMainSettings.png index 73346503..e4f44c45 100644 Binary files a/lam/docs/manual-sources/images/dhcpMainSettings.png and b/lam/docs/manual-sources/images/dhcpMainSettings.png differ diff --git a/lam/docs/manual-sources/images/dhcpSettings.png b/lam/docs/manual-sources/images/dhcpSettings.png index 1525e6b9..c4ded2d6 100644 Binary files a/lam/docs/manual-sources/images/dhcpSettings.png and b/lam/docs/manual-sources/images/dhcpSettings.png differ diff --git a/lam/docs/manual-sources/images/fixedIP.png b/lam/docs/manual-sources/images/fixedIP.png index 31b2bdde..97b6f35e 100644 Binary files a/lam/docs/manual-sources/images/fixedIP.png and b/lam/docs/manual-sources/images/fixedIP.png differ diff --git a/lam/docs/manual-sources/images/ranges.png b/lam/docs/manual-sources/images/ranges.png index d3d083ab..43e25be6 100644 Binary files a/lam/docs/manual-sources/images/ranges.png and b/lam/docs/manual-sources/images/ranges.png differ diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 7f39bcb0..b3428d36 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1643,7 +1643,7 @@ class accountContainer { for ($j=0; $jattributes = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->attributes; - $this->orig = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->orig; - } - /** * Returns meta data that is interpreted by parent class. * @@ -168,7 +155,7 @@ class ddns extends baseModule { public function module_complete() { if ($this->getAccountContainer()->dn_orig==$_SESSION['config']->get_suffix('dhcp')) { // check if DHCP main settings and valid DHCP entry - if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { + if (!in_array_ignore_case('dhcpService', $this->attributes['objectClass']) && !in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { return false; } //Main settings @@ -193,6 +180,22 @@ class ddns extends baseModule { return true; } + /** + * Returns a list of modifications which have to be made to the LDAP account. + * + * @return array 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 + *
"info" are values with informational value (e.g. to be used later by pre/postModify actions) + */ + public function save_attributes() { + // done by dhcp_server object + } + /** * This function check if ddns is enable. */ @@ -249,7 +252,7 @@ class ddns extends baseModule { * Process for mainsettings */ public function process_attributes_mainSettings() { - if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { + if (!in_array_ignore_case('dhcpService', $this->attributes['objectClass']) && !in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { return array(); } $errors = array(); @@ -339,11 +342,13 @@ class ddns extends baseModule { * @return htmlElement HTML meta data */ public function display_html_attributes() { + $this->attributes = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->attributes; + $this->orig = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->orig; $return = new htmlTable(); // check if DHCP main settings and valid DHCP entry if ($_SESSION['config']->get_suffix('dhcp') == $this->getAccountContainer()->dn_orig) { - if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { - $return->addElement(new htmlStatusMessage('ERROR', _('Please set your LDAP suffix to an LDAP entry with object class "dhcpServer".'))); + if (!in_array_ignore_case('dhcpService', $this->attributes['objectClass']) && !in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { + $return->addElement(new htmlStatusMessage('ERROR', _('Please set your LDAP suffix to an LDAP entry with object class "dhcpService" or "dhcpServer".'))); return $return; } } @@ -364,7 +369,6 @@ class ddns extends baseModule { else { // DNS server $serverInput = new htmlTableExtendedInputField(_('IP address of the DNS server'), 'ip', $this->getDNSServer(), 'dns'); - $serverInput->setRequired(true); $return->addElement($serverInput, true); $zones = $this->getZoneNames(); @@ -378,11 +382,9 @@ class ddns extends baseModule { } // zone names $zoneInput = new htmlTableExtendedInputField(_('Zone names'), 'zone', $zone, 'zone'); - $zoneInput->setRequired(true); $return->addElement($zoneInput, true); // reverse zone names $revZoneInput = new htmlTableExtendedInputField(_('Reverse zone names'), 'zone_reverse', $revzone, 'zone_reverse'); - $revZoneInput->setRequired(true); $return->addElement($revZoneInput); } } @@ -396,6 +398,9 @@ class ddns extends baseModule { * @return array list of possible PDF entries */ public function get_pdfEntries() { + // attributes are taken from DHCP server object + $this->attributes = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->attributes; + $this->orig = &$this->getAccountContainer()->getAccountModule('dhcp_settings')->orig; $zones = $this->getZoneNames(); $zone = ''; $revzone = ''; diff --git a/lam/lib/modules/dhcp_settings.inc b/lam/lib/modules/dhcp_settings.inc index 4e43e838..1379ca64 100644 --- a/lam/lib/modules/dhcp_settings.inc +++ b/lam/lib/modules/dhcp_settings.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2008 Thomas Manninger - 2008 - 2012 Roland Gruber + 2008 - 2013 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -342,7 +342,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I public function process_attributes() { // check if DHCP main settings and valid DHCP entry if ($_SESSION['config']->get_suffix('dhcp') == $this->getAccountContainer()->dn_orig) { - if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { + if (!in_array_ignore_case('dhcpService', $this->attributes['objectClass']) && !in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { return array(); } } @@ -517,8 +517,8 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I $return = new htmlTable(); // check if DHCP main settings and valid DHCP entry if ($_SESSION['config']->get_suffix('dhcp') == $this->getAccountContainer()->dn_orig) { - if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { - $return->addElement(new htmlStatusMessage('ERROR', _('Please set your LDAP suffix to an LDAP entry with object class "dhcpServer".'))); + if (!in_array_ignore_case('dhcpService', $this->attributes['objectClass']) && !in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { + $return->addElement(new htmlStatusMessage('ERROR', _('Please set your LDAP suffix to an LDAP entry with object class "dhcpService" or "dhcpServer".'))); return $return; } }