@@ 282-293 (lines=12) @@ | ||
279 | * @param Account $a |
|
280 | * @param UserInterface $backend |
|
281 | */ |
|
282 | private function syncDisplayName(Account $a, UserInterface $backend) { |
|
283 | $uid = $a->getUserId(); |
|
284 | if ($backend instanceof IProvidesDisplayNameBackend || $backend->implementsActions(\OC_User_Backend::GET_DISPLAYNAME)) { |
|
285 | $displayName = $backend->getDisplayName($uid); |
|
286 | $a->setDisplayName($displayName); |
|
287 | if (\array_key_exists('displayName', $a->getUpdatedFields())) { |
|
288 | $this->logger->debug( |
|
289 | "Setting displayName for <$uid> to <$displayName>", ['app' => self::class] |
|
290 | ); |
|
291 | } |
|
292 | } |
|
293 | } |
|
294 | ||
295 | /** |
|
296 | * @param Account $a |
|
@@ 299-311 (lines=13) @@ | ||
296 | * @param Account $a |
|
297 | * @param UserInterface $backend |
|
298 | */ |
|
299 | private function syncSearchTerms(Account $a, UserInterface $backend) { |
|
300 | $uid = $a->getUserId(); |
|
301 | if ($backend instanceof IProvidesExtendedSearchBackend) { |
|
302 | $searchTerms = $backend->getSearchTerms($uid); |
|
303 | $a->setSearchTerms($searchTerms); |
|
304 | if ($a->haveTermsChanged()) { |
|
305 | $logTerms = \implode('|', $searchTerms); |
|
306 | $this->logger->debug( |
|
307 | "Setting searchTerms for <$uid> to <$logTerms>", ['app' => self::class] |
|
308 | ); |
|
309 | } |
|
310 | } |
|
311 | } |
|
312 | ||
313 | /** |
|
314 | * @param Account $a |