it exists the loop on the first match inside plus being non-recursive the speed and resources used are minimal.

The problem I had with the recursive search also appears when re-using your code. I assume is a php version issue from the adldap library
```php
//check user against group list
if(isset($auth_data['mr_allowedGroups']))
{ 
    // Set mr_admin_groups to array
    $admin_groups = is_array($auth_data['mr_allowedGroups']) ? $auth_data['mr_allowedGroups'] : array($auth_data['mr_allowedGroups']);

    // Get groups from AD
    $groups = $adldap->user()->groups($login);

    foreach ($groups as $group)
    {
        if (in_array($group, $admin_groups)) 
        {
            $check = TRUE;
            break 3;
        }
    }

}
```
<pre>
...
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Users/nbalonso/Downloads/github_stuff/my_munkireport-php/app/lib/adLDAP/classes/adLDAPUtils.php on line 105
Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /Users/nbalonso/Downloads/github_stuff/my_munkireport-php/app/controllers/auth.php on line 132
Warning: Cannot modify header information - headers already sent by (output started at /Users/nbalonso/Downloads/github_stuff/my_munkireport-php/app/lib/adLDAP/classes/adLDAPUtils.php:105) in /Users/nbalonso/Downloads/github_stuff/my_munkireport-php/app/helpers/site_helper.php on line 149
</pre>