You are here

private function LdapUserAdminForm::checkPuidForOrphans in Lightweight Directory Access Protocol (LDAP) 8.3

Check PUID for orphan configuration.

Avoids the easy mistake of forgetting PUID and not being able to clean up users which are no longer available due to missing data.

Parameters

string $orphanCheck: Whether orphans are checked.

string $serverId: Which server is used for provisioning.

Return value

bool If there is an incosistent state.

1 call to LdapUserAdminForm::checkPuidForOrphans()
LdapUserAdminForm::validateForm in ldap_user/src/Form/LdapUserAdminForm.php
Form validation handler.

File

ldap_user/src/Form/LdapUserAdminForm.php, line 591

Class

LdapUserAdminForm
Provides the form to configure user configuration and field mapping.

Namespace

Drupal\ldap_user\Form

Code

private function checkPuidForOrphans($orphanCheck, $serverId) {
  if ($orphanCheck != 'ldap_user_orphan_do_not_check') {

    /** @var \Drupal\ldap_servers\Entity\Server $server */
    $server = $this->serverFactory
      ->getServerById($serverId);
    if (empty($server
      ->get('unique_persistent_attr'))) {
      return FALSE;
    }
  }
  return TRUE;
}