Minor changes to match coding style of original coder

This commit is contained in:
S-A-L13 2024-02-27 13:10:53 +01:00
parent ebf7540554
commit f4554374bd

View file

@ -289,12 +289,14 @@ class LdapIdentities implements IIdentities
@paraam string $mailPrefix @paraam string $mailPrefix
@return array @return array
*/ */
private function CleanupMailAddresses(array $entries, string $mailField, string $mailPrefix) { private function CleanupMailAddresses(array $entries, string $mailField, string $mailPrefix)
{
if (!empty($mailPrefix)) { if (!empty($mailPrefix)) {
for ($i = 0; $i < $entries["count"]; $i++) { for ($i = 0; $i < $entries["count"]; $i++) {
// Remove addresses without the given prefix // Remove addresses without the given prefix
$entries[$i]["$mailField"] = array_filter($entries[$i]["$mailField"], $entries[$i]["$mailField"] = array_filter($entries[$i]["$mailField"],
function($prefixMail) { function($prefixMail)
{
// $mailPrefix can't be used here, because it's nailed to the CleanupMailAddresses function and can't be passed to the array_filter function afaik. // $mailPrefix can't be used here, because it's nailed to the CleanupMailAddresses function and can't be passed to the array_filter function afaik.
// Ideas to avoid this are welcome. // Ideas to avoid this are welcome.
if (stripos($prefixMail, $this->config->mail_prefix) === 0) { if (stripos($prefixMail, $this->config->mail_prefix) === 0) {
@ -321,7 +323,6 @@ class LdapIdentities implements IIdentities
return $entries; return $entries;
} }
/** /**
* @param array $entry * @param array $entry
* @param string $attribute * @param string $attribute