diff options
author | Simon Rettberg | 2016-09-09 18:16:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-09-09 18:16:46 +0200 |
commit | d2d7f27f58235db9ac428b9dd952e7b108f3c381 (patch) | |
tree | 6d59083fd82fb09e2db7444af0525e78b5b5fa76 /modules-available/locations/inc/location.inc.php | |
parent | [exams] Less bla (diff) | |
download | slx-admin-d2d7f27f58235db9ac428b9dd952e7b108f3c381.tar.gz slx-admin-d2d7f27f58235db9ac428b9dd952e7b108f3c381.tar.xz slx-admin-d2d7f27f58235db9ac428b9dd952e7b108f3c381.zip |
[locations/statistics] Make machine counting more consistent
Diffstat (limited to 'modules-available/locations/inc/location.inc.php')
-rw-r--r-- | modules-available/locations/inc/location.inc.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index 81ee342f..bde07e61 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -140,6 +140,7 @@ class Location foreach ($tree as $node) { $output[(int)$node['locationid']] = array( 'locationid' => $node['locationid'], + 'parentlocationid' => $node['parentlocationid'], 'locationname' => $node['locationname'], 'locationpad' => str_repeat('--', $depth), 'isleaf' => empty($node['children']), @@ -287,7 +288,7 @@ class Location /** * @return array|bool assoc array mapping from locationid to subnets */ - public static function getSubnetsByLocation(&$overlapSelf, &$overlapOther) + public static function getSubnetsByLocation(&$overlapSelf, &$overlapOther, $recursive = true) { $locs = self::getLocationsAssoc(); $subnets = self::getSubnets(); @@ -307,6 +308,8 @@ class Location 'startaddr' => $subnet['startaddr'], 'endaddr' => $subnet['endaddr'] ); + if (!$recursive) + break; $lid = $locs[$lid]['parentlocationid']; } } |