LdapTools\Security\SddlParser::parseControlFlags PHP Method

parseControlFlags() protected method

protected parseControlFlags ( string $ctrlFlags, string $aclType, SecurityDescriptor $sd )
$ctrlFlags string
$aclType string
$sd SecurityDescriptor
    protected function parseControlFlags($ctrlFlags, $aclType, SecurityDescriptor $sd)
    {
        $flags = ['P' => $aclType . 'ACL_PROTECTED', 'AR' => $aclType . 'ACL_AUTO_INHERIT_REQ', 'AI' => $aclType . 'ACL_AUTO_INHERIT'];
        foreach ($flags as $flag => $name) {
            if (strpos($ctrlFlags, $flag) !== false) {
                $sd->getControlFlags()->add(ControlFlags::FLAG[$name]);
                $ctrlFlags = str_replace($flag, '', $ctrlFlags);
            }
        }
        if (!empty($ctrlFlags)) {
            throw new SddlParserException(sprintf('The control flag(s) "%s" passed to the %sACL are not recognized.', $ctrlFlags, $aclType));
        }
    }