You are here

public function SimpleLdapTestController::test in Simple LDAP 8

1 string reference to 'SimpleLdapTestController::test'
simple_ldap.routing.yml in ./simple_ldap.routing.yml
simple_ldap.routing.yml

File

src/Controller/SimpleLdapTestController.php, line 9

Class

SimpleLdapTestController

Namespace

Drupal\simple_ldap\Controller

Code

public function test() {

  //    $server = \Drupal::service('simple_ldap.server');
  //
  //    $server->connect();
  //    $server->bind();
  //    $results = $server->search('dc=local', 'cn=*', 'sub');
  $auth = \Drupal::service('simple_ldap_user.auth');
  $dn = $auth
    ->getUserDN('ldapuser');
  return array(
    '#type' => 'markup',
    '#markup' => $dn,
  );
}