summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64085bc)
raw | patch | inline | side by side (parent: 64085bc)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Sep 2007 07:52:10 +0000 (07:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 Sep 2007 07:52:10 +0000 (07:52 +0000) |
Don't save the dhcpOption "server-name" for the dhcp service base object (cn=dhcp,cn=server...).
Save this attribute to all child objects instead. (host,group,subnet,sharedNetwork).
Fixed saving for newly created savers with dhcp service,
some attributes were not available while editing an entry like cn and dn.
This caused PHP Warnings and empty server-name options.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7397 594d385d-05f5-0310-b6e9-bd551577e9d8
Save this attribute to all child objects instead. (host,group,subnet,sharedNetwork).
Fixed saving for newly created savers with dhcp service,
some attributes were not available while editing an entry like cn and dn.
This caused PHP Warnings and empty server-name options.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7397 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_dhcpService.inc | patch | blob | history | |
plugins/admin/systems/class_servDHCP.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_dhcpService.inc b/plugins/admin/systems/class_dhcpService.inc
index b3d7e0b0bc8624f3573c1b2cf7ba651650d58d31..57f76cc9e19f43440605f282931cfdac49ec679c 100644 (file)
$this->attrs['dhcpPrimaryDN']= array($this->dhcpPrimaryDN);
$this->removeOption('server-name');
- $this->attrs['dhcpOption'][]= "server-name $server_name";
+# $this->attrs['dhcpOption'][]= "server-name $server_name";
return ($this->attrs);
}
index d631b13853ca6cd0cab596f12c0f1fbfa0d74a60..aea61346b4eb2339595e0b77c609d831fc1b2a10 100644 (file)
continue;
}
+ /* Opdate dhcp option 'server-name' to actual server name */
+ if($this->dn != $this->orig_dn){
+ $fixed = FALSE;
+ foreach(array("dhcpHost","dhcpSubnet","dhcpGroup","dhcpSharedNetwork") as $object){
+ if(in_array($object,$data['objectClass']) && isset($data['dhcpOption'])){
+ foreach($data['dhcpOption'] as $key => $option){
+ if(preg_match("/^server-name /",$option)){
+ $data['dhcpOption'][$key] = "server-name ".$this->cn;
+ $data['MODIFIED'] = TRUE;
+ break;
+ }
+ }
+ }
+
+ /* Skip next loops if entry is updated */
+ if($fixed){
+ break;
+ }
+ }
+ }
+
/* Modify existing entry? */
if (isset($data['MODIFIED']) || $this->orig_dn != $this->dn){