}
}
unset($group);
print "Listing done\n\n";
print "**Now processing each group one by one to calculation exclusions**\n\n";
foreach ($groupsToProcess as $group) {
    $expl = explode('/', $group);
    print "* Group '{$expl['1']}' from location '{$expl['0']}'\n";
    //
    // looking for AddressStore that is holding our group
    //
    if ($expl[0] == 'shared') {
        $store = $pan->addressStore;
    } else {
        if ($configType == 'panos') {
            $sub = $pan->findVirtualSystem($expl[0]);
            if ($sub === null) {
                derr("  ***ERROR*** cannot find VSYS '{$expl['0']}'\n\n");
            }
        } else {
            $sub = $pan->findDeviceGroup($expl[0]);
            if ($sub === null) {
                derr("  ***ERROR*** cannot find DeviceGroup '{$expl['0']}'\n\n");
            }
        }
        $store = $sub->addressStore;
    }
    //
    // Looking for the group inside the AddressStore we found
    //
    $groupToProcess = $store->find($expl[1], null, false);
Exemplo n.º 2
0
            $rulesToProcess = $pan->securityRules->postRules();
        }
    } else {
        $sub = $pan->findDeviceGroup($rulesLocation);
        if ($sub === null) {
            derr("DeviceGroup named '{$rulesLocation}' not found");
        }
        if ($panoramaPreRuleSelected) {
            $rulesToProcess = $sub->securityRules->preRules();
        } else {
            $rulesToProcess = $sub->securityRules->postRules();
        }
        $processedLocation = $sub;
    }
} else {
    $sub = $pan->findVirtualSystem($rulesLocation);
    if ($sub === null) {
        derr("VirtualSystem named '{$rulesLocation}' not found");
    }
    $rulesToProcess = $sub->securityRules->rules();
    $processedLocation = $sub;
}
if (!isset(PH::$args['method'])) {
    display_error_usage_exit(' no method was provided');
}
$method = strtolower(PH::$args['method']);
if (!isset($supportedMethods[$method])) {
    display_error_usage_exit("unsupported method '" . PH::$args['method'] . "' provided");
}
$method = $supportedMethods[$method];
if (!isset(PH::$args['mergedenyrules'])) {