Where do I specify CSV file for importing users?

eft - August 27, 2009 - 15:40
Project:LDAP provisioning
Version:6.x-1.0-beta1
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

miglius - August 27, 2009 - 16:39

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

#2

eft - August 27, 2009 - 17:13

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

#3

eft - August 27, 2009 - 17:41

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).

#4

Alan D. - October 19, 2009 - 06:55

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.

#5

miglius - October 19, 2009 - 16:38

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

#6

Alan D. - October 20, 2009 - 02:21

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();
}

?>

 
 

Drupal is a registered trademark of Dries Buytaert.