diff --git a/php/classes/UserMgr.php b/php/classes/UserMgr.php index dcafb51..c6a5e9b 100644 --- a/php/classes/UserMgr.php +++ b/php/classes/UserMgr.php @@ -704,9 +704,6 @@ class UserMgr protected function updateTreeForGrpsAndTimeRestrictions($file) { - if (!isset($this->userGrps)) - return TRUE; - $xml = new DomDocument("1.0"); if(!$xml->load($file)) @@ -714,18 +711,20 @@ class UserMgr $xp = new domxpath($xml); - foreach ($this->userGrps as $grp) { - $nodes = $xp->query("//*[@group='".$grp."']"); + if (!empty($this->userGrps)) { + foreach ($this->userGrps as $grp) { + $nodes = $xp->query("//*[@group='".$grp."']"); - if ($nodes->length > 0) - foreach ($nodes as $node) { - $node->removeAttribute('group'); - if ($node->hasAttribute('restriction')) { - if ($node->getAttribute('restriction') != "plotOnly") { - $node->removeAttribute('restriction'); + if ($nodes->length > 0) + foreach ($nodes as $node) { + $node->removeAttribute('group'); + if ($node->hasAttribute('restriction')) { + if ($node->getAttribute('restriction') != "plotOnly") { + $node->removeAttribute('restriction'); + } } - } - } + } + } } if (!empty($this->datasetsTimeRestriction)) { -- libgit2 0.21.2