Update files to PSR-2 standards

This commit is contained in:
Brennan Murphy 2018-07-02 17:27:43 +00:00
parent d640cc1eee
commit 37aa8b05f8
3 changed files with 302 additions and 298 deletions

View File

@ -206,10 +206,13 @@ class LdapService
* @param array $checked * @param array $checked
* @return array * @return array
*/ */
private function getGroupsRecursive($groupsArray,$checked) { private function getGroupsRecursive($groupsArray, $checked)
{
$groups_to_add = []; $groups_to_add = [];
foreach ($groupsArray as $groupName) { foreach ($groupsArray as $groupName) {
if (in_array($groupName,$checked)) continue; if (in_array($groupName, $checked)) {
continue;
}
$groupsToAdd = $this->getGroupGroups($groupName); $groupsToAdd = $this->getGroupGroups($groupName);
$groups_to_add = array_merge($groups_to_add, $groupsToAdd); $groups_to_add = array_merge($groups_to_add, $groupsToAdd);
@ -260,7 +263,9 @@ class LdapService
$groupsAttr = strtolower($this->config['group_attribute']); $groupsAttr = strtolower($this->config['group_attribute']);
$ldapGroups = []; $ldapGroups = [];
$count = 0; $count = 0;
if (isset($ldapSearchReturn[$groupsAttr]['count'])) $count = (int) $ldapSearchReturn[$groupsAttr]['count']; if (isset($ldapSearchReturn[$groupsAttr]['count'])) {
$count = (int) $ldapSearchReturn[$groupsAttr]['count'];
}
for ($i=0; $i<$count; $i++) { for ($i=0; $i<$count; $i++) {
$dnComponents = ldap_explode_dn($ldapSearchReturn[$groupsAttr][$i], 1); $dnComponents = ldap_explode_dn($ldapSearchReturn[$groupsAttr][$i], 1);
if (!in_array($dnComponents[0], $ldapGroups)) { if (!in_array($dnComponents[0], $ldapGroups)) {
@ -269,5 +274,4 @@ class LdapService
} }
return $ldapGroups; return $ldapGroups;
} }
} }