fixed error when account without DHCP statements was loaded

This commit is contained in:
Roland Gruber 2008-12-29 16:59:54 +00:00
parent 6d4eb8b4d9
commit 0f91268ec1
1 changed files with 7 additions and 6 deletions

View File

@ -209,17 +209,18 @@ class ddns extends baseModule {
$attrTmp = $attr; $attrTmp = $attr;
unset($attr); unset($attr);
foreach($attrTmp['dhcpStatements'] AS $value) { if (array_key_exists('dhcpStatements', $attrTmp) && is_array($attrTmp['dhcpStatements'])) {
$ex = explode(" ", $value); foreach($attrTmp['dhcpStatements'] AS $value) {
$ex = explode(" ", $value);
if ($ex[0] == 'zone') {
$attr['dhcpStatements'][] = $value; if ($ex[0] == 'zone') {
$attr['dhcpStatements'][] = $value;
}
} }
} }
unset($attrTmp); unset($attrTmp);
// Alles, was über dem ArrayIndex 3 liegt, wird gelöscht:
if (!is_array($attr)) $attr = array(); if (!is_array($attr)) $attr = array();
$this->orig = $attr; $this->orig = $attr;