My objective is to pick a user from an ldap and then create his drupal account.

In order to do this,

1) a user picks a name (dn) from an LDAP server using the LDAP Entry Reference module (which offers autocomplete search)

2) after the user has completed his input, I use a Rule to create the drupal account : - dn enables me to search the LDAP with a "View Loop" and get the email - with the name and the email, the rules can create the drupal account.

I use LDAP Query and LDAP Views to build the view.

The problem is that the View Loop returns empty results although the views results are correct if I use the views from UI.

I have tested the view with no parameter, no filter, simple LDAP Query, minimalistic ldap (3 users in the LDAP). My connection to the LDAP is OK : new users can log in with LDAP before drupal account creation : all this is OK.

Do you know of such an error using LDAP Views as a Rules View Loop ? or could you advice how to debugg ?

Or do you know another way to achieve my goal ? (pick a user from ldap then programmatically create the drupal account ?)

my need is exactly what is described here : https://drupal.asu.edu/resources/docs/modules/asu_userpicker . But the module is not available at this url and is designed to be used with other tools.



1 Answer 1


I solved the problem by another way :

Within Rules : First action : create a new entity (user) set the account name, set the account email with a fake value in the email. Second action : unblock user (if blocked, the user account will not be synchronized from LDAP)

Then , when the account is created, the Drupal account is automatically synchronized from LDAP and get the good email.

(In LDAP configuration , be sure to configre LDAP User / BASIC PROVISIONING TO DRUPAL ACCOUNT SETTINGS/ Drupal Account Provisioning Events to "Create or Synch to Drupal user anytime a Drupal user account is created or updated."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.