You are here

public function Server::getFormattedBind in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_servers/src/Entity/Server.php \Drupal\ldap_servers\Entity\Server::getFormattedBind()

Returns the formatted label of the bind method.

Return value

string The formatted text for the current bind.

File

ldap_servers/src/Entity/Server.php, line 138

Class

Server
Defines the Server entity.

Namespace

Drupal\ldap_servers\Entity

Code

public function getFormattedBind() {
  switch ($this
    ->get('bind_method')) {
    case 'service_account':
    default:
      $namedBind = t('service account bind');
      break;
    case 'user':
      $namedBind = t('user credentials bind');
      break;
    case 'anon':
      $namedBind = t('anonymous bind (search), then user credentials');
      break;
    case 'anon_user':
      $namedBind = t('anonymous bind');
      break;
  }
  return $namedBind;
}