Skip to content

Commit a15e918

Browse files
committed
Merge branch 'main' into patch-6
2 parents e3a171b + 18175ba commit a15e918

File tree

4 files changed

+1417
-66
lines changed

4 files changed

+1417
-66
lines changed

resources/lib/UnityLDAP.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,35 @@ public function getOrgGroupEntry($gid)
332332
$gid = ldap_escape($gid, LDAP_ESCAPE_DN);
333333
return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_ORGGROUPOU);
334334
}
335+
336+
public static function parseUserChildrenArray(array $userChildrenArray): array
337+
{
338+
// input comes from LdapEntry::getChildrenArray on a UnityUser
339+
$output = [];
340+
$required_string_attributes = [
341+
"gidnumber",
342+
"givenname",
343+
"homedirectory",
344+
"loginshell",
345+
"mail",
346+
"o",
347+
"sn",
348+
"uid",
349+
"uidnumber",
350+
"gecos",
351+
];
352+
foreach ($required_string_attributes as $key) {
353+
$output[$key] = $userChildrenArray[$key][0];
354+
}
355+
$output["firstname"] = $output["givenname"];
356+
$output["lastname"] = $output["sn"];
357+
$output["org"] = $output["o"];
358+
$output["objectclass"] = $userChildrenArray["objectclass"];
359+
if (array_key_exists("sspublickey", $userChildrenArray)) {
360+
$output["sshpublickey"] = $userChildrenArray["sshpublickey"];
361+
} else {
362+
$output["sshpublickey"] = [];
363+
}
364+
return $output;
365+
}
335366
}

resources/lib/UnityRedis.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,9 @@ public function removeCacheArray($object, $key, $value)
9595
$this->setCache($object, $key, $cached_val);
9696
}
9797
}
98+
99+
public function flushAll()
100+
{
101+
$this->client->flushAll();
102+
}
98103
}

0 commit comments

Comments
 (0)