Am I missing a dependency or something - I cannot see where to import users?

Comments

miglius’s picture

Expand the "Upload accounts" fieldset at the bottom of 'admin/user/accounts' page.

eft’s picture

I don't see it there - do I have to configure something under admin/settings/ldap/ldapprov ?

Also, I only want to create accounts in the Drupal db for which LDAP accounts already exist. I don't want the provisioning module to create accounts on the LDAP server.

Thanks

eft’s picture

ok - I see - I had to enable the LDAP user provisioning at admin/settings/ldap/ldapprov

however, it looks like this module is specifically for creating LDAP accounts - maybe I should be looking at another method/module for bulk creation of Drupal users (matching existing LDAP accounts).

Alan D.’s picture

Also interested in if we can get a one way bulk import of users from the LDAP Server.

In our use case, the LDAP server is actually going to be an adaptor bridge between a custom Perl script and Drupal for one way flow of data from Perl file system database to Drupal. The Perl API runs from a custom file system based storage of sterilized objects that is already integrated into LDAP, so this is looking like the easiest approach.

miglius’s picture

The accounts from the csv file are created in LDAP and cannot be used to create stand alone drupal users.

Alan D.’s picture

Thanks Miglius.

While this response is limited to the server limit, the following gives a start to the listing:

<?php

function acrrm_ldap_all_users() {
  global $_ldapauth_ldap;

  if (!$_ldapauth_ldap)
    return;

  // If there is no bindn and bindpw - the connect will be an anonymous connect.
  $_ldapauth_ldap->connect($_ldapauth_ldap->getOption('binddn'), $_ldapauth_ldap->getOption('bindpw'));
  foreach (explode("\r\n", $_ldapauth_ldap->getOption('basedn')) as $base_dn) {
    if ($base_dn) {
      $name_attr = $_ldapauth_ldap->getOption('user_attr') ? $_ldapauth_ldap->getOption('user_attr') : LDAPAUTH_DEFAULT_USER_ATTR;
      $filter = "($name_attr=*)";
      $result = $_ldapauth_ldap->search($base_dn, $filter);

      if ($result && $result['count'] >= 1) {
        unset($result['count']);
        return $result;
      }
    }
  }
  return array();
}

?>
drfuzetto’s picture

I am looking to upload the accounts from AD into Drupal without the user having to log in.

It does look like this module will creating LDAP accounts on the server. I don't want to do that I want to take all of the accounts on the LDAP server and create accounts in Drupal.

How do I do this?

tchronister’s picture

I thought that defeats the purpose of this module? My understanding and hope for implementing is that the Drupal users table is irrelevant and authentication occurs via the LDAP users on a whole other server, whether on the LAN or not. Correct?

batje’s picture

@tchronister. The drupal user table (and the drupal uid) is still needed to identify the author of nodes, to allow people to have a profile page, etc.

The password field is less relevant as authentication is done against ldap. (however, i think when ldap is not available and the drupal password matches the provided password, drupal might still log the user in. not 100% sure though, you'd have to try)

zydoon’s picture

Hi

does the bulk user creation works for you ? on LDAP of course.