summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd076d3)
raw | patch | inline | side by side (parent: bd076d3)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Aug 2007 07:38:27 +0000 (07:38 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Aug 2007 07:38:27 +0000 (07:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7014 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_dhcpPlugin.inc | patch | blob | history |
index c0da9bf10bbcbd0fb1826e45f35e6a62cdf70fc1..93c5b507a6dcd76725beb4d01abad8c649d161cc 100644 (file)
if (isset($attrs['dhcpOption'])){
foreach ($attrs['dhcpOption'] as $opt){
$idx= preg_replace('/\s.+$/', '', $opt);
- $value= preg_replace('/^[^\s]+\s/', '', $opt);
+ if ($idx == $opt){
+ $value= "";
+ } else {
+ $value= preg_replace('/^[^\s]+\s/', '', $opt);
+ }
$this->options[$idx]= $value;
}
}
if (isset($attrs['dhcpStatements'])){
foreach ($attrs['dhcpStatements'] as $opt){
$idx= preg_replace('/\s.+$/', '', $opt);
- $value= preg_replace('/^[^\s]+\s/', '', $opt);
+ if ($idx == $opt){
+ $value= "";
+ } else {
+ $value= preg_replace('/^[^\s]+\s/', '', $opt);
+ }
$this->statements[$idx]= $value;
}
}
return ($this->attrs);
}
+
+ function removeAttrs($name, $type)
+ {
+ $new= array();
+ foreach ($this->attrs[$type] as $value){
+ if (!preg_match("/^$name /", $value)){
+ $new[]= $value;
+ }
+ }
+ $this->attrs[$type]= $new;
+ }
+
+
+ function removeOption($name)
+ {
+ $this->removeAttrs($name, 'dhcpOption');
+ }
+
+
+ function removeStatement($name)
+ {
+ $this->removeAttrs($name, 'dhcpStatement');
+ }
+
}
?>