Unverified Commit c46b4687 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(dhcp) Fix PHP errors in DHCP plugins

issue #6140
Showing with 12 additions and 0 deletions
+12 -0
...@@ -102,11 +102,23 @@ class dhcpPlugin extends simplePlugin ...@@ -102,11 +102,23 @@ class dhcpPlugin extends simplePlugin
'</p>'; '</p>';
} }
/*
* Returns an array of attributes values, with all values being arrays.
* */
function save (): array function save (): array
{ {
$this->dn = $this->compute_dn(); $this->dn = $this->compute_dn();
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'save'); @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'save');
$this->prepare_save(); $this->prepare_save();
foreach ($this->attrs as $key => $value) {
if (!is_array($value)) {
if ($value == '') {
$this->attrs[$key] = [];
} else {
$this->attrs[$key] = [$value];
}
}
}
$this->attrs['cn'] = [$this->cn]; $this->attrs['cn'] = [$this->cn];
$this->attrs['objectClass'] = $this->objectclasses; $this->attrs['objectClass'] = $this->objectclasses;
$this->attrs['dn'] = $this->dn; $this->attrs['dn'] = $this->dn;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment